Skip to content

Commit 06c9564

Browse files
KunWuChankdave
authored andcommitted
btrfs: use KMEM_CACHE() to create btrfs_free_space 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 b2c7d55 commit 06c9564

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

fs/btrfs/free-space-cache.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4154,9 +4154,7 @@ int btrfs_set_free_space_cache_v1_active(struct btrfs_fs_info *fs_info, bool act
41544154

41554155
int __init btrfs_free_space_init(void)
41564156
{
4157-
btrfs_free_space_cachep = kmem_cache_create("btrfs_free_space",
4158-
sizeof(struct btrfs_free_space), 0,
4159-
SLAB_MEM_SPREAD, NULL);
4157+
btrfs_free_space_cachep = KMEM_CACHE(btrfs_free_space, SLAB_MEM_SPREAD);
41604158
if (!btrfs_free_space_cachep)
41614159
return -ENOMEM;
41624160

0 commit comments

Comments
 (0)