[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240201093554.208092-1-chentao@kylinos.cn>
Date: Thu, 1 Feb 2024 17:35:54 +0800
From: Kunwu Chan <chentao@...inos.cn>
To: clm@...com,
josef@...icpanda.com,
dsterba@...e.com
Cc: linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Kunwu Chan <chentao@...inos.cn>
Subject: [PATCH] btrfs: Simplify the allocation of slab caches in btrfs_transaction_init
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
Signed-off-by: Kunwu Chan <chentao@...inos.cn>
---
fs/btrfs/transaction.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 5b3333ceef04..0c069d44e77f 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2720,9 +2720,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;
--
2.39.2
Powered by blists - more mailing lists