Commit 2b3648a6 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Linus Torvalds

fs/super.c: refactor alloc_super()

Do two list_lru_init_memcg() calls after prealloc_super().
destroy_unused_super() in fail path is OK with this.  Next patch needs
such the order.

Link: default avatarKirill Tkhai <>
Acked-by: Vladimir Davydov's avatarVladimir Davydov <>
Tested-by: default avatarShakeel Butt <>
Cc: Al Viro <>
Cc: Andrey Ryabinin <>
Cc: Chris Wilson <>
Cc: Greg Kroah-Hartman <>
Cc: Guenter Roeck <>
Cc: "Huang, Ying" <>
Cc: Johannes Weiner <>
Cc: Josef Bacik <>
Cc: Li RongQing <>
Cc: Matthew Wilcox <>
Cc: Matthias Kaehlcke <>
Cc: Mel Gorman <>
Cc: Michal Hocko <>
Cc: Minchan Kim <>
Cc: Philippe Ombredanne <>
Cc: Roman Gushchin <>
Cc: Sahitya Tummala <>
Cc: Stephen Rothwell <>
Cc: Tetsuo Handa <>
Cc: Thomas Gleixner <>
Cc: Waiman Long <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 39887653
......@@ -244,10 +244,6 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags,
if (list_lru_init_memcg(&s->s_dentry_lru))
goto fail;
if (list_lru_init_memcg(&s->s_inode_lru))
goto fail;
s->s_count = 1;
atomic_set(&s->s_active, 1);
......@@ -265,6 +261,10 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags,
if (prealloc_shrinker(&s->s_shrink))
goto fail;
if (list_lru_init_memcg(&s->s_dentry_lru))
goto fail;
if (list_lru_init_memcg(&s->s_inode_lru))
goto fail;
return s;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment