fs: allocate inode by using alloc_inode_sb()
authorMuchun Song <songmuchun@bytedance.com>
Tue, 22 Mar 2022 21:41:03 +0000 (14:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:03 +0000 (15:57 -0700)
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 <songmuchun@bytedance.com>
Acked-by: Theodore Ts'o <tytso@mit.edu> [ext4]
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Alex Shi <alexs@kernel.org>
Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
Cc: Chao Yu <chao@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Fam Zheng <fam.zheng@bytedance.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kari Argillander <kari.argillander@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Cc: Yang Shi <shy828301@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
57 files changed:
block/bdev.c
drivers/dax/super.c
fs/9p/vfs_inode.c
fs/adfs/super.c
fs/affs/super.c
fs/afs/super.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/btrfs/inode.c
fs/ceph/inode.c
fs/cifs/cifsfs.c
fs/coda/inode.c
fs/ecryptfs/super.c
fs/efs/super.c
fs/erofs/super.c
fs/exfat/super.c
fs/ext2/super.c
fs/ext4/super.c
fs/fat/inode.c
fs/freevxfs/vxfs_super.c
fs/fuse/inode.c
fs/gfs2/super.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hostfs/hostfs_kern.c
fs/hpfs/super.c
fs/hugetlbfs/inode.c
fs/isofs/inode.c
fs/jffs2/super.c
fs/jfs/super.c
fs/minix/inode.c
fs/nfs/inode.c
fs/nilfs2/super.c
fs/ntfs/inode.c
fs/ntfs3/super.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/super.c
fs/openpromfs/inode.c
fs/orangefs/super.c
fs/overlayfs/super.c
fs/proc/inode.c
fs/qnx4/inode.c
fs/qnx6/inode.c
fs/reiserfs/super.c
fs/romfs/super.c
fs/squashfs/super.c
fs/sysv/inode.c
fs/ubifs/super.c
fs/udf/super.c
fs/ufs/super.c
fs/vboxsf/super.c
fs/xfs/xfs_icache.c
fs/zonefs/super.c
ipc/mqueue.c
mm/shmem.c
net/socket.c
net/sunrpc/rpc_pipe.c

index 102837a370517c78d9d17d7793cfdf6d2ce6adc6..ac05343d410b265b253ad52b3eae61c722e6222e 100644 (file)
@@ -385,7 +385,7 @@ static struct kmem_cache * bdev_cachep __read_mostly;
 
 static struct inode *bdev_alloc_inode(struct super_block *sb)
 {
-       struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL);
+       struct bdev_inode *ei = alloc_inode_sb(sb, bdev_cachep, GFP_KERNEL);
 
        if (!ei)
                return NULL;
index e3029389d8097ac818b3d0019afe88c0d9130b63..aedc15eabeacf8ab0b8e38452c0170982087eea3 100644 (file)
@@ -282,7 +282,7 @@ static struct inode *dax_alloc_inode(struct super_block *sb)
        struct dax_device *dax_dev;
        struct inode *inode;
 
-       dax_dev = kmem_cache_alloc(dax_cache, GFP_KERNEL);
+       dax_dev = alloc_inode_sb(sb, dax_cache, GFP_KERNEL);
        if (!dax_dev)
                return NULL;
 
index 2a10242c79c79c279517958c6b500be8a4989de9..84c3cf7dffa5eb58063705745a8dab6074b66e57 100644 (file)
@@ -228,7 +228,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb)
 {
        struct v9fs_inode *v9inode;
 
-       v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL);
+       v9inode = alloc_inode_sb(sb, v9fs_inode_cache, GFP_KERNEL);
        if (!v9inode)
                return NULL;
 #ifdef CONFIG_9P_FSCACHE
index bdbd26e571ed37b0a3def3fb25ed70467f6350d1..e8bfc38239cd59b427331449aa89098389d3cc18 100644 (file)
@@ -220,7 +220,7 @@ static struct kmem_cache *adfs_inode_cachep;
 static struct inode *adfs_alloc_inode(struct super_block *sb)
 {
        struct adfs_inode_info *ei;
-       ei = kmem_cache_alloc(adfs_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, adfs_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index c609005a9eaaa6d6c3b466f793218b723b37ad33..4c5f30a833362a67d8fbec022746ba06b87390fb 100644 (file)
@@ -100,7 +100,7 @@ static struct inode *affs_alloc_inode(struct super_block *sb)
 {
        struct affs_inode_info *i;
 
-       i = kmem_cache_alloc(affs_inode_cachep, GFP_KERNEL);
+       i = alloc_inode_sb(sb, affs_inode_cachep, GFP_KERNEL);
        if (!i)
                return NULL;
 
index 5ec9fd97eccc8994387abba86b64bf34ba53f7eb..7592c0f469f140864b909549fda489bcb638bb17 100644 (file)
@@ -679,7 +679,7 @@ static struct inode *afs_alloc_inode(struct super_block *sb)
 {
        struct afs_vnode *vnode;
 
-       vnode = kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL);
+       vnode = alloc_inode_sb(sb, afs_inode_cachep, GFP_KERNEL);
        if (!vnode)
                return NULL;
 
index c1ba13d19024e4beb625714dca473094d5092dcd..b4b3567ac655395258f6a02ac32984045964c014 100644 (file)
@@ -277,7 +277,7 @@ befs_alloc_inode(struct super_block *sb)
 {
        struct befs_inode_info *bi;
 
-       bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);
+       bi = alloc_inode_sb(sb, befs_inode_cachep, GFP_KERNEL);
        if (!bi)
                return NULL;
        return &bi->vfs_inode;
index fd691e4815c56492ff593e30904c15ec3e0c7a6d..1926bec2c85000dda65431ee95d42faa4375d371 100644 (file)
@@ -239,7 +239,7 @@ static struct kmem_cache *bfs_inode_cachep;
 static struct inode *bfs_alloc_inode(struct super_block *sb)
 {
        struct bfs_inode_info *bi;
-       bi = kmem_cache_alloc(bfs_inode_cachep, GFP_KERNEL);
+       bi = alloc_inode_sb(sb, bfs_inode_cachep, GFP_KERNEL);
        if (!bi)
                return NULL;
        return &bi->vfs_inode;
index 5bbea5ec31fc5311487f0318146b93aa99fe96eb..dcc2102cb54667a6fd6d616f689a6d72dfd7bfaf 100644 (file)
@@ -8787,7 +8787,7 @@ struct inode *btrfs_alloc_inode(struct super_block *sb)
        struct btrfs_inode *ei;
        struct inode *inode;
 
-       ei = kmem_cache_alloc(btrfs_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, btrfs_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
 
index ef4a980a7bf37035c1d20dc9c4fd81d7131be1b4..9cfa6c730519423ca1a7d545d106d207667c6e84 100644 (file)
@@ -447,7 +447,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
        struct ceph_inode_info *ci;
        int i;
 
-       ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS);
+       ci = alloc_inode_sb(sb, ceph_inode_cachep, GFP_NOFS);
        if (!ci)
                return NULL;
 
index 082c21478686704885d2e1dea364844f1c4d45ca..74ddece5b5333bbd0ceba0a629db11c95e721164 100644 (file)
@@ -354,7 +354,7 @@ static struct inode *
 cifs_alloc_inode(struct super_block *sb)
 {
        struct cifsInodeInfo *cifs_inode;
-       cifs_inode = kmem_cache_alloc(cifs_inode_cachep, GFP_KERNEL);
+       cifs_inode = alloc_inode_sb(sb, cifs_inode_cachep, GFP_KERNEL);
        if (!cifs_inode)
                return NULL;
        cifs_inode->cifsAttrs = 0x20;   /* default */
index d9f1bd7153df314cf1379f19552c262a009d473a..2185328b65c782aaa8649cc2d8f4116290eccdd4 100644 (file)
@@ -43,7 +43,7 @@ static struct kmem_cache * coda_inode_cachep;
 static struct inode *coda_alloc_inode(struct super_block *sb)
 {
        struct coda_inode_info *ei;
-       ei = kmem_cache_alloc(coda_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, coda_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        memset(&ei->c_fid, 0, sizeof(struct CodaFid));
index 39116af0390f7115a1bb7d70762931615f04cccf..0b1c878317ab06b6134d43c812318f1819a3a3dd 100644 (file)
@@ -38,7 +38,7 @@ static struct inode *ecryptfs_alloc_inode(struct super_block *sb)
        struct ecryptfs_inode_info *inode_info;
        struct inode *inode = NULL;
 
-       inode_info = kmem_cache_alloc(ecryptfs_inode_info_cache, GFP_KERNEL);
+       inode_info = alloc_inode_sb(sb, ecryptfs_inode_info_cache, GFP_KERNEL);
        if (unlikely(!inode_info))
                goto out;
        if (ecryptfs_init_crypt_stat(&inode_info->crypt_stat)) {
index 62b155b9366b8f9fb42587075329621b5da8fade..b287f47c165ba8775d978343164d80e472f4e4d7 100644 (file)
@@ -69,7 +69,7 @@ static struct kmem_cache * efs_inode_cachep;
 static struct inode *efs_alloc_inode(struct super_block *sb)
 {
        struct efs_inode_info *ei;
-       ei = kmem_cache_alloc(efs_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, efs_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index 915eefe0d7e2c51f65851933ff0b2067da70e88c..a9ffffc62c256bf59c6574488a8026bd87528427 100644 (file)
@@ -84,7 +84,7 @@ static void erofs_inode_init_once(void *ptr)
 static struct inode *erofs_alloc_inode(struct super_block *sb)
 {
        struct erofs_inode *vi =
-               kmem_cache_alloc(erofs_inode_cachep, GFP_KERNEL);
+               alloc_inode_sb(sb, erofs_inode_cachep, GFP_KERNEL);
 
        if (!vi)
                return NULL;
index 8c9fb7dcec16a0938253f81e17c7bdb3d0363f67..9f892903419aeaa7521f75ecc91999bc3f52912b 100644 (file)
@@ -183,7 +183,7 @@ static struct inode *exfat_alloc_inode(struct super_block *sb)
 {
        struct exfat_inode_info *ei;
 
-       ei = kmem_cache_alloc(exfat_inode_cachep, GFP_NOFS);
+       ei = alloc_inode_sb(sb, exfat_inode_cachep, GFP_NOFS);
        if (!ei)
                return NULL;
 
index 94f1fbd7d3ac221f832612936d2165a5695880ac..e48aaf52ce936f66a5481ad408570ffe0f4efd5e 100644 (file)
@@ -180,7 +180,7 @@ static struct kmem_cache * ext2_inode_cachep;
 static struct inode *ext2_alloc_inode(struct super_block *sb)
 {
        struct ext2_inode_info *ei;
-       ei = kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, ext2_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        ei->i_block_alloc_info = NULL;
index c5021ca0a28ad52d99d1f3ee19c490e390c2fe35..774eef9f79135298d24cd9d7f543341dc8e02c40 100644 (file)
@@ -1316,7 +1316,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
 {
        struct ext4_inode_info *ei;
 
-       ei = kmem_cache_alloc(ext4_inode_cachep, GFP_NOFS);
+       ei = alloc_inode_sb(sb, ext4_inode_cachep, GFP_NOFS);
        if (!ei)
                return NULL;
 
index a6f1c6d426d1ca89e8094978a3d9fc0e1aefa270..38796681cc869131863dd7b801d499079dcb4e32 100644 (file)
@@ -745,7 +745,7 @@ static struct kmem_cache *fat_inode_cachep;
 static struct inode *fat_alloc_inode(struct super_block *sb)
 {
        struct msdos_inode_info *ei;
-       ei = kmem_cache_alloc(fat_inode_cachep, GFP_NOFS);
+       ei = alloc_inode_sb(sb, fat_inode_cachep, GFP_NOFS);
        if (!ei)
                return NULL;
 
index 578a5062706ee9db9aaa43005276ccefd0680cbc..22eed5a73ac245aacb46b898e422715ab69cde61 100644 (file)
@@ -124,7 +124,7 @@ static struct inode *vxfs_alloc_inode(struct super_block *sb)
 {
        struct vxfs_inode_info *vi;
 
-       vi = kmem_cache_alloc(vxfs_inode_cachep, GFP_KERNEL);
+       vi = alloc_inode_sb(sb, vxfs_inode_cachep, GFP_KERNEL);
        if (!vi)
                return NULL;
        inode_init_once(&vi->vfs_inode);
index 9ee36aa732518dc0d48f23dfad065b492e769b52..8c0665c5dff8818b4a9ff17fa26c2d7a18052672 100644 (file)
@@ -72,7 +72,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
 {
        struct fuse_inode *fi;
 
-       fi = kmem_cache_alloc(fuse_inode_cachep, GFP_KERNEL);
+       fi = alloc_inode_sb(sb, fuse_inode_cachep, GFP_KERNEL);
        if (!fi)
                return NULL;
 
index 64c67090f50362a788fd33691dec3fff484d91ab..cf9cf66522b394300046d724f821162978ab3fd5 100644 (file)
@@ -1425,7 +1425,7 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
 {
        struct gfs2_inode *ip;
 
-       ip = kmem_cache_alloc(gfs2_inode_cachep, GFP_KERNEL);
+       ip = alloc_inode_sb(sb, gfs2_inode_cachep, GFP_KERNEL);
        if (!ip)
                return NULL;
        ip->i_flags = 0;
index 12d9bae393631c5f41938c1a8b0cf1653fe92376..6764afa98a6ff16db1fd0cf5a4f3923f3d37465f 100644 (file)
@@ -162,7 +162,7 @@ static struct inode *hfs_alloc_inode(struct super_block *sb)
 {
        struct hfs_inode_info *i;
 
-       i = kmem_cache_alloc(hfs_inode_cachep, GFP_KERNEL);
+       i = alloc_inode_sb(sb, hfs_inode_cachep, GFP_KERNEL);
        return i ? &i->vfs_inode : NULL;
 }
 
index b9e3db3f855f9625199101e2c8a5cf2b499f93aa..8479add998b582800f36e08a848963af52d03b9d 100644 (file)
@@ -624,7 +624,7 @@ static struct inode *hfsplus_alloc_inode(struct super_block *sb)
 {
        struct hfsplus_inode_info *i;
 
-       i = kmem_cache_alloc(hfsplus_inode_cachep, GFP_KERNEL);
+       i = alloc_inode_sb(sb, hfsplus_inode_cachep, GFP_KERNEL);
        return i ? &i->vfs_inode : NULL;
 }
 
index ef481c3d901925cbfc2bd7e6cbd94f2b2672f915..458300390c511f878835ddc9cb35b6155400f045 100644 (file)
@@ -222,7 +222,7 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
 {
        struct hostfs_inode_info *hi;
 
-       hi = kmem_cache_alloc(hostfs_inode_cache, GFP_KERNEL_ACCOUNT);
+       hi = alloc_inode_sb(sb, hostfs_inode_cache, GFP_KERNEL_ACCOUNT);
        if (hi == NULL)
                return NULL;
        hi->fd = -1;
index a7dbfc89202270e205c5fa1ee13a83c4d0e6824e..1cb89595b87560f4845a324e04bfce6daf5b246b 100644 (file)
@@ -232,7 +232,7 @@ static struct kmem_cache * hpfs_inode_cachep;
 static struct inode *hpfs_alloc_inode(struct super_block *sb)
 {
        struct hpfs_inode_info *ei;
-       ei = kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS);
+       ei = alloc_inode_sb(sb, hpfs_inode_cachep, GFP_NOFS);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index a7c6c7498be0b30bf6d1c17278d991f99319f832..171212bdaae6bb890ae375a44985a23e69773f97 100644 (file)
@@ -1110,7 +1110,7 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
 
        if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo)))
                return NULL;
-       p = kmem_cache_alloc(hugetlbfs_inode_cachep, GFP_KERNEL);
+       p = alloc_inode_sb(sb, hugetlbfs_inode_cachep, GFP_KERNEL);
        if (unlikely(!p)) {
                hugetlbfs_inc_free_inodes(sbinfo);
                return NULL;
index 0c6eacfcbeef1a5728b7a18d833cc5f6210c46e8..d7491692aea3f412ca3a78f3f0ddabc07420e8ba 100644 (file)
@@ -70,7 +70,7 @@ static struct kmem_cache *isofs_inode_cachep;
 static struct inode *isofs_alloc_inode(struct super_block *sb)
 {
        struct iso_inode_info *ei;
-       ei = kmem_cache_alloc(isofs_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, isofs_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index 81ca58c10b728cc6a7c4e132a80c503c0dde1df3..7ea37f49f1e18e0c7737ac4132c8c4930b4d474f 100644 (file)
@@ -39,7 +39,7 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb)
 {
        struct jffs2_inode_info *f;
 
-       f = kmem_cache_alloc(jffs2_inode_cachep, GFP_KERNEL);
+       f = alloc_inode_sb(sb, jffs2_inode_cachep, GFP_KERNEL);
        if (!f)
                return NULL;
        return &f->vfs_inode;
index 24cbc9946e01c2aef42cb4367b85e25e112fb586..f1a13a74cddf3df17f6026af202f57de9969506b 100644 (file)
@@ -102,7 +102,7 @@ static struct inode *jfs_alloc_inode(struct super_block *sb)
 {
        struct jfs_inode_info *jfs_inode;
 
-       jfs_inode = kmem_cache_alloc(jfs_inode_cachep, GFP_NOFS);
+       jfs_inode = alloc_inode_sb(sb, jfs_inode_cachep, GFP_NOFS);
        if (!jfs_inode)
                return NULL;
 #ifdef CONFIG_QUOTA
index a71f1cf894b9f1218f8c739dda034f100ed20c99..8a0af80741b5af1b2ff0e5bef559235c4f0def5b 100644 (file)
@@ -63,7 +63,7 @@ static struct kmem_cache * minix_inode_cachep;
 static struct inode *minix_alloc_inode(struct super_block *sb)
 {
        struct minix_inode_info *ei;
-       ei = kmem_cache_alloc(minix_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, minix_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index d96baa4450e3953d689e8f59cc93aae0585393a4..3351c2de3e0819f3501a4e2520468b234ccef63e 100644 (file)
@@ -2238,7 +2238,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
 struct inode *nfs_alloc_inode(struct super_block *sb)
 {
        struct nfs_inode *nfsi;
-       nfsi = kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
+       nfsi = alloc_inode_sb(sb, nfs_inode_cachep, GFP_KERNEL);
        if (!nfsi)
                return NULL;
        nfsi->flags = 0UL;
index 63e5fa74016c7c332768d6376dda7e11da24538d..3e05c98631ec6bbf87bdb1605e94ee6466128e52 100644 (file)
@@ -151,7 +151,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
 {
        struct nilfs_inode_info *ii;
 
-       ii = kmem_cache_alloc(nilfs_inode_cachep, GFP_NOFS);
+       ii = alloc_inode_sb(sb, nilfs_inode_cachep, GFP_NOFS);
        if (!ii)
                return NULL;
        ii->i_bh = NULL;
index 517b71c73aa96e1d2b008805d3f6e95e3b7c70f2..efe0602b4e5110a0bb68907f2c41516e6fbd6f07 100644 (file)
@@ -310,7 +310,7 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb)
        ntfs_inode *ni;
 
        ntfs_debug("Entering.");
-       ni = kmem_cache_alloc(ntfs_big_inode_cache, GFP_NOFS);
+       ni = alloc_inode_sb(sb, ntfs_big_inode_cache, GFP_NOFS);
        if (likely(ni != NULL)) {
                ni->state = 0;
                return VFS_I(ni);
index 29813200c7af9f71bc6b1217d249996215ffe1bc..278dcf502410231b3af89241b9cc0eef0af382db 100644 (file)
@@ -399,7 +399,7 @@ static struct kmem_cache *ntfs_inode_cachep;
 
 static struct inode *ntfs_alloc_inode(struct super_block *sb)
 {
-       struct ntfs_inode *ni = kmem_cache_alloc(ntfs_inode_cachep, GFP_NOFS);
+       struct ntfs_inode *ni = alloc_inode_sb(sb, ntfs_inode_cachep, GFP_NOFS);
 
        if (!ni)
                return NULL;
index fa0a14f199ebea1d27b602379d60cac831b8ff02..e360543ad7e714a3b204ce2b4ce85213281f3669 100644 (file)
@@ -280,7 +280,7 @@ static struct inode *dlmfs_alloc_inode(struct super_block *sb)
 {
        struct dlmfs_inode_private *ip;
 
-       ip = kmem_cache_alloc(dlmfs_inode_cache, GFP_NOFS);
+       ip = alloc_inode_sb(sb, dlmfs_inode_cache, GFP_NOFS);
        if (!ip)
                return NULL;
 
index 8bde30fa5387da471497af21244ca056ff5a8b24..477cdf94122e7745a72ccf7af8895f20f2861dfb 100644 (file)
@@ -548,7 +548,7 @@ static struct inode *ocfs2_alloc_inode(struct super_block *sb)
 {
        struct ocfs2_inode_info *oi;
 
-       oi = kmem_cache_alloc(ocfs2_inode_cachep, GFP_NOFS);
+       oi = alloc_inode_sb(sb, ocfs2_inode_cachep, GFP_NOFS);
        if (!oi)
                return NULL;
 
index f825176ff4ed7c6ed2270639332438c40dee1f56..f0b7f4d51a175126c6129a0d1ca8ac55949b61e8 100644 (file)
@@ -335,7 +335,7 @@ static struct inode *openprom_alloc_inode(struct super_block *sb)
 {
        struct op_inode_info *oi;
 
-       oi = kmem_cache_alloc(op_inode_cachep, GFP_KERNEL);
+       oi = alloc_inode_sb(sb, op_inode_cachep, GFP_KERNEL);
        if (!oi)
                return NULL;
 
index d90d8addbfc29ee45b8b571e6324f792162886de..5254256a224d7a0a78f9673a42dc7df386370a4a 100644 (file)
@@ -107,7 +107,7 @@ static struct inode *orangefs_alloc_inode(struct super_block *sb)
 {
        struct orangefs_inode_s *orangefs_inode;
 
-       orangefs_inode = kmem_cache_alloc(orangefs_inode_cache, GFP_KERNEL);
+       orangefs_inode = alloc_inode_sb(sb, orangefs_inode_cache, GFP_KERNEL);
        if (!orangefs_inode)
                return NULL;
 
index 7bb0a47cb6156d997a2733b7c50bb2aabab79be8..001cdbb8f015212b3bf2ade964adaf82294954b1 100644 (file)
@@ -174,7 +174,7 @@ static struct kmem_cache *ovl_inode_cachep;
 
 static struct inode *ovl_alloc_inode(struct super_block *sb)
 {
-       struct ovl_inode *oi = kmem_cache_alloc(ovl_inode_cachep, GFP_KERNEL);
+       struct ovl_inode *oi = alloc_inode_sb(sb, ovl_inode_cachep, GFP_KERNEL);
 
        if (!oi)
                return NULL;
index f84355c5a36d3482fcf29d1206a4d725ef67504b..73aeb4e6d32e51fdb1b0df2d73f2f226f2b5d772 100644 (file)
@@ -66,7 +66,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
 {
        struct proc_inode *ei;
 
-       ei = kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, proc_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        ei->pid = NULL;
index 3fb7fc819b4fc9ea54089e52ef594be08b661718..a635bb6615e9d403f52ec6e8c54a2ef5f2475538 100644 (file)
@@ -338,7 +338,7 @@ static struct kmem_cache *qnx4_inode_cachep;
 static struct inode *qnx4_alloc_inode(struct super_block *sb)
 {
        struct qnx4_inode_info *ei;
-       ei = kmem_cache_alloc(qnx4_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, qnx4_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index 61191f7bdf62df8776edaf511574a228b77e4d2c..9d8e7e9788a1dfa4381fda1cd4e63fb97474aae9 100644 (file)
@@ -597,7 +597,7 @@ static struct kmem_cache *qnx6_inode_cachep;
 static struct inode *qnx6_alloc_inode(struct super_block *sb)
 {
        struct qnx6_inode_info *ei;
-       ei = kmem_cache_alloc(qnx6_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, qnx6_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index 82e09901462e7c92490dcd5540083be96527b224..756c4916c7aea5a4d1d0a9a2708fcbdc13536838 100644 (file)
@@ -639,7 +639,7 @@ static struct kmem_cache *reiserfs_inode_cachep;
 static struct inode *reiserfs_alloc_inode(struct super_block *sb)
 {
        struct reiserfs_inode_info *ei;
-       ei = kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, reiserfs_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        atomic_set(&ei->openers, 0);
index 259f684d9236e77d22c018c3844dc8801161d676..9e6bbb4219de8594c279f1558be6290bedc84f71 100644 (file)
@@ -375,7 +375,7 @@ static struct inode *romfs_alloc_inode(struct super_block *sb)
 {
        struct romfs_inode_info *inode;
 
-       inode = kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL);
+       inode = alloc_inode_sb(sb, romfs_inode_cachep, GFP_KERNEL);
        return inode ? &inode->vfs_inode : NULL;
 }
 
index b1b556dbce12df87dc5b9a9b3228919809f0c145..4f74abbc1a54a22f18958295fb3a1a9c2c74d1dc 100644 (file)
@@ -584,7 +584,7 @@ static void __exit exit_squashfs_fs(void)
 static struct inode *squashfs_alloc_inode(struct super_block *sb)
 {
        struct squashfs_inode_info *ei =
-               kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL);
+               alloc_inode_sb(sb, squashfs_inode_cachep, GFP_KERNEL);
 
        return ei ? &ei->vfs_inode : NULL;
 }
index be47263b8605e35e7e1646a0519c98fe55b50a0f..9e8d4a6fb2f341811b77d5622f18ee9d95d7b6f9 100644 (file)
@@ -306,7 +306,7 @@ static struct inode *sysv_alloc_inode(struct super_block *sb)
 {
        struct sysv_inode_info *si;
 
-       si = kmem_cache_alloc(sysv_inode_cachep, GFP_KERNEL);
+       si = alloc_inode_sb(sb, sysv_inode_cachep, GFP_KERNEL);
        if (!si)
                return NULL;
        return &si->vfs_inode;
index aa7a1381c457f02097020efd078874f73b4f72fd..bad67455215facfe692331d93ce167fd4d385ba1 100644 (file)
@@ -268,7 +268,7 @@ static struct inode *ubifs_alloc_inode(struct super_block *sb)
 {
        struct ubifs_inode *ui;
 
-       ui = kmem_cache_alloc(ubifs_inode_slab, GFP_NOFS);
+       ui = alloc_inode_sb(sb, ubifs_inode_slab, GFP_NOFS);
        if (!ui)
                return NULL;
 
index f26b5e0b84b696b65a2614f313eb419947acc471..48871615e4892cdb599c962e8b9da8e7e889143a 100644 (file)
@@ -136,7 +136,7 @@ static struct kmem_cache *udf_inode_cachep;
 static struct inode *udf_alloc_inode(struct super_block *sb)
 {
        struct udf_inode_info *ei;
-       ei = kmem_cache_alloc(udf_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, udf_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
 
index 00a01471ea0596eaa3bacece5c6ea10fb2d65cc5..23377c1baed9e09bd938b4d34d80d35b7e2fe8b6 100644 (file)
@@ -1443,7 +1443,7 @@ static struct inode *ufs_alloc_inode(struct super_block *sb)
 {
        struct ufs_inode_info *ei;
 
-       ei = kmem_cache_alloc(ufs_inode_cachep, GFP_NOFS);
+       ei = alloc_inode_sb(sb, ufs_inode_cachep, GFP_NOFS);
        if (!ei)
                return NULL;
 
index 37dd3fe5b1e981a127d9b718d65f1bb625dc470a..d2f6df69f6110c02ec114a2938d855aca8df1487 100644 (file)
@@ -241,7 +241,7 @@ static struct inode *vboxsf_alloc_inode(struct super_block *sb)
 {
        struct vboxsf_inode *sf_i;
 
-       sf_i = kmem_cache_alloc(vboxsf_inode_cachep, GFP_NOFS);
+       sf_i = alloc_inode_sb(sb, vboxsf_inode_cachep, GFP_NOFS);
        if (!sf_i)
                return NULL;
 
index 9644f938990c54717f337795755aeab1d7a235e5..9e434cb41e48b8590898dfc3fe712fd545351df5 100644 (file)
@@ -77,7 +77,7 @@ xfs_inode_alloc(
         * XXX: If this didn't occur in transactions, we could drop GFP_NOFAIL
         * and return NULL here on ENOMEM.
         */
-       ip = kmem_cache_alloc(xfs_inode_cache, GFP_KERNEL | __GFP_NOFAIL);
+       ip = alloc_inode_sb(mp->m_super, xfs_inode_cache, GFP_KERNEL | __GFP_NOFAIL);
 
        if (inode_init_always(mp->m_super, VFS_I(ip))) {
                kmem_cache_free(xfs_inode_cache, ip);
index b76dfb310ab650c24adfb2b6f3f329928e61a1fc..11682cd7045d405939d1f952657e3e58783063f7 100644 (file)
@@ -1137,7 +1137,7 @@ static struct inode *zonefs_alloc_inode(struct super_block *sb)
 {
        struct zonefs_inode_info *zi;
 
-       zi = kmem_cache_alloc(zonefs_inode_cachep, GFP_KERNEL);
+       zi = alloc_inode_sb(sb, zonefs_inode_cachep, GFP_KERNEL);
        if (!zi)
                return NULL;
 
index 5becca9be867ce029cb0f98667fac974303d188b..7c08eb3c258d2fc963cf753753ab05a4fd51677c 100644 (file)
@@ -486,7 +486,7 @@ static struct inode *mqueue_alloc_inode(struct super_block *sb)
 {
        struct mqueue_inode_info *ei;
 
-       ei = kmem_cache_alloc(mqueue_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, mqueue_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
index 49447c5410d8b42aee4703df94dfa4bb8d37a026..f21eb0ef8ae0afe6c61d274745f7e84f7d318a6e 100644 (file)
@@ -3708,7 +3708,7 @@ static struct kmem_cache *shmem_inode_cachep;
 static struct inode *shmem_alloc_inode(struct super_block *sb)
 {
        struct shmem_inode_info *info;
-       info = kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL);
+       info = alloc_inode_sb(sb, shmem_inode_cachep, GFP_KERNEL);
        if (!info)
                return NULL;
        return &info->vfs_inode;
index 982eecad464c6ee2b182b23a4c85a3f80a9f9508..6887840682bb7eee52cd59c02fb01dd94c2899a8 100644 (file)
@@ -301,7 +301,7 @@ static struct inode *sock_alloc_inode(struct super_block *sb)
 {
        struct socket_alloc *ei;
 
-       ei = kmem_cache_alloc(sock_inode_cachep, GFP_KERNEL);
+       ei = alloc_inode_sb(sb, sock_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        init_waitqueue_head(&ei->socket.wq.wait);
index 35588f0afa864e961cf8d3323380395903c23184..0b6034fab9ab1b91fd569f5231c33e9f29613e99 100644 (file)
@@ -197,7 +197,7 @@ static struct inode *
 rpc_alloc_inode(struct super_block *sb)
 {
        struct rpc_inode *rpci;
-       rpci = kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
+       rpci = alloc_inode_sb(sb, rpc_inode_cachep, GFP_KERNEL);
        if (!rpci)
                return NULL;
        return &rpci->vfs_inode;