Skip to content

Commit 66ce544

Browse files
KunWuChankdave
authored andcommitted
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>
1 parent 2753b4d commit 66ce544

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

fs/btrfs/ctree.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,9 +5086,7 @@ int btrfs_previous_extent_item(struct btrfs_root *root,
50865086

50875087
int __init btrfs_ctree_init(void)
50885088
{
5089-
btrfs_path_cachep = kmem_cache_create("btrfs_path",
5090-
sizeof(struct btrfs_path), 0,
5091-
SLAB_MEM_SPREAD, NULL);
5089+
btrfs_path_cachep = KMEM_CACHE(btrfs_path, SLAB_MEM_SPREAD);
50925090
if (!btrfs_path_cachep)
50935091
return -ENOMEM;
50945092
return 0;

0 commit comments

Comments
 (0)