Commit 66ce5447 authored by Kunwu Chan's avatar Kunwu Chan Committed by David Sterba

btrfs: use KMEM_CACHE() to create btrfs_path 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: default avatarKunwu Chan <chentao@kylinos.cn>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2753b4d8
......@@ -5086,9 +5086,7 @@ int btrfs_previous_extent_item(struct btrfs_root *root,
int __init btrfs_ctree_init(void)
{
btrfs_path_cachep = kmem_cache_create("btrfs_path",
sizeof(struct btrfs_path), 0,
SLAB_MEM_SPREAD, NULL);
btrfs_path_cachep = KMEM_CACHE(btrfs_path, SLAB_MEM_SPREAD);
if (!btrfs_path_cachep)
return -ENOMEM;
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment