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 <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>
This commit is contained in:
parent
8b9f3ac5b0
commit
fd60b28842
block
drivers/dax
fs
9p
adfs
affs
afs
befs
bfs
btrfs
ceph
cifs
coda
ecryptfs
efs
erofs
exfat
ext2
ext4
fat
freevxfs
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hugetlbfs
isofs
jffs2
jfs
minix
nfs
nilfs2
ntfs
ntfs3
ocfs2
openpromfs
orangefs
overlayfs
proc
qnx4
qnx6
reiserfs
romfs
squashfs
sysv
ubifs
udf
ufs
vboxsf
xfs
zonefs
ipc
mm
net
@ -385,7 +385,7 @@ static struct kmem_cache * bdev_cachep __read_mostly;
|
|||||||
|
|
||||||
static struct inode *bdev_alloc_inode(struct super_block *sb)
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -282,7 +282,7 @@ static struct inode *dax_alloc_inode(struct super_block *sb)
|
|||||||
struct dax_device *dax_dev;
|
struct dax_device *dax_dev;
|
||||||
struct inode *inode;
|
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)
|
if (!dax_dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct v9fs_inode *v9inode;
|
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)
|
if (!v9inode)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef CONFIG_9P_FSCACHE
|
#ifdef CONFIG_9P_FSCACHE
|
||||||
|
@ -220,7 +220,7 @@ static struct kmem_cache *adfs_inode_cachep;
|
|||||||
static struct inode *adfs_alloc_inode(struct super_block *sb)
|
static struct inode *adfs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct adfs_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -100,7 +100,7 @@ static struct inode *affs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct affs_inode_info *i;
|
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)
|
if (!i)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -679,7 +679,7 @@ static struct inode *afs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct afs_vnode *vnode;
|
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)
|
if (!vnode)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ befs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct befs_inode_info *bi;
|
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)
|
if (!bi)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &bi->vfs_inode;
|
return &bi->vfs_inode;
|
||||||
|
@ -239,7 +239,7 @@ static struct kmem_cache *bfs_inode_cachep;
|
|||||||
static struct inode *bfs_alloc_inode(struct super_block *sb)
|
static struct inode *bfs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct bfs_inode_info *bi;
|
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)
|
if (!bi)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &bi->vfs_inode;
|
return &bi->vfs_inode;
|
||||||
|
@ -8787,7 +8787,7 @@ struct inode *btrfs_alloc_inode(struct super_block *sb)
|
|||||||
struct btrfs_inode *ei;
|
struct btrfs_inode *ei;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
ei = kmem_cache_alloc(btrfs_inode_cachep, GFP_KERNEL);
|
ei = alloc_inode_sb(sb, btrfs_inode_cachep, GFP_KERNEL);
|
||||||
if (!ei)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
|
|||||||
struct ceph_inode_info *ci;
|
struct ceph_inode_info *ci;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS);
|
ci = alloc_inode_sb(sb, ceph_inode_cachep, GFP_NOFS);
|
||||||
if (!ci)
|
if (!ci)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ static struct inode *
|
|||||||
cifs_alloc_inode(struct super_block *sb)
|
cifs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct cifsInodeInfo *cifs_inode;
|
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)
|
if (!cifs_inode)
|
||||||
return NULL;
|
return NULL;
|
||||||
cifs_inode->cifsAttrs = 0x20; /* default */
|
cifs_inode->cifsAttrs = 0x20; /* default */
|
||||||
|
@ -43,7 +43,7 @@ static struct kmem_cache * coda_inode_cachep;
|
|||||||
static struct inode *coda_alloc_inode(struct super_block *sb)
|
static struct inode *coda_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct coda_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
memset(&ei->c_fid, 0, sizeof(struct CodaFid));
|
memset(&ei->c_fid, 0, sizeof(struct CodaFid));
|
||||||
|
@ -38,7 +38,7 @@ static struct inode *ecryptfs_alloc_inode(struct super_block *sb)
|
|||||||
struct ecryptfs_inode_info *inode_info;
|
struct ecryptfs_inode_info *inode_info;
|
||||||
struct inode *inode = NULL;
|
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))
|
if (unlikely(!inode_info))
|
||||||
goto out;
|
goto out;
|
||||||
if (ecryptfs_init_crypt_stat(&inode_info->crypt_stat)) {
|
if (ecryptfs_init_crypt_stat(&inode_info->crypt_stat)) {
|
||||||
|
@ -69,7 +69,7 @@ static struct kmem_cache * efs_inode_cachep;
|
|||||||
static struct inode *efs_alloc_inode(struct super_block *sb)
|
static struct inode *efs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct efs_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -84,7 +84,7 @@ static void erofs_inode_init_once(void *ptr)
|
|||||||
static struct inode *erofs_alloc_inode(struct super_block *sb)
|
static struct inode *erofs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct erofs_inode *vi =
|
struct erofs_inode *vi =
|
||||||
kmem_cache_alloc(erofs_inode_cachep, GFP_KERNEL);
|
alloc_inode_sb(sb, erofs_inode_cachep, GFP_KERNEL);
|
||||||
|
|
||||||
if (!vi)
|
if (!vi)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -183,7 +183,7 @@ static struct inode *exfat_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct exfat_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ static struct kmem_cache * ext2_inode_cachep;
|
|||||||
static struct inode *ext2_alloc_inode(struct super_block *sb)
|
static struct inode *ext2_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct ext2_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
ei->i_block_alloc_info = NULL;
|
ei->i_block_alloc_info = NULL;
|
||||||
|
@ -1316,7 +1316,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct ext4_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ static struct kmem_cache *fat_inode_cachep;
|
|||||||
static struct inode *fat_alloc_inode(struct super_block *sb)
|
static struct inode *fat_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct msdos_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ static struct inode *vxfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct vxfs_inode_info *vi;
|
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)
|
if (!vi)
|
||||||
return NULL;
|
return NULL;
|
||||||
inode_init_once(&vi->vfs_inode);
|
inode_init_once(&vi->vfs_inode);
|
||||||
|
@ -72,7 +72,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct fuse_inode *fi;
|
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)
|
if (!fi)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1425,7 +1425,7 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct gfs2_inode *ip;
|
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)
|
if (!ip)
|
||||||
return NULL;
|
return NULL;
|
||||||
ip->i_flags = 0;
|
ip->i_flags = 0;
|
||||||
|
@ -162,7 +162,7 @@ static struct inode *hfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct hfs_inode_info *i;
|
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;
|
return i ? &i->vfs_inode : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ static struct inode *hfsplus_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct hfsplus_inode_info *i;
|
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;
|
return i ? &i->vfs_inode : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct hostfs_inode_info *hi;
|
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)
|
if (hi == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
hi->fd = -1;
|
hi->fd = -1;
|
||||||
|
@ -232,7 +232,7 @@ static struct kmem_cache * hpfs_inode_cachep;
|
|||||||
static struct inode *hpfs_alloc_inode(struct super_block *sb)
|
static struct inode *hpfs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct hpfs_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -1110,7 +1110,7 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
|
|||||||
|
|
||||||
if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo)))
|
if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo)))
|
||||||
return NULL;
|
return NULL;
|
||||||
p = kmem_cache_alloc(hugetlbfs_inode_cachep, GFP_KERNEL);
|
p = alloc_inode_sb(sb, hugetlbfs_inode_cachep, GFP_KERNEL);
|
||||||
if (unlikely(!p)) {
|
if (unlikely(!p)) {
|
||||||
hugetlbfs_inc_free_inodes(sbinfo);
|
hugetlbfs_inc_free_inodes(sbinfo);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -70,7 +70,7 @@ static struct kmem_cache *isofs_inode_cachep;
|
|||||||
static struct inode *isofs_alloc_inode(struct super_block *sb)
|
static struct inode *isofs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct iso_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -39,7 +39,7 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct jffs2_inode_info *f;
|
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)
|
if (!f)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &f->vfs_inode;
|
return &f->vfs_inode;
|
||||||
|
@ -102,7 +102,7 @@ static struct inode *jfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct jfs_inode_info *jfs_inode;
|
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)
|
if (!jfs_inode)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef CONFIG_QUOTA
|
#ifdef CONFIG_QUOTA
|
||||||
|
@ -63,7 +63,7 @@ static struct kmem_cache * minix_inode_cachep;
|
|||||||
static struct inode *minix_alloc_inode(struct super_block *sb)
|
static struct inode *minix_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct minix_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -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 inode *nfs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct nfs_inode *nfsi;
|
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)
|
if (!nfsi)
|
||||||
return NULL;
|
return NULL;
|
||||||
nfsi->flags = 0UL;
|
nfsi->flags = 0UL;
|
||||||
|
@ -151,7 +151,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct nilfs_inode_info *ii;
|
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)
|
if (!ii)
|
||||||
return NULL;
|
return NULL;
|
||||||
ii->i_bh = NULL;
|
ii->i_bh = NULL;
|
||||||
|
@ -310,7 +310,7 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb)
|
|||||||
ntfs_inode *ni;
|
ntfs_inode *ni;
|
||||||
|
|
||||||
ntfs_debug("Entering.");
|
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)) {
|
if (likely(ni != NULL)) {
|
||||||
ni->state = 0;
|
ni->state = 0;
|
||||||
return VFS_I(ni);
|
return VFS_I(ni);
|
||||||
|
@ -399,7 +399,7 @@ static struct kmem_cache *ntfs_inode_cachep;
|
|||||||
|
|
||||||
static struct inode *ntfs_alloc_inode(struct super_block *sb)
|
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)
|
if (!ni)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -280,7 +280,7 @@ static struct inode *dlmfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct dlmfs_inode_private *ip;
|
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)
|
if (!ip)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ static struct inode *ocfs2_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct ocfs2_inode_info *oi;
|
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)
|
if (!oi)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ static struct inode *openprom_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct op_inode_info *oi;
|
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)
|
if (!oi)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ static struct inode *orangefs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct orangefs_inode_s *orangefs_inode;
|
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)
|
if (!orangefs_inode)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ static struct kmem_cache *ovl_inode_cachep;
|
|||||||
|
|
||||||
static struct inode *ovl_alloc_inode(struct super_block *sb)
|
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)
|
if (!oi)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -66,7 +66,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct proc_inode *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
ei->pid = NULL;
|
ei->pid = NULL;
|
||||||
|
@ -338,7 +338,7 @@ static struct kmem_cache *qnx4_inode_cachep;
|
|||||||
static struct inode *qnx4_alloc_inode(struct super_block *sb)
|
static struct inode *qnx4_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct qnx4_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -597,7 +597,7 @@ static struct kmem_cache *qnx6_inode_cachep;
|
|||||||
static struct inode *qnx6_alloc_inode(struct super_block *sb)
|
static struct inode *qnx6_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct qnx6_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -639,7 +639,7 @@ static struct kmem_cache *reiserfs_inode_cachep;
|
|||||||
static struct inode *reiserfs_alloc_inode(struct super_block *sb)
|
static struct inode *reiserfs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct reiserfs_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
atomic_set(&ei->openers, 0);
|
atomic_set(&ei->openers, 0);
|
||||||
|
@ -375,7 +375,7 @@ static struct inode *romfs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct romfs_inode_info *inode;
|
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;
|
return inode ? &inode->vfs_inode : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ static void __exit exit_squashfs_fs(void)
|
|||||||
static struct inode *squashfs_alloc_inode(struct super_block *sb)
|
static struct inode *squashfs_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct squashfs_inode_info *ei =
|
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;
|
return ei ? &ei->vfs_inode : NULL;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ static struct inode *sysv_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct sysv_inode_info *si;
|
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)
|
if (!si)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &si->vfs_inode;
|
return &si->vfs_inode;
|
||||||
|
@ -268,7 +268,7 @@ static struct inode *ubifs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct ubifs_inode *ui;
|
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)
|
if (!ui)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ static struct kmem_cache *udf_inode_cachep;
|
|||||||
static struct inode *udf_alloc_inode(struct super_block *sb)
|
static struct inode *udf_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct udf_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1443,7 +1443,7 @@ static struct inode *ufs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct ufs_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ static struct inode *vboxsf_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct vboxsf_inode *sf_i;
|
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)
|
if (!sf_i)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ xfs_inode_alloc(
|
|||||||
* XXX: If this didn't occur in transactions, we could drop GFP_NOFAIL
|
* XXX: If this didn't occur in transactions, we could drop GFP_NOFAIL
|
||||||
* and return NULL here on ENOMEM.
|
* 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))) {
|
if (inode_init_always(mp->m_super, VFS_I(ip))) {
|
||||||
kmem_cache_free(xfs_inode_cache, ip);
|
kmem_cache_free(xfs_inode_cache, ip);
|
||||||
|
@ -1137,7 +1137,7 @@ static struct inode *zonefs_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct zonefs_inode_info *zi;
|
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)
|
if (!zi)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ static struct inode *mqueue_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct mqueue_inode_info *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &ei->vfs_inode;
|
return &ei->vfs_inode;
|
||||||
|
@ -3708,7 +3708,7 @@ static struct kmem_cache *shmem_inode_cachep;
|
|||||||
static struct inode *shmem_alloc_inode(struct super_block *sb)
|
static struct inode *shmem_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct shmem_inode_info *info;
|
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)
|
if (!info)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &info->vfs_inode;
|
return &info->vfs_inode;
|
||||||
|
@ -301,7 +301,7 @@ static struct inode *sock_alloc_inode(struct super_block *sb)
|
|||||||
{
|
{
|
||||||
struct socket_alloc *ei;
|
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)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
init_waitqueue_head(&ei->socket.wq.wait);
|
init_waitqueue_head(&ei->socket.wq.wait);
|
||||||
|
@ -197,7 +197,7 @@ static struct inode *
|
|||||||
rpc_alloc_inode(struct super_block *sb)
|
rpc_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct rpc_inode *rpci;
|
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)
|
if (!rpci)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &rpci->vfs_inode;
|
return &rpci->vfs_inode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user