vfs: keep list of mounts for each superblock
Keep track of vfsmounts belonging to a superblock. List is protected by vfsmount_lock. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -142,6 +142,7 @@ static struct super_block *alloc_super(struct file_system_type *type)
|
||||
INIT_LIST_HEAD(&s->s_dentry_lru);
|
||||
INIT_LIST_HEAD(&s->s_inode_lru);
|
||||
spin_lock_init(&s->s_inode_lru_lock);
|
||||
INIT_LIST_HEAD(&s->s_mounts);
|
||||
init_rwsem(&s->s_umount);
|
||||
mutex_init(&s->s_lock);
|
||||
lockdep_set_class(&s->s_umount, &type->s_umount_key);
|
||||
@@ -200,6 +201,7 @@ static inline void destroy_super(struct super_block *s)
|
||||
free_percpu(s->s_files);
|
||||
#endif
|
||||
security_sb_free(s);
|
||||
WARN_ON(!list_empty(&s->s_mounts));
|
||||
kfree(s->s_subtype);
|
||||
kfree(s->s_options);
|
||||
kfree(s);
|
||||
|
Reference in New Issue
Block a user