[PATCH 2/3] dlm: use KMEM_CACHE macro
From: Geliang Tang
Date: Sun Mar 13 2016 - 03:19:24 EST
Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@xxxxxxx>
---
fs/dlm/memory.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
index 7cd24bc..6baa721 100644
--- a/fs/dlm/memory.c
+++ b/fs/dlm/memory.c
@@ -21,13 +21,11 @@ static struct kmem_cache *rsb_cache;
int __init dlm_memory_init(void)
{
- lkb_cache = kmem_cache_create("dlm_lkb", sizeof(struct dlm_lkb),
- __alignof__(struct dlm_lkb), 0, NULL);
+ lkb_cache = KMEM_CACHE(dlm_lkb, 0);
if (!lkb_cache)
return -ENOMEM;
- rsb_cache = kmem_cache_create("dlm_rsb", sizeof(struct dlm_rsb),
- __alignof__(struct dlm_rsb), 0, NULL);
+ rsb_cache = KMEM_CACHE(dlm_rsb, 0);
if (!rsb_cache) {
kmem_cache_destroy(lkb_cache);
return -ENOMEM;
--
2.5.0