mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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: Kunwu Chan <chentao@kylinos.cn> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2753b4d828
commit
66ce5447d8
@ -5086,9 +5086,7 @@ int btrfs_previous_extent_item(struct btrfs_root *root,
|
|||||||
|
|
||||||
int __init btrfs_ctree_init(void)
|
int __init btrfs_ctree_init(void)
|
||||||
{
|
{
|
||||||
btrfs_path_cachep = kmem_cache_create("btrfs_path",
|
btrfs_path_cachep = KMEM_CACHE(btrfs_path, SLAB_MEM_SPREAD);
|
||||||
sizeof(struct btrfs_path), 0,
|
|
||||||
SLAB_MEM_SPREAD, NULL);
|
|
||||||
if (!btrfs_path_cachep)
|
if (!btrfs_path_cachep)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user