Commit c959025e authored by Chandan Rajendra's avatar Chandan Rajendra Committed by Darrick J. Wong

xfs: Remove "committed" argument of xfs_dir_ialloc

xfs_dir_ialloc() rolls the current transaction when allocation of a new
inode required the space manager to perform an allocation and replinish
the Inode btree.

None of the callers of xfs_dir_ialloc() need to know if the
transaction was committed. Hence this commit removes the "committed"
argument of xfs_dir_ialloc.
Signed-off-by: default avatarChandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent dc1baa71
...@@ -972,10 +972,8 @@ xfs_dir_ialloc( ...@@ -972,10 +972,8 @@ xfs_dir_ialloc(
xfs_nlink_t nlink, xfs_nlink_t nlink,
dev_t rdev, dev_t rdev,
prid_t prid, /* project id */ prid_t prid, /* project id */
xfs_inode_t **ipp, /* pointer to inode; it will be xfs_inode_t **ipp) /* pointer to inode; it will be
locked. */ locked. */
int *committed)
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
xfs_inode_t *ip; xfs_inode_t *ip;
...@@ -1050,8 +1048,6 @@ xfs_dir_ialloc( ...@@ -1050,8 +1048,6 @@ xfs_dir_ialloc(
} }
code = xfs_trans_roll(&tp); code = xfs_trans_roll(&tp);
if (committed != NULL)
*committed = 1;
/* /*
* Re-attach the quota info that we detached from prev trx. * Re-attach the quota info that we detached from prev trx.
...@@ -1088,9 +1084,6 @@ xfs_dir_ialloc( ...@@ -1088,9 +1084,6 @@ xfs_dir_ialloc(
} }
ASSERT(!ialloc_context && ip); ASSERT(!ialloc_context && ip);
} else {
if (committed != NULL)
*committed = 0;
} }
*ipp = ip; *ipp = ip;
...@@ -1217,8 +1210,7 @@ xfs_create( ...@@ -1217,8 +1210,7 @@ xfs_create(
* entry pointing to them, but a directory also the "." entry * entry pointing to them, but a directory also the "." entry
* pointing to itself. * pointing to itself.
*/ */
error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev, prid, &ip, error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev, prid, &ip);
NULL);
if (error) if (error)
goto out_trans_cancel; goto out_trans_cancel;
...@@ -1351,7 +1343,7 @@ xfs_create_tmpfile( ...@@ -1351,7 +1343,7 @@ xfs_create_tmpfile(
if (error) if (error)
goto out_trans_cancel; goto out_trans_cancel;
error = xfs_dir_ialloc(&tp, dp, mode, 1, 0, prid, &ip, NULL); error = xfs_dir_ialloc(&tp, dp, mode, 1, 0, prid, &ip);
if (error) if (error)
goto out_trans_cancel; goto out_trans_cancel;
......
...@@ -431,7 +431,7 @@ xfs_extlen_t xfs_get_cowextsz_hint(struct xfs_inode *ip); ...@@ -431,7 +431,7 @@ xfs_extlen_t xfs_get_cowextsz_hint(struct xfs_inode *ip);
int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t, int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t,
xfs_nlink_t, dev_t, prid_t, xfs_nlink_t, dev_t, prid_t,
struct xfs_inode **, int *); struct xfs_inode **);
/* from xfs_file.c */ /* from xfs_file.c */
enum xfs_prealloc_flags { enum xfs_prealloc_flags {
......
...@@ -748,7 +748,6 @@ xfs_qm_qino_alloc( ...@@ -748,7 +748,6 @@ xfs_qm_qino_alloc(
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
int error; int error;
int committed;
bool need_alloc = true; bool need_alloc = true;
*ip = NULL; *ip = NULL;
...@@ -788,8 +787,7 @@ xfs_qm_qino_alloc( ...@@ -788,8 +787,7 @@ xfs_qm_qino_alloc(
return error; return error;
if (need_alloc) { if (need_alloc) {
error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, 0, ip, error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, 0, ip);
&committed);
if (error) { if (error) {
xfs_trans_cancel(tp); xfs_trans_cancel(tp);
return error; return error;
......
...@@ -264,7 +264,7 @@ xfs_symlink( ...@@ -264,7 +264,7 @@ xfs_symlink(
* Allocate an inode for the symlink. * Allocate an inode for the symlink.
*/ */
error = xfs_dir_ialloc(&tp, dp, S_IFLNK | (mode & ~S_IFMT), 1, 0, error = xfs_dir_ialloc(&tp, dp, S_IFLNK | (mode & ~S_IFMT), 1, 0,
prid, &ip, NULL); prid, &ip);
if (error) if (error)
goto out_trans_cancel; goto out_trans_cancel;
......
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