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

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

Commit Message

Kunwu Chan Feb. 5, 2024, 8:59 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/midcomms.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

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

On Mon, Feb 5, 2024 at 4:00 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/midcomms.c b/fs/dlm/midcomms.c
index 2247ebb61be1..8e9920f1b48b 100644
--- a/fs/dlm/midcomms.c
+++ b/fs/dlm/midcomms.c
@@ -226,8 +226,7 @@  static DEFINE_MUTEX(close_lock);
 
 struct kmem_cache *dlm_midcomms_cache_create(void)
 {
-	return kmem_cache_create("dlm_mhandle", sizeof(struct dlm_mhandle),
-				 0, 0, NULL);
+	return KMEM_CACHE(dlm_mhandle, 0);
 }
 
 static inline const char *dlm_state_str(int state)