aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-07-24 16:43:12 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-26 13:15:14 -0400
commit1e5ae1995a44f2b7a03f08a10504568a96040a8c (patch)
tree2038ec6b22a8ddd7198fea7c1518d0125f4c3966 /fs/xfs/xfs_reflink.c
parente021a2e5fc520d930f949f303e7307038e258645 (diff)
xfs: use internal dfops in cow blocks cancel
All callers either explicitly initialize a dfops or pass a transaction with an internal dfops. Drop the hacky old dfops replacement logic and use the one associated with the transaction. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Bill O'Donnell <billodo@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_reflink.c')
-rw-r--r--fs/xfs/xfs_reflink.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 406f79d44153..04c25ee6b6f8 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -483,8 +483,6 @@ xfs_reflink_cancel_cow_blocks(
483 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK); 483 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
484 struct xfs_bmbt_irec got, del; 484 struct xfs_bmbt_irec got, del;
485 struct xfs_iext_cursor icur; 485 struct xfs_iext_cursor icur;
486 struct xfs_defer_ops dfops;
487 struct xfs_defer_ops *odfops = (*tpp)->t_dfops;
488 int error = 0; 486 int error = 0;
489 487
490 if (!xfs_is_reflink_inode(ip)) 488 if (!xfs_is_reflink_inode(ip))
@@ -511,7 +509,8 @@ xfs_reflink_cancel_cow_blocks(
511 if (error) 509 if (error)
512 break; 510 break;
513 } else if (del.br_state == XFS_EXT_UNWRITTEN || cancel_real) { 511 } else if (del.br_state == XFS_EXT_UNWRITTEN || cancel_real) {
514 xfs_defer_init(*tpp, &dfops); 512 ASSERT((*tpp)->t_dfops);
513 ASSERT((*tpp)->t_firstblock == NULLFSBLOCK);
515 514
516 /* Free the CoW orphan record. */ 515 /* Free the CoW orphan record. */
517 error = xfs_refcount_free_cow_extent(ip->i_mount, 516 error = xfs_refcount_free_cow_extent(ip->i_mount,
@@ -553,7 +552,6 @@ next_extent:
553 /* clear tag if cow fork is emptied */ 552 /* clear tag if cow fork is emptied */
554 if (!ifp->if_bytes) 553 if (!ifp->if_bytes)
555 xfs_inode_clear_cowblocks_tag(ip); 554 xfs_inode_clear_cowblocks_tag(ip);
556 (*tpp)->t_dfops = odfops;
557 return error; 555 return error;
558} 556}
559 557