From: Darrick J. Wong <djwong@xxxxxxxxxx> 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 <djwong@xxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Bill O'Donnell <bodonnel@xxxxxxxxxx> --- include/xfs_trans.h | 2 +- libxfs/xfs_defer.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/xfs_trans.h b/include/xfs_trans.h index 8371bc7e8..ee250d521 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 1be9554e1..43117099c 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)