From fbfa977d25dc8db92dbf5fcafb0e03fae0005be5 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 1 Aug 2018 07:20:29 -0700 Subject: xfs: use transaction for intent recovery instead of raw dfops Log intent recovery is the last user of an external (on-stack) dfops. The pattern exists because the dfops is used to collect additional deferred operations queued during the whole recovery sequence. The dfops is finished with a new transaction after intent recovery completes. We already have a mechanism to create an empty, container-like transaction to support the scrub infrastructure. We can reuse that mechanism here to drop the final user of external dfops. This facilitates folding dfops state (i.e., dop_low) into the transaction, the elimination of now unused external dfops support and also eliminates the only caller of __xfs_defer_cancel(). Replace the on-stack dfops with an empty transaction and pass it around to the various helpers that queue and finish deferred operations during intent recovery. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_bmap_item.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/xfs/xfs_bmap_item.c') diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c index e1d6c127b07d..57429055e608 100644 --- a/fs/xfs/xfs_bmap_item.c +++ b/fs/xfs/xfs_bmap_item.c @@ -375,9 +375,8 @@ xfs_bud_init( */ int xfs_bui_recover( - struct xfs_mount *mp, - struct xfs_bui_log_item *buip, - struct xfs_defer_ops *dfops) + struct xfs_trans *parent_tp, + struct xfs_bui_log_item *buip) { int error = 0; unsigned int bui_type; @@ -393,6 +392,7 @@ xfs_bui_recover( struct xfs_trans *tp; struct xfs_inode *ip = NULL; struct xfs_bmbt_irec irec; + struct xfs_mount *mp = parent_tp->t_mountp; ASSERT(!test_bit(XFS_BUI_RECOVERED, &buip->bui_flags)); @@ -446,7 +446,7 @@ xfs_bui_recover( * finishes them on completion. Transfer current dfops state to this * transaction and transfer the result back before we return. */ - xfs_defer_move(tp->t_dfops, dfops); + xfs_defer_move(tp->t_dfops, parent_tp->t_dfops); budp = xfs_trans_get_bud(tp, buip); /* Grab the inode. */ @@ -494,7 +494,7 @@ xfs_bui_recover( } set_bit(XFS_BUI_RECOVERED, &buip->bui_flags); - xfs_defer_move(dfops, tp->t_dfops); + xfs_defer_move(parent_tp->t_dfops, tp->t_dfops); error = xfs_trans_commit(tp); xfs_iunlock(ip, XFS_ILOCK_EXCL); xfs_irele(ip); @@ -502,7 +502,7 @@ xfs_bui_recover( return error; err_inode: - xfs_defer_move(dfops, tp->t_dfops); + xfs_defer_move(parent_tp->t_dfops, tp->t_dfops); xfs_trans_cancel(tp); if (ip) { xfs_iunlock(ip, XFS_ILOCK_EXCL); -- cgit v1.2.3-55-g7522