From bf7fe3d57f6955f9aedfd28f6b071f3418df7215 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sun, 25 Oct 2020 17:16:00 -0700 Subject: xfs: get rid of cross_rename Get rid of the largely pointless xfs_cross_rename now that we've refactored its parent. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_inode.c | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 1892b1d46f11..64f798697b42 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -2303,36 +2303,6 @@ xfs_finish_rename( return xfs_trans_commit(tp); } -/* - * 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() * @@ -2471,12 +2441,11 @@ xfs_rename( /* 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); - - error = xfs_dir_rename(tp, src_dp, src_name, src_ip, target_dp, - target_name, target_ip, spaceres, wip); + 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; -- cgit v1.2.3