fs: dlm: Simplify the allocation of slab caches in dlm_lowcomms_msg_cache_create

Message ID 20240117094912.155729-1-chentao@kylinos.cn
State New
Headers
Series fs: dlm: Simplify the allocation of slab caches in dlm_lowcomms_msg_cache_create |

Commit Message

Kunwu Chan Jan. 17, 2024, 9:49 a.m. UTC
  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@kylinos.cn>
---
 fs/dlm/lowcomms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Alexander Aring Feb. 5, 2024, 3:52 p.m. UTC | #1
Hi,

On Wed, Jan 17, 2024 at 4:54 AM Kunwu Chan <chentao@kylinos.cn> wrote:
>
> 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@kylinos.cn>

Acked-by: Alexander Aring <aahringo@redhat.com>

- Alex
  

Patch

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 6296c62c10fa..712165a1e567 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -248,7 +248,7 @@  struct kmem_cache *dlm_lowcomms_writequeue_cache_create(void)
 
 struct kmem_cache *dlm_lowcomms_msg_cache_create(void)
 {
-	return kmem_cache_create("dlm_msg", sizeof(struct dlm_msg), 0, 0, NULL);
+	return KMEM_CACHE(dlm_msg, 0);
 }
 
 /* need to held writequeue_lock */