btrfs: use KMEM_CACHE() to create btrfs_ordered_extent cache
authorKunwu Chan <chentao@kylinos.cn>
Tue, 20 Feb 2024 09:06:41 +0000 (17:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:53 +0000 (16:24 +0100)
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>
fs/btrfs/ordered-data.c

index de12c282e69bcfdcd6205fe27c68bcf71988570b..1ee2fb8dcd6a3adb526ffe20c430ab71f59a691f 100644 (file)
@@ -1235,10 +1235,7 @@ struct btrfs_ordered_extent *btrfs_split_ordered_extent(
 
 int __init ordered_data_init(void)
 {
-       btrfs_ordered_extent_cache = kmem_cache_create("btrfs_ordered_extent",
-                                    sizeof(struct btrfs_ordered_extent), 0,
-                                    SLAB_MEM_SPREAD,
-                                    NULL);
+       btrfs_ordered_extent_cache = KMEM_CACHE(btrfs_ordered_extent, SLAB_MEM_SPREAD);
        if (!btrfs_ordered_extent_cache)
                return -ENOMEM;