Skip to content

Commit 65d3af6

Browse files
Muchun Songtorvalds
authored andcommitted
f2fs: allocate inode by using alloc_inode_sb()
The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Muchun Song <[email protected]> Acked-by: Roman Gushchin <[email protected]> Cc: Alex Shi <[email protected]> Cc: Anna Schumaker <[email protected]> Cc: Chao Yu <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Fam Zheng <[email protected]> Cc: Jaegeuk Kim <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Kari Argillander <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Qi Zheng <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Theodore Ts'o <[email protected]> Cc: Trond Myklebust <[email protected]> Cc: Vladimir Davydov <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Wei Yang <[email protected]> Cc: Xiongchun Duan <[email protected]> Cc: Yang Shi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent fd60b28 commit 65d3af6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/f2fs/super.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,8 +1345,12 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
13451345
{
13461346
struct f2fs_inode_info *fi;
13471347

1348-
fi = f2fs_kmem_cache_alloc(f2fs_inode_cachep,
1349-
GFP_F2FS_ZERO, false, F2FS_SB(sb));
1348+
if (time_to_inject(F2FS_SB(sb), FAULT_SLAB_ALLOC)) {
1349+
f2fs_show_injection_info(F2FS_SB(sb), FAULT_SLAB_ALLOC);
1350+
return NULL;
1351+
}
1352+
1353+
fi = alloc_inode_sb(sb, f2fs_inode_cachep, GFP_F2FS_ZERO);
13501354
if (!fi)
13511355
return NULL;
13521356

0 commit comments

Comments
 (0)