Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fold destroy_super() into __put_super()

There's only one caller of destroy_super() left now. Fold it there,
and replace those list_lru_destroy() calls with checks that they
had already been done (as they should have, when we were dropping
the last active reference).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro c645b930 0200894d

+10 -21
+10 -21
fs/super.c
··· 154 154 schedule_work(&s->destroy_work); 155 155 } 156 156 157 - /** 158 - * destroy_super - frees a superblock 159 - * @s: superblock to free 160 - * 161 - * Frees a superblock. 162 - */ 163 - static void destroy_super(struct super_block *s) 164 - { 165 - list_lru_destroy(&s->s_dentry_lru); 166 - list_lru_destroy(&s->s_inode_lru); 167 - security_sb_free(s); 168 - WARN_ON(!list_empty(&s->s_mounts)); 169 - put_user_ns(s->s_user_ns); 170 - kfree(s->s_subtype); 171 - call_rcu(&s->rcu, destroy_super_rcu); 172 - } 173 - 174 157 /* Free a superblock that has never been seen by anyone */ 175 158 static void destroy_unused_super(struct super_block *s) 176 159 { ··· 263 280 /* 264 281 * Drop a superblock's refcount. The caller must hold sb_lock. 265 282 */ 266 - static void __put_super(struct super_block *sb) 283 + static void __put_super(struct super_block *s) 267 284 { 268 - if (!--sb->s_count) { 269 - list_del_init(&sb->s_list); 270 - destroy_super(sb); 285 + if (!--s->s_count) { 286 + list_del_init(&s->s_list); 287 + WARN_ON(s->s_dentry_lru.node); 288 + WARN_ON(s->s_inode_lru.node); 289 + WARN_ON(!list_empty(&s->s_mounts)); 290 + security_sb_free(s); 291 + put_user_ns(s->s_user_ns); 292 + kfree(s->s_subtype); 293 + call_rcu(&s->rcu, destroy_super_rcu); 271 294 } 272 295 } 273 296