summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChandan Rajendra <chandan@linux.vnet.ibm.com>2018-04-02 18:47:43 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-04-02 18:47:43 -0400
commitc959025edad924c8f4a8a3140221f3cde22243db (patch)
treec49e7bc84e4bb3c759a70002476b43cafa74a4bb /fs
parentdc1baa715bbfbb1902da942d06497e79b40e7bc7 (diff)
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: Chandan Rajendra <chandan@linux.vnet.ibm.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_inode.c14
-rw-r--r--fs/xfs/xfs_inode.h2
-rw-r--r--fs/xfs/xfs_qm.c4
-rw-r--r--fs/xfs/xfs_symlink.c2
4 files changed, 6 insertions, 16 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 3e3aab3888fa..c2a16b305f08 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -972,10 +972,8 @@ xfs_dir_ialloc(
972 xfs_nlink_t nlink, 972 xfs_nlink_t nlink,
973 dev_t rdev, 973 dev_t rdev,
974 prid_t prid, /* project id */ 974 prid_t prid, /* project id */
975 xfs_inode_t **ipp, /* pointer to inode; it will be 975 xfs_inode_t **ipp) /* pointer to inode; it will be
976 locked. */ 976 locked. */
977 int *committed)
978
979{ 977{
980 xfs_trans_t *tp; 978 xfs_trans_t *tp;
981 xfs_inode_t *ip; 979 xfs_inode_t *ip;
@@ -1050,8 +1048,6 @@ xfs_dir_ialloc(
1050 } 1048 }
1051 1049
1052 code = xfs_trans_roll(&tp); 1050 code = xfs_trans_roll(&tp);
1053 if (committed != NULL)
1054 *committed = 1;
1055 1051
1056 /* 1052 /*
1057 * Re-attach the quota info that we detached from prev trx. 1053 * Re-attach the quota info that we detached from prev trx.
@@ -1088,9 +1084,6 @@ xfs_dir_ialloc(
1088 } 1084 }
1089 ASSERT(!ialloc_context && ip); 1085 ASSERT(!ialloc_context && ip);
1090 1086
1091 } else {
1092 if (committed != NULL)
1093 *committed = 0;
1094 } 1087 }
1095 1088
1096 *ipp = ip; 1089 *ipp = ip;
@@ -1217,8 +1210,7 @@ xfs_create(
1217 * entry pointing to them, but a directory also the "." entry 1210 * entry pointing to them, but a directory also the "." entry
1218 * pointing to itself. 1211 * pointing to itself.
1219 */ 1212 */
1220 error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev, prid, &ip, 1213 error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev, prid, &ip);
1221 NULL);
1222 if (error) 1214 if (error)
1223 goto out_trans_cancel; 1215 goto out_trans_cancel;
1224 1216
@@ -1351,7 +1343,7 @@ xfs_create_tmpfile(
1351 if (error) 1343 if (error)
1352 goto out_trans_cancel; 1344 goto out_trans_cancel;
1353 1345
1354 error = xfs_dir_ialloc(&tp, dp, mode, 1, 0, prid, &ip, NULL); 1346 error = xfs_dir_ialloc(&tp, dp, mode, 1, 0, prid, &ip);
1355 if (error) 1347 if (error)
1356 goto out_trans_cancel; 1348 goto out_trans_cancel;
1357 1349
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 132d8aa2afc4..64064126a859 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -431,7 +431,7 @@ xfs_extlen_t xfs_get_cowextsz_hint(struct xfs_inode *ip);
431 431
432int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t, 432int xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t,
433 xfs_nlink_t, dev_t, prid_t, 433 xfs_nlink_t, dev_t, prid_t,
434 struct xfs_inode **, int *); 434 struct xfs_inode **);
435 435
436/* from xfs_file.c */ 436/* from xfs_file.c */
437enum xfs_prealloc_flags { 437enum xfs_prealloc_flags {
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 5b848f4b637f..ec39ae274c78 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -748,7 +748,6 @@ xfs_qm_qino_alloc(
748{ 748{
749 xfs_trans_t *tp; 749 xfs_trans_t *tp;
750 int error; 750 int error;
751 int committed;
752 bool need_alloc = true; 751 bool need_alloc = true;
753 752
754 *ip = NULL; 753 *ip = NULL;
@@ -788,8 +787,7 @@ xfs_qm_qino_alloc(
788 return error; 787 return error;
789 788
790 if (need_alloc) { 789 if (need_alloc) {
791 error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, 0, ip, 790 error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, 0, ip);
792 &committed);
793 if (error) { 791 if (error) {
794 xfs_trans_cancel(tp); 792 xfs_trans_cancel(tp);
795 return error; 793 return error;
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 2e9e793a8f9d..5b66ac12913c 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -264,7 +264,7 @@ xfs_symlink(
264 * Allocate an inode for the symlink. 264 * Allocate an inode for the symlink.
265 */ 265 */
266 error = xfs_dir_ialloc(&tp, dp, S_IFLNK | (mode & ~S_IFMT), 1, 0, 266 error = xfs_dir_ialloc(&tp, dp, S_IFLNK | (mode & ~S_IFMT), 1, 0,
267 prid, &ip, NULL); 267 prid, &ip);
268 if (error) 268 if (error)
269 goto out_trans_cancel; 269 goto out_trans_cancel;
270 270