summaryrefslogtreecommitdiffstats
path: root/fs/mbcache.c
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2024-02-01 17:34:26 +0800
committerChristian Brauner <brauner@kernel.org>2024-02-02 13:11:50 +0100
commitce51bf1790c4972125b19c22dbfa76d7e0136280 (patch)
tree5c0a1c755eb7c765c69cfdc442611727cb7292ea /fs/mbcache.c
parent617fc7775370324d0a2b888625b042221ebdcb62 (diff)
downloadlinux-ce51bf1790c4972125b19c22dbfa76d7e0136280.tar.gz
linux-ce51bf1790c4972125b19c22dbfa76d7e0136280.tar.bz2
linux-ce51bf1790c4972125b19c22dbfa76d7e0136280.zip
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 <chentao@kylinos.cn> Link: https://lore.kernel.org/r/20240201093426.207932-1-chentao@kylinos.cn Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/mbcache.c')
-rw-r--r--fs/mbcache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/mbcache.c b/fs/mbcache.c
index 82aa7a35db26..fe2624e17253 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;