summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-01-05 17:45:28 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-03-25 17:08:34 -0700
commit542d93bd35c6951d680eed2e3d14340d292fca3c (patch)
treee54da2745e817819fa46180bfb530b20fd2f3538
parentc29c0cc7c3cb196a30c5d7b44aa4b7e7f271c4a8 (diff)
xfs: get rid of cross_renameinode-refactor_2021-03-25
Get rid of the largely pointless xfs_cross_rename now that we've refactored its parent. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r--fs/xfs/xfs_inode.c44
1 files changed, 6 insertions, 38 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 602b9b3d736c..863a3ee3558b 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2154,36 +2154,6 @@ xfs_finish_rename(
}
/*
- * xfs_cross_rename()
- *
- * responsible for handling RENAME_EXCHANGE flag in renameat2() sytemcall
- */
-STATIC int
-xfs_cross_rename(
- struct xfs_trans *tp,
- struct xfs_inode *dp1,
- struct xfs_name *name1,
- struct xfs_inode *ip1,
- struct xfs_inode *dp2,
- struct xfs_name *name2,
- struct xfs_inode *ip2,
- int spaceres)
-{
- int error;
-
- error = xfs_dir_exchange(tp, dp1, name1, ip1, dp2, name2, ip2,
- spaceres);
- if (error)
- goto out_trans_abort;
-
- return xfs_finish_rename(tp);
-
-out_trans_abort:
- xfs_trans_cancel(tp);
- return error;
-}
-
-/*
* xfs_rename_alloc_whiteout()
*
* Return a referenced, unlinked, unlocked inode that can be used as a
@@ -2321,12 +2291,6 @@ xfs_rename(
goto out_trans_cancel;
}
- /* RENAME_EXCHANGE is unique from here on. */
- if (flags & RENAME_EXCHANGE)
- return xfs_cross_rename(tp, src_dp, src_name, src_ip,
- target_dp, target_name, target_ip,
- spaceres);
-
/*
* Lock the AGI buffers we need to handle bumping the nlink of the
* whiteout inode off the unlinked list and to handle dropping the
@@ -2351,8 +2315,12 @@ xfs_rename(
}
}
- error = xfs_dir_rename(tp, src_dp, src_name, src_ip, target_dp,
- target_name, target_ip, spaceres, wip);
+ if (flags & RENAME_EXCHANGE)
+ error = xfs_dir_exchange(tp, src_dp, src_name, src_ip,
+ target_dp, target_name, target_ip, spaceres);
+ else
+ error = xfs_dir_rename(tp, src_dp, src_name, src_ip, target_dp,
+ target_name, target_ip, spaceres, wip);
if (error)
goto out_trans_cancel;