diff options
author | Brian Foster <bfoster@redhat.com> | 2018-07-12 08:26:08 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-12 08:26:08 +0300 |
commit | c9cfdb381172174ade2445e7b468f1be550b1a44 (patch) | |
tree | 8a1baf741f099a776bce8a35158e64cc400ea439 /fs/xfs/xfs_inode.c | |
parent | 0e0417f3e54668cec9f677850130e6fbb64edcf2 (diff) | |
download | linux-c9cfdb381172174ade2445e7b468f1be550b1a44.tar.xz |
xfs: remove dfops param from high level dirname calls
All callers of the directory create, rename and remove interfaces
already associate the dfops with the transaction. Drop the dfops
parameters in these calls in preparation for further cleanups in the
layers below. This patch does not change behavior.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index f5649a023d46..e1bc686b70b4 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1225,8 +1225,8 @@ xfs_create( xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); unlock_dp_on_error = false; - error = xfs_dir_createname(tp, dp, name, ip->i_ino, - &first_block, &dfops, resblks ? + error = xfs_dir_createname(tp, dp, name, ip->i_ino, &first_block, + resblks ? resblks - XFS_IALLOC_SPACE_RES(mp) : 0); if (error) { ASSERT(error != -ENOSPC); @@ -1464,7 +1464,7 @@ xfs_link( } error = xfs_dir_createname(tp, tdp, target_name, sip->i_ino, - &first_block, &dfops, resblks); + &first_block, resblks); if (error) goto error_return; xfs_trans_ichgtime(tp, tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); @@ -2659,8 +2659,8 @@ xfs_remove( xfs_defer_init(&dfops, &first_block); tp->t_dfops = &dfops; - error = xfs_dir_removename(tp, dp, name, ip->i_ino, - &first_block, &dfops, resblks); + error = xfs_dir_removename(tp, dp, name, ip->i_ino, &first_block, + resblks); if (error) { ASSERT(error != -ENOENT); goto out_bmap_cancel; @@ -2748,9 +2748,9 @@ xfs_sort_for_rename( static int xfs_finish_rename( - struct xfs_trans *tp, - struct xfs_defer_ops *dfops) + struct xfs_trans *tp) { + struct xfs_defer_ops *dfops = tp->t_dfops; int error; /* @@ -2784,7 +2784,6 @@ xfs_cross_rename( struct xfs_inode *dp2, struct xfs_name *name2, struct xfs_inode *ip2, - struct xfs_defer_ops *dfops, xfs_fsblock_t *first_block, int spaceres) { @@ -2794,16 +2793,14 @@ xfs_cross_rename( int dp2_flags = 0; /* Swap inode number for dirent in first parent */ - error = xfs_dir_replace(tp, dp1, name1, - ip2->i_ino, - first_block, dfops, spaceres); + error = xfs_dir_replace(tp, dp1, name1, ip2->i_ino, first_block, + spaceres); if (error) goto out_trans_abort; /* Swap inode number for dirent in second parent */ - error = xfs_dir_replace(tp, dp2, name2, - ip1->i_ino, - first_block, dfops, spaceres); + error = xfs_dir_replace(tp, dp2, name2, ip1->i_ino, first_block, + spaceres); if (error) goto out_trans_abort; @@ -2818,7 +2815,7 @@ xfs_cross_rename( if (S_ISDIR(VFS_I(ip2)->i_mode)) { error = xfs_dir_replace(tp, ip2, &xfs_name_dotdot, dp1->i_ino, first_block, - dfops, spaceres); + spaceres); if (error) goto out_trans_abort; @@ -2845,7 +2842,7 @@ xfs_cross_rename( if (S_ISDIR(VFS_I(ip1)->i_mode)) { error = xfs_dir_replace(tp, ip1, &xfs_name_dotdot, dp2->i_ino, first_block, - dfops, spaceres); + spaceres); if (error) goto out_trans_abort; @@ -2884,10 +2881,10 @@ xfs_cross_rename( } xfs_trans_ichgtime(tp, dp1, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, dp1, XFS_ILOG_CORE); - return xfs_finish_rename(tp, dfops); + return xfs_finish_rename(tp); out_trans_abort: - xfs_defer_cancel(dfops); + xfs_defer_cancel(tp->t_dfops); xfs_trans_cancel(tp); return error; } @@ -3032,7 +3029,7 @@ xfs_rename( if (flags & RENAME_EXCHANGE) return xfs_cross_rename(tp, src_dp, src_name, src_ip, target_dp, target_name, target_ip, - &dfops, &first_block, spaceres); + &first_block, spaceres); /* * Set up the target. @@ -3054,7 +3051,7 @@ xfs_rename( */ error = xfs_dir_createname(tp, target_dp, target_name, src_ip->i_ino, &first_block, - &dfops, spaceres); + spaceres); if (error) goto out_bmap_cancel; @@ -3093,8 +3090,7 @@ xfs_rename( * name at the destination directory, remove it first. */ error = xfs_dir_replace(tp, target_dp, target_name, - src_ip->i_ino, - &first_block, &dfops, spaceres); + src_ip->i_ino, &first_block, spaceres); if (error) goto out_bmap_cancel; @@ -3128,8 +3124,8 @@ xfs_rename( * directory. */ error = xfs_dir_replace(tp, src_ip, &xfs_name_dotdot, - target_dp->i_ino, - &first_block, &dfops, spaceres); + target_dp->i_ino, &first_block, + spaceres); ASSERT(error != -EEXIST); if (error) goto out_bmap_cancel; @@ -3168,10 +3164,10 @@ xfs_rename( */ if (wip) { error = xfs_dir_replace(tp, src_dp, src_name, wip->i_ino, - &first_block, &dfops, spaceres); + &first_block, spaceres); } else error = xfs_dir_removename(tp, src_dp, src_name, src_ip->i_ino, - &first_block, &dfops, spaceres); + &first_block, spaceres); if (error) goto out_bmap_cancel; @@ -3206,7 +3202,7 @@ xfs_rename( if (new_parent) xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE); - error = xfs_finish_rename(tp, &dfops); + error = xfs_finish_rename(tp); if (wip) IRELE(wip); return error; |