mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 10:13:57 +08:00
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>
This commit is contained in:
parent
0200894d11
commit
c645b93098
31
fs/super.c
31
fs/super.c
@ -154,23 +154,6 @@ static void destroy_super_rcu(struct rcu_head *head)
|
||||
schedule_work(&s->destroy_work);
|
||||
}
|
||||
|
||||
/**
|
||||
* destroy_super - frees a superblock
|
||||
* @s: superblock to free
|
||||
*
|
||||
* Frees a superblock.
|
||||
*/
|
||||
static void destroy_super(struct super_block *s)
|
||||
{
|
||||
list_lru_destroy(&s->s_dentry_lru);
|
||||
list_lru_destroy(&s->s_inode_lru);
|
||||
security_sb_free(s);
|
||||
WARN_ON(!list_empty(&s->s_mounts));
|
||||
put_user_ns(s->s_user_ns);
|
||||
kfree(s->s_subtype);
|
||||
call_rcu(&s->rcu, destroy_super_rcu);
|
||||
}
|
||||
|
||||
/* Free a superblock that has never been seen by anyone */
|
||||
static void destroy_unused_super(struct super_block *s)
|
||||
{
|
||||
@ -280,11 +263,17 @@ fail:
|
||||
/*
|
||||
* Drop a superblock's refcount. The caller must hold sb_lock.
|
||||
*/
|
||||
static void __put_super(struct super_block *sb)
|
||||
static void __put_super(struct super_block *s)
|
||||
{
|
||||
if (!--sb->s_count) {
|
||||
list_del_init(&sb->s_list);
|
||||
destroy_super(sb);
|
||||
if (!--s->s_count) {
|
||||
list_del_init(&s->s_list);
|
||||
WARN_ON(s->s_dentry_lru.node);
|
||||
WARN_ON(s->s_inode_lru.node);
|
||||
WARN_ON(!list_empty(&s->s_mounts));
|
||||
security_sb_free(s);
|
||||
put_user_ns(s->s_user_ns);
|
||||
kfree(s->s_subtype);
|
||||
call_rcu(&s->rcu, destroy_super_rcu);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user