Messages in this thread Patch in this message | | | From | Geliang Tang <> | Subject | [PATCH 2/3] dlm: use KMEM_CACHE macro | Date | Sun, 13 Mar 2016 15:18:38 +0800 |
| |
Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@163.com> --- 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
| |