Skip to content

Commit

Permalink
fuse: clean up fuse_alloc_inode
Browse files Browse the repository at this point in the history
This patch cleans up fuse_alloc_inode function, just simply the code, no
logic change.

Signed-off-by: zhangliguang <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
luanshi0212 authored and Miklos Szeredi committed May 8, 2019
1 parent 6407f44 commit 9031a69
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ struct fuse_forget_link *fuse_alloc_forget(void)

static struct inode *fuse_alloc_inode(struct super_block *sb)
{
struct inode *inode;
struct fuse_inode *fi;

inode = kmem_cache_alloc(fuse_inode_cachep, GFP_KERNEL);
if (!inode)
fi = kmem_cache_alloc(fuse_inode_cachep, GFP_KERNEL);
if (!fi)
return NULL;

fi = get_fuse_inode(inode);
fi->i_time = 0;
fi->inval_mask = 0;
fi->nodeid = 0;
Expand All @@ -100,11 +98,11 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
spin_lock_init(&fi->lock);
fi->forget = fuse_alloc_forget();
if (!fi->forget) {
kmem_cache_free(fuse_inode_cachep, inode);
kmem_cache_free(fuse_inode_cachep, fi);
return NULL;
}

return inode;
return &fi->inode;
}

static void fuse_i_callback(struct rcu_head *head)
Expand Down

0 comments on commit 9031a69

Please sign in to comment.