aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-07-11 22:26:19 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-11 22:26:19 -0700
commitbcd2c9f33559764e0d306e226a8aa88bc2e1e6fb (patch)
tree9fbdeaca5d91293ee5ed2604443893276b3d029e /fs/xfs/libxfs/xfs_bmap.c
parentxfs: use ->t_dfops in reflink cow recover path (diff)
downloadlinux-dev-bcd2c9f33559764e0d306e226a8aa88bc2e1e6fb.tar.xz
linux-dev-bcd2c9f33559764e0d306e226a8aa88bc2e1e6fb.zip
xfs: refactor dfops init to attach to transaction
Most callers of xfs_defer_init() immediately attach the dfops structure to a transaction. Add a transaction parameter to eliminate much of this boilerplate code. This also helps self-document the fact that many codepaths now expect a dfops pointer implicitly via xfs_trans->t_dfops. 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 '')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 32d8d87b7582..dfff840c79f9 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1050,8 +1050,7 @@ xfs_bmap_add_attrfork(
rsvd ? XFS_TRANS_RESERVE : 0, &tp);
if (error)
return error;
- xfs_defer_init(&dfops, &firstblock);
- tp->t_dfops = &dfops;
+ xfs_defer_init(tp, &dfops, &firstblock);
xfs_ilock(ip, XFS_ILOCK_EXCL);
error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
@@ -6025,8 +6024,7 @@ xfs_bmap_split_extent(
XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp);
if (error)
return error;
- xfs_defer_init(&dfops, &firstfsb);
- tp->t_dfops = &dfops;
+ xfs_defer_init(tp, &dfops, &firstfsb);
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);