summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2024-02-20 17:06:45 +0800
committerDavid Sterba <dsterba@suse.com>2024-03-04 16:24:54 +0100
commit06c9564980f1748a88e4bcf710d7811bc54784be (patch)
treea1be1164f76021f80ab29dc91240236f4326d819 /fs
parentb2c7d55e4c4c405125c66ce8ca86a6ea0496bb0d (diff)
btrfs: use KMEM_CACHE() to create btrfs_free_space cache
Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify the creation of SLAB caches when the default values are used. Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/free-space-cache.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index ca9f837daa9e..d984912dae06 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -4154,9 +4154,7 @@ out:
int __init btrfs_free_space_init(void)
{
- btrfs_free_space_cachep = kmem_cache_create("btrfs_free_space",
- sizeof(struct btrfs_free_space), 0,
- SLAB_MEM_SPREAD, NULL);
+ btrfs_free_space_cachep = KMEM_CACHE(btrfs_free_space, SLAB_MEM_SPREAD);
if (!btrfs_free_space_cachep)
return -ENOMEM;