[PATCH] maple_tree: use KMEM_CACHE to create maple_node caches

Ke Sun sunke at kylinos.cn
Sun Nov 3 22:16:17 PST 2024


Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify
the creation of SLAB caches.

Signed-off-by: Ke Sun <sunke at kylinos.cn>
---
 lib/maple_tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 3619301dda2e..60be142e35c6 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6299,9 +6299,7 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp)
 
 void __init maple_tree_init(void)
 {
-	maple_node_cache = kmem_cache_create("maple_node",
-			sizeof(struct maple_node), sizeof(struct maple_node),
-			SLAB_PANIC, NULL);
+	maple_node_cache = KMEM_CACHE(maple_node, SLAB_PANIC);
 }
 
 /**
-- 
2.34.1




More information about the maple-tree mailing list