xfs: rename xfs_bmap_add_free to xfs_free_extent_later
xfs_bmap_add_free isn't a block mapping function; it schedules deferred
freeing operations for a later point in a compound transaction chain.
While it's primarily used by bunmapi, its use has expanded beyond that.
Move it to xfs_alloc.c and rename the function since it's now general
freeing functionality. Bring the slab cache bits in line with the
way we handle the other intent items.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index e2d1fdc..f4c5084 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1963,15 +1963,9 @@ xfs_init_caches(void)
if (!xfs_log_ticket_cache)
goto out;
- xfs_bmap_free_item_cache = kmem_cache_create("xfs_bmap_free_item",
- sizeof(struct xfs_extent_free_item),
- 0, 0, NULL);
- if (!xfs_bmap_free_item_cache)
- goto out_destroy_log_ticket_cache;
-
error = xfs_btree_init_cur_caches();
if (error)
- goto out_destroy_bmap_free_item_cache;
+ goto out_destroy_log_ticket_cache;
error = xfs_defer_init_item_caches();
if (error)
@@ -2115,8 +2109,6 @@ xfs_init_caches(void)
xfs_defer_destroy_item_caches();
out_destroy_btree_cur_cache:
xfs_btree_destroy_cur_caches();
- out_destroy_bmap_free_item_cache:
- kmem_cache_destroy(xfs_bmap_free_item_cache);
out_destroy_log_ticket_cache:
kmem_cache_destroy(xfs_log_ticket_cache);
out:
@@ -2148,7 +2140,6 @@ xfs_destroy_caches(void)
kmem_cache_destroy(xfs_da_state_cache);
xfs_defer_destroy_item_caches();
xfs_btree_destroy_cur_caches();
- kmem_cache_destroy(xfs_bmap_free_item_cache);
kmem_cache_destroy(xfs_log_ticket_cache);
}