summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-07-02 11:23:01 -0700
committerDarrick J. Wong <djwong@kernel.org>2024-07-02 11:37:04 -0700
commit37f9d1db03ba0511403c5d25ba0baaddf5208ba7 (patch)
tree0f571691d13914ae53c0cec5aef961063c7cdb83 /fs
parentf93963779b438a33ca4b13384c070a6864ce2b2b (diff)
xfs: reuse xfs_rmap_update_cancel_item
Reuse xfs_rmap_update_cancel_item to put the AG/RTG and free the item in a few places that currently open code the logic. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_rmap_item.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c
index 1cc1ec597a0b..68e4ce0dbd72 100644
--- a/fs/xfs/xfs_rmap_item.c
+++ b/fs/xfs/xfs_rmap_item.c
@@ -358,6 +358,17 @@ xfs_rmap_update_put_group(
xfs_perag_intent_put(ri->ri_pag);
}
+/* Cancel a deferred rmap update. */
+STATIC void
+xfs_rmap_update_cancel_item(
+ struct list_head *item)
+{
+ struct xfs_rmap_intent *ri = ri_entry(item);
+
+ xfs_rmap_update_put_group(ri);
+ kmem_cache_free(xfs_rmap_intent_cache, ri);
+}
+
/* Process a deferred rmap update. */
STATIC int
xfs_rmap_update_finish_item(
@@ -371,8 +382,7 @@ xfs_rmap_update_finish_item(
error = xfs_rmap_finish_one(tp, ri, state);
- xfs_rmap_update_put_group(ri);
- kmem_cache_free(xfs_rmap_intent_cache, ri);
+ xfs_rmap_update_cancel_item(item);
return error;
}
@@ -384,17 +394,6 @@ xfs_rmap_update_abort_intent(
xfs_rui_release(RUI_ITEM(intent));
}
-/* Cancel a deferred rmap update. */
-STATIC void
-xfs_rmap_update_cancel_item(
- struct list_head *item)
-{
- struct xfs_rmap_intent *ri = ri_entry(item);
-
- xfs_rmap_update_put_group(ri);
- kmem_cache_free(xfs_rmap_intent_cache, ri);
-}
-
/* Is this recovered RUI ok? */
static inline bool
xfs_rui_validate_map(