Skip to content

Commit 37f9d1d

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent f939637 commit 37f9d1d

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

fs/xfs/xfs_rmap_item.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,17 @@ xfs_rmap_update_put_group(
358358
xfs_perag_intent_put(ri->ri_pag);
359359
}
360360

361+
/* Cancel a deferred rmap update. */
362+
STATIC void
363+
xfs_rmap_update_cancel_item(
364+
struct list_head *item)
365+
{
366+
struct xfs_rmap_intent *ri = ri_entry(item);
367+
368+
xfs_rmap_update_put_group(ri);
369+
kmem_cache_free(xfs_rmap_intent_cache, ri);
370+
}
371+
361372
/* Process a deferred rmap update. */
362373
STATIC int
363374
xfs_rmap_update_finish_item(
@@ -371,8 +382,7 @@ xfs_rmap_update_finish_item(
371382

372383
error = xfs_rmap_finish_one(tp, ri, state);
373384

374-
xfs_rmap_update_put_group(ri);
375-
kmem_cache_free(xfs_rmap_intent_cache, ri);
385+
xfs_rmap_update_cancel_item(item);
376386
return error;
377387
}
378388

@@ -384,17 +394,6 @@ xfs_rmap_update_abort_intent(
384394
xfs_rui_release(RUI_ITEM(intent));
385395
}
386396

387-
/* Cancel a deferred rmap update. */
388-
STATIC void
389-
xfs_rmap_update_cancel_item(
390-
struct list_head *item)
391-
{
392-
struct xfs_rmap_intent *ri = ri_entry(item);
393-
394-
xfs_rmap_update_put_group(ri);
395-
kmem_cache_free(xfs_rmap_intent_cache, ri);
396-
}
397-
398397
/* Is this recovered RUI ok? */
399398
static inline bool
400399
xfs_rui_validate_map(

0 commit comments

Comments
 (0)