Skip to contentSkip to conversation

libxfs: remove the duplicate allocation of xfs_extfree_item_cache

PATCH In review Wu Guanghao 2 participants 2 messages Nov 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxfs: remove the duplicate allocation of xfs_extfree_item_cache

In init_caches(),the xfs_extfree_item_cache is being repeatedly initialized. The code flow is as follows:

init_caches()

    ...
    xfs_defer_init_item_caches()
        xfs_extfree_intent_init_cache()
            // first alloc
            xfs_extfree_item_cache = kmem_cache_create("xfs_extfree_intent",...);
    ...
    // second alloc
    xfs_extfree_item_cache = kmem_cache_init(..., "xfs_extfree_item");

So, remove the duplicate allocation code.

---
 libxfs/init.c | 4 ----
 1 file changed, 4 deletions(-)
libxfs/init.c +0 -4
index 393a9467..a5e89853 100644
@@ -214,9 +214,6 @@ init_caches(void)
 		fprintf(stderr, "Could not allocate btree cursor caches.\n");
 		abort();
 	}
-	xfs_extfree_item_cache = kmem_cache_init(
-			sizeof(struct xfs_extent_free_item),
-			"xfs_extfree_item");
 	xfs_trans_cache = kmem_cache_init(
 			sizeof(struct xfs_trans), "xfs_trans");
 	xfs_parent_args_cache = kmem_cache_init(
@@ -236,7 +233,6 @@ destroy_caches(void)
 	leaked += kmem_cache_destroy(xfs_da_state_cache);
 	xfs_defer_destroy_item_caches();
 	xfs_btree_destroy_cur_caches();
-	leaked += kmem_cache_destroy(xfs_extfree_item_cache);
 	leaked += kmem_cache_destroy(xfs_trans_cache);
 	leaked += kmem_cache_destroy(xfs_parent_args_cache);
 
Signature · 1 line
2.27.0