Skip to content

Commit 4bd3e12

Browse files
KunWuChankdave
authored andcommitted
btrfs: use KMEM_CACHE() to create btrfs_ordered_extent 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>
1 parent 625c1e0 commit 4bd3e12

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

fs/btrfs/ordered-data.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,10 +1235,7 @@ struct btrfs_ordered_extent *btrfs_split_ordered_extent(
12351235

12361236
int __init ordered_data_init(void)
12371237
{
1238-
btrfs_ordered_extent_cache = kmem_cache_create("btrfs_ordered_extent",
1239-
sizeof(struct btrfs_ordered_extent), 0,
1240-
SLAB_MEM_SPREAD,
1241-
NULL);
1238+
btrfs_ordered_extent_cache = KMEM_CACHE(btrfs_ordered_extent, SLAB_MEM_SPREAD);
12421239
if (!btrfs_ordered_extent_cache)
12431240
return -ENOMEM;
12441241

0 commit comments

Comments
 (0)