From: Kunwu Chan Date: Thu, 1 Feb 2024 09:34:26 +0000 (+0800) Subject: mbcache: Simplify the allocation of slab caches X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ce51bf1790c4972125b19c22dbfa76d7e0136280;p=linux.git mbcache: Simplify the allocation of slab caches Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan Link: https://lore.kernel.org/r/20240201093426.207932-1-chentao@kylinos.cn Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/fs/mbcache.c b/fs/mbcache.c index 82aa7a35db26b..fe2624e172533 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -426,9 +426,8 @@ EXPORT_SYMBOL(mb_cache_destroy); static int __init mbcache_init(void) { - mb_entry_cache = kmem_cache_create("mbcache", - sizeof(struct mb_cache_entry), 0, - SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL); + mb_entry_cache = KMEM_CACHE(mb_cache_entry, + SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD); if (!mb_entry_cache) return -ENOMEM; return 0;