From: Darrick J. Wong Date: Mon, 15 Apr 2024 23:07:32 +0000 (-0700) Subject: xfs: use xfs_defer_create_done for the relogging operation X-Git-Tag: v6.8.0~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35d610ce2c6616fca1716d7756eeb8ad06e4004f;p=thirdparty%2Fxfsprogs-dev.git xfs: use xfs_defer_create_done for the relogging operation Source kernel commit: bd3a88f6b71c7509566b44b7021581191cc11ae3 Now that we have a helper to handle creating a log intent done item and updating all the necessary state flags, use it to reduce boilerplate in the ->iop_relog implementations. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell --- diff --git a/include/xfs_trans.h b/include/xfs_trans.h index 8371bc7e..ee250d52 100644 --- a/include/xfs_trans.h +++ b/include/xfs_trans.h @@ -158,7 +158,7 @@ libxfs_trans_read_buf( } #define xfs_log_item_in_current_chkpt(lip) (false) -#define xfs_trans_item_relog(lip, tp) (NULL) +#define xfs_trans_item_relog(lip, dontcare, tp) (NULL) /* Contorted mess to make gcc shut up about unused vars. */ #define xlog_grant_push_threshold(log, need) \ diff --git a/libxfs/xfs_defer.c b/libxfs/xfs_defer.c index 1be9554e..43117099 100644 --- a/libxfs/xfs_defer.c +++ b/libxfs/xfs_defer.c @@ -495,7 +495,11 @@ xfs_defer_relog( trace_xfs_defer_relog_intent((*tpp)->t_mountp, dfp); XFS_STATS_INC((*tpp)->t_mountp, defer_relog); - dfp->dfp_intent = xfs_trans_item_relog(dfp->dfp_intent, *tpp); + + xfs_defer_create_done(*tpp, dfp); + dfp->dfp_intent = xfs_trans_item_relog(dfp->dfp_intent, + dfp->dfp_done, *tpp); + dfp->dfp_done = NULL; } if ((*tpp)->t_flags & XFS_TRANS_DIRTY)