Skip to content

Commit 2753b4d

Browse files
KunWuChankdave
authored andcommitted
btrfs: use KMEM_CACHE() to create btrfs_trans_handle 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 4bd3e12 commit 2753b4d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

fs/btrfs/transaction.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,9 +2671,8 @@ void __cold __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
26712671

26722672
int __init btrfs_transaction_init(void)
26732673
{
2674-
btrfs_trans_handle_cachep = kmem_cache_create("btrfs_trans_handle",
2675-
sizeof(struct btrfs_trans_handle), 0,
2676-
SLAB_TEMPORARY | SLAB_MEM_SPREAD, NULL);
2674+
btrfs_trans_handle_cachep = KMEM_CACHE(btrfs_trans_handle,
2675+
SLAB_TEMPORARY | SLAB_MEM_SPREAD);
26772676
if (!btrfs_trans_handle_cachep)
26782677
return -ENOMEM;
26792678
return 0;

0 commit comments

Comments
 (0)