Commit 021960ca authored by Mark Fasheh's avatar Mark Fasheh Committed by Tao Ma

ocfs2: split out inode alloc code from ocfs2_mknod_locked

Do this by splitting the bulk of the function away from the inode allocation
code at the very tom of ocfs2_mknod_locked(). Existing callers don't need to
change and won't see any difference. The new function created,
__ocfs2_mknod_locked() will be used shortly.
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
Signed-off-by: default avatarTao Ma <tao.ma@oracle.com>
parent 81c8c82b
......@@ -472,32 +472,23 @@ static int ocfs2_mknod(struct inode *dir,
return status;
}
static int ocfs2_mknod_locked(struct ocfs2_super *osb,
struct inode *dir,
static int __ocfs2_mknod_locked(struct inode *dir,
struct inode *inode,
dev_t dev,
struct buffer_head **new_fe_bh,
struct buffer_head *parent_fe_bh,
handle_t *handle,
struct ocfs2_alloc_context *inode_ac)
struct ocfs2_alloc_context *inode_ac,
u64 fe_blkno, u64 suballoc_loc, u16 suballoc_bit)
{
int status = 0;
struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
struct ocfs2_dinode *fe = NULL;
struct ocfs2_extent_list *fel;
u64 suballoc_loc, fe_blkno = 0;
u16 suballoc_bit;
u16 feat;
*new_fe_bh = NULL;
status = ocfs2_claim_new_inode(handle, dir, parent_fe_bh,
inode_ac, &suballoc_loc,
&suballoc_bit, &fe_blkno);
if (status < 0) {
mlog_errno(status);
goto leave;
}
/* populate as many fields early on as possible - many of
* these are used by the support functions here and in
* callers. */
......@@ -591,6 +582,34 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
return status;
}
static int ocfs2_mknod_locked(struct ocfs2_super *osb,
struct inode *dir,
struct inode *inode,
dev_t dev,
struct buffer_head **new_fe_bh,
struct buffer_head *parent_fe_bh,
handle_t *handle,
struct ocfs2_alloc_context *inode_ac)
{
int status = 0;
u64 suballoc_loc, fe_blkno = 0;
u16 suballoc_bit;
*new_fe_bh = NULL;
status = ocfs2_claim_new_inode(handle, dir, parent_fe_bh,
inode_ac, &suballoc_loc,
&suballoc_bit, &fe_blkno);
if (status < 0) {
mlog_errno(status);
return status;
}
return __ocfs2_mknod_locked(dir, inode, dev, new_fe_bh,
parent_fe_bh, handle, inode_ac,
fe_blkno, suballoc_loc, suballoc_bit);
}
static int ocfs2_mkdir(struct inode *dir,
struct dentry *dentry,
int mode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment