From: Brian Foster Date: Tue, 24 Jul 2018 20:43:12 +0000 (-0700) Subject: xfs: use internal dfops in cow blocks cancel X-Git-Tag: Ubuntu-5.2.0-15.16~3835^2~53 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1e5ae1995a44f2b7a03f08a10504568a96040a8c;p=mirror_ubuntu-eoan-kernel.git 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 Reviewed-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- 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( struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK); struct xfs_bmbt_irec got, del; struct xfs_iext_cursor icur; - struct xfs_defer_ops dfops; - struct xfs_defer_ops *odfops = (*tpp)->t_dfops; int error = 0; if (!xfs_is_reflink_inode(ip)) @@ -511,7 +509,8 @@ xfs_reflink_cancel_cow_blocks( if (error) break; } else if (del.br_state == XFS_EXT_UNWRITTEN || cancel_real) { - xfs_defer_init(*tpp, &dfops); + ASSERT((*tpp)->t_dfops); + ASSERT((*tpp)->t_firstblock == NULLFSBLOCK); /* Free the CoW orphan record. */ error = xfs_refcount_free_cow_extent(ip->i_mount, @@ -553,7 +552,6 @@ next_extent: /* clear tag if cow fork is emptied */ if (!ifp->if_bytes) xfs_inode_clear_cowblocks_tag(ip); - (*tpp)->t_dfops = odfops; return error; }