From: Kunwu Chan Date: Tue, 20 Feb 2024 09:06:42 +0000 (+0800) Subject: btrfs: use KMEM_CACHE() to create btrfs_trans_handle cache X-Git-Tag: block-6.9-20240315~40^2~21 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2753b4d8282e2cad95ff82fcea07059e3d52ac54;p=linux-2.6-block.git 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 22ca59e29948..31ac5a04cc02 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -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;