From: Darrick J. Wong Date: Mon, 15 Apr 2024 23:07:32 +0000 (-0700) Subject: xfs: hoist xfs_trans_add_item calls to defer ops functions X-Git-Tag: v6.8.0~96 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b315a11ddcb25a7b47b5ed2d47ca5e4b3b7ac53f;p=thirdparty%2Fxfsprogs-dev.git xfs: hoist xfs_trans_add_item calls to defer ops functions Source kernel commit: b28852a5bd08654634e4e32eb072fba14c5fae26 Remove even more repeated boilerplate. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell --- diff --git a/libxfs/xfs_defer.c b/libxfs/xfs_defer.c index 42e1c9c0..27f9938a 100644 --- a/libxfs/xfs_defer.c +++ b/libxfs/xfs_defer.c @@ -208,6 +208,7 @@ xfs_defer_create_done( return; tp->t_flags |= XFS_TRANS_HAS_INTENT_DONE; + xfs_trans_add_item(tp, lip); set_bit(XFS_LI_DIRTY, &lip->li_flags); dfp->dfp_done = lip; } @@ -236,6 +237,7 @@ xfs_defer_create_intent( return PTR_ERR(lip); tp->t_flags |= XFS_TRANS_DIRTY; + xfs_trans_add_item(tp, lip); set_bit(XFS_LI_DIRTY, &lip->li_flags); dfp->dfp_intent = lip; return 1; @@ -501,8 +503,10 @@ xfs_defer_relog( xfs_defer_create_done(*tpp, dfp); lip = xfs_trans_item_relog(dfp->dfp_intent, dfp->dfp_done, *tpp); - if (lip) + if (lip) { + xfs_trans_add_item(*tpp, lip); set_bit(XFS_LI_DIRTY, &lip->li_flags); + } dfp->dfp_done = NULL; dfp->dfp_intent = lip; }