linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] maple_tree: use KMEM_CACHE to create maple_node caches
@ 2024-11-04  6:16 Ke Sun
  2024-11-04 13:27 ` Matthew Wilcox
  2024-11-05  2:34 ` kernel test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Ke Sun @ 2024-11-04  6:16 UTC (permalink / raw)
  To: Andrew Morton, Liam R. Howlett; +Cc: maple-tree, linux-mm, Ke Sun

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

Signed-off-by: Ke Sun <sunke@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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-05  4:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-04  6:16 [PATCH] maple_tree: use KMEM_CACHE to create maple_node caches Ke Sun
2024-11-04 13:27 ` Matthew Wilcox
2024-11-05  2:21   ` Ke Sun
2024-11-05  4:17     ` Matthew Wilcox
2024-11-05  2:34 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox