summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_rmap_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-11-30 10:45:28 -0800
committerDarrick J. Wong <djwong@kernel.org>2023-12-06 18:45:15 -0800
commit3dd75c8db1c1675a26d3e228bab349c1fc065867 (patch)
tree902c260865c8e85da5a52179ae7b073616b8db0f /fs/xfs/xfs_rmap_item.c
parent172538beba82e7b65d3d7c84cb558f287381cd7a (diff)
downloadlwn-3dd75c8db1c1675a26d3e228bab349c1fc065867.tar.gz
lwn-3dd75c8db1c1675a26d3e228bab349c1fc065867.zip
xfs: hoist intent done flag setting to ->finish_item callsite
Each log intent item's ->finish_item call chain inevitably includes some code to set the dirty flag of the transaction. If there's an associated log intent done item, it also sets the item's dirty flag and the transaction's INTENT_DONE flag. This is repeated throughout the codebase. Reduce the LOC by moving all that to xfs_defer_finish_one. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_rmap_item.c')
-rw-r--r--fs/xfs/xfs_rmap_item.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c
index 23684bc2ab85..8f216a13a7f2 100644
--- a/fs/xfs/xfs_rmap_item.c
+++ b/fs/xfs/xfs_rmap_item.c
@@ -297,21 +297,7 @@ xfs_trans_log_finish_rmap_update(
struct xfs_rmap_intent *ri,
struct xfs_btree_cur **pcur)
{
- int error;
-
- error = xfs_rmap_finish_one(tp, ri, pcur);
-
- /*
- * Mark the transaction dirty, even on error. This ensures the
- * transaction is aborted, which:
- *
- * 1.) releases the RUI and frees the RUD
- * 2.) shuts down the filesystem
- */
- tp->t_flags |= XFS_TRANS_DIRTY | XFS_TRANS_HAS_INTENT_DONE;
- set_bit(XFS_LI_DIRTY, &rudp->rud_item.li_flags);
-
- return error;
+ return xfs_rmap_finish_one(tp, ri, pcur);
}
/* Sort rmap intents by AG. */