diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-11-21 06:11:30 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-06 23:20:12 -0500 |
commit | 39f7c4db1d2d9e2e2a90abdf34811783089d217d (patch) | |
tree | cbc3496ce21e26b5891bb4c4d4155853317ddfb3 /fs/super.c | |
parent | 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4 (diff) |
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>
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c index 0413f51a9f0f..993ca8f128d6 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -142,6 +142,7 @@ static struct super_block *alloc_super(struct file_system_type *type) | |||
142 | INIT_LIST_HEAD(&s->s_dentry_lru); | 142 | INIT_LIST_HEAD(&s->s_dentry_lru); |
143 | INIT_LIST_HEAD(&s->s_inode_lru); | 143 | INIT_LIST_HEAD(&s->s_inode_lru); |
144 | spin_lock_init(&s->s_inode_lru_lock); | 144 | spin_lock_init(&s->s_inode_lru_lock); |
145 | INIT_LIST_HEAD(&s->s_mounts); | ||
145 | init_rwsem(&s->s_umount); | 146 | init_rwsem(&s->s_umount); |
146 | mutex_init(&s->s_lock); | 147 | mutex_init(&s->s_lock); |
147 | lockdep_set_class(&s->s_umount, &type->s_umount_key); | 148 | lockdep_set_class(&s->s_umount, &type->s_umount_key); |
@@ -200,6 +201,7 @@ static inline void destroy_super(struct super_block *s) | |||
200 | free_percpu(s->s_files); | 201 | free_percpu(s->s_files); |
201 | #endif | 202 | #endif |
202 | security_sb_free(s); | 203 | security_sb_free(s); |
204 | WARN_ON(!list_empty(&s->s_mounts)); | ||
203 | kfree(s->s_subtype); | 205 | kfree(s->s_subtype); |
204 | kfree(s->s_options); | 206 | kfree(s->s_options); |
205 | kfree(s); | 207 | kfree(s); |