From 2363111bfc27a7d2d06115d8d4744303d799bfec Mon Sep 17 00:00:00 2001 From: Muchun Song Date: Wed, 11 May 2022 15:55:49 +0900 Subject: [PATCH] exfat: fs: allocate inode by using alloc_inode_sb() The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() of all filesystems to alloc_inode_sb(). Link: https://lkml.kernel.org/r/20220228122126.37293-5-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Theodore Ts'o [ext4] Acked-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Namjae Jeon --- super.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/super.c b/super.c index ec9de282cb9a..91e4dc758a72 100644 --- a/super.c +++ b/super.c @@ -202,7 +202,11 @@ static struct inode *exfat_alloc_inode(struct super_block *sb) { struct exfat_inode_info *ei; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + ei = alloc_inode_sb(sb, exfat_inode_cachep, GFP_NOFS); +#else ei = kmem_cache_alloc(exfat_inode_cachep, GFP_NOFS); +#endif if (!ei) return NULL;