]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: use KMEM_CACHE() to create btrfs_trans_handle cache
authorKunwu Chan <chentao@kylinos.cn>
Tue, 20 Feb 2024 09:06:42 +0000 (17:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:53 +0000 (16:24 +0100)
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>
fs/btrfs/transaction.c

index 22ca59e299485208d3307eef1ad0c6222e47e200..31ac5a04cc029689d25c8f612af5eb57293505a3 100644 (file)
@@ -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;