summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorBrian Foster2018-07-12 07:26:13 +0200
committerDarrick J. Wong2018-07-12 07:26:13 +0200
commit4bcfa613a0582a9992a6c2af82273bd770103d12 (patch)
tree07b05f8a462387bc4a8935b0c64f478f9484a979 /fs/xfs/xfs_bmap_util.c
parentxfs: remove xfs_bmapi_write() dfops param (diff)
downloadkernel-qcow2-linux-4bcfa613a0582a9992a6c2af82273bd770103d12.tar.gz
kernel-qcow2-linux-4bcfa613a0582a9992a6c2af82273bd770103d12.tar.xz
kernel-qcow2-linux-4bcfa613a0582a9992a6c2af82273bd770103d12.zip
xfs: use ->t_dfops for all xfs_bunmapi() callers
Use ->t_dfops for all remaining xfs_bunmapi() callers. This prepares the latter to no longer require a dfops parameter. Note that xfs_itruncate_extents_flags() associates a local dfops with a transaction provided from the caller. Since there are multiple callers, set and reset ->t_dfops before the function returns to avoid exposure of stack memory to the caller. 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_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index cf54da3187d5..76f28b823866 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1044,13 +1044,14 @@ xfs_unmap_extent(
xfs_trans_ijoin(tp, ip, 0);
xfs_defer_init(&dfops, &firstfsb);
+ tp->t_dfops = &dfops;
error = xfs_bunmapi(tp, ip, startoffset_fsb, len_fsb, 0, 2, &firstfsb,
- &dfops, done);
+ tp->t_dfops, done);
if (error)
goto out_bmap_cancel;
- xfs_defer_ijoin(&dfops, ip);
- error = xfs_defer_finish(&tp, &dfops);
+ xfs_defer_ijoin(tp->t_dfops, ip);
+ error = xfs_defer_finish(&tp, tp->t_dfops);
if (error)
goto out_bmap_cancel;
@@ -1060,7 +1061,7 @@ out_unlock:
return error;
out_bmap_cancel:
- xfs_defer_cancel(&dfops);
+ xfs_defer_cancel(tp->t_dfops);
out_trans_cancel:
xfs_trans_cancel(tp);
goto out_unlock;