aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/xfs/xfs_reflink.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 07:20:34 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-02 23:05:14 -0700
commit0f37d1780c3d864599fb377dcb47ad1aa0686b4e (patch)
tree4b54695109c61c7a5141636a89ba0ede57312585 /fs/xfs/xfs_reflink.c
parentxfs: replace xfs_defer_ops ->dop_pending with on-stack list (diff)
downloadwireguard-linux-0f37d1780c3d864599fb377dcb47ad1aa0686b4e.tar.xz
wireguard-linux-0f37d1780c3d864599fb377dcb47ad1aa0686b4e.zip
xfs: pass transaction to xfs_defer_add()
The majority of remaining references to struct xfs_defer_ops in XFS are associated with xfs_defer_add(). At this point, there are no more external xfs_defer_ops users left. All instances of xfs_defer_ops are embedded in the transaction, which means we can safely pass the transaction down to the dfops add interface. Update xfs_defer_add() to receive the transaction as a parameter. Various subsystems implement wrappers to allocate and construct the context specific data structures for the associated deferred operation type. Update these to also carry the transaction down as needed and clean up unused dfops parameters along the way. This removes most of the remaining references to struct xfs_defer_ops throughout the code and facilitates removal of the structure. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> [darrick: fix unused variable warnings with ftrace disabled] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r--fs/xfs/xfs_reflink.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 2ec562d75494..cbceb320a2e7 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -506,15 +506,13 @@ xfs_reflink_cancel_cow_blocks(
ASSERT((*tpp)->t_firstblock == NULLFSBLOCK);
/* Free the CoW orphan record. */
- error = xfs_refcount_free_cow_extent(ip->i_mount,
- (*tpp)->t_dfops, del.br_startblock,
- del.br_blockcount);
+ error = xfs_refcount_free_cow_extent(*tpp,
+ del.br_startblock, del.br_blockcount);
if (error)
break;
- xfs_bmap_add_free(ip->i_mount, (*tpp)->t_dfops,
- del.br_startblock, del.br_blockcount,
- NULL);
+ xfs_bmap_add_free(*tpp, del.br_startblock,
+ del.br_blockcount, NULL);
/* Roll the transaction */
error = xfs_defer_finish(tpp);
@@ -694,14 +692,13 @@ xfs_reflink_end_cow(
trace_xfs_reflink_cow_remap(ip, &del);
/* Free the CoW orphan record. */
- error = xfs_refcount_free_cow_extent(tp->t_mountp, tp->t_dfops,
- del.br_startblock, del.br_blockcount);
+ error = xfs_refcount_free_cow_extent(tp, del.br_startblock,
+ del.br_blockcount);
if (error)
goto out_cancel;
/* Map the new blocks into the data fork. */
- error = xfs_bmap_map_extent(tp->t_mountp, tp->t_dfops, ip,
- &del);
+ error = xfs_bmap_map_extent(tp, ip, &del);
if (error)
goto out_cancel;
@@ -1046,12 +1043,12 @@ xfs_reflink_remap_extent(
uirec.br_blockcount, uirec.br_startblock);
/* Update the refcount tree */
- error = xfs_refcount_increase_extent(mp, tp->t_dfops, &uirec);
+ error = xfs_refcount_increase_extent(tp, &uirec);
if (error)
goto out_cancel;
/* Map the new blocks into the data fork. */
- error = xfs_bmap_map_extent(mp, tp->t_dfops, ip, &uirec);
+ error = xfs_bmap_map_extent(tp, ip, &uirec);
if (error)
goto out_cancel;