Commit 2753b4d8 authored by Kunwu Chan's avatar Kunwu Chan Committed by David Sterba
Browse files

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: default avatarKunwu Chan <chentao@kylinos.cn>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4bd3e126
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -2671,9 +2671,8 @@ void __cold __btrfs_abort_transaction(struct btrfs_trans_handle *trans,

int __init btrfs_transaction_init(void)
{
	btrfs_trans_handle_cachep = kmem_cache_create("btrfs_trans_handle",
			sizeof(struct btrfs_trans_handle), 0,
			SLAB_TEMPORARY | SLAB_MEM_SPREAD, NULL);
	btrfs_trans_handle_cachep = KMEM_CACHE(btrfs_trans_handle,
					       SLAB_TEMPORARY | SLAB_MEM_SPREAD);
	if (!btrfs_trans_handle_cachep)
		return -ENOMEM;
	return 0;