[PATCH] xfs: Simplify the allocation of slab caches in xfs_bmap_intent_init_cache

Kunwu Chan posted 1 patch 2 years ago
fs/xfs/libxfs/xfs_bmap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH] xfs: Simplify the allocation of slab caches in xfs_bmap_intent_init_cache
Posted by Kunwu Chan 2 years ago
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 fs/xfs/libxfs/xfs_bmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index f362345467fa..e46d0e21aeb6 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -6211,9 +6211,7 @@ xfs_bmap_validate_extent_raw(
 int __init
 xfs_bmap_intent_init_cache(void)
 {
-	xfs_bmap_intent_cache = kmem_cache_create("xfs_bmap_intent",
-			sizeof(struct xfs_bmap_intent),
-			0, 0, NULL);
+	xfs_bmap_intent_cache = KMEM_CACHE(xfs_bmap_intent, 0);
 
 	return xfs_bmap_intent_cache != NULL ? 0 : -ENOMEM;
 }
-- 
2.39.2