rbd: use KMEM_CACHE macro
authorGeliang Tang <geliangtang@163.com>
Sun, 13 Mar 2016 07:17:32 +0000 (15:17 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 25 Mar 2016 17:51:56 +0000 (18:51 +0100)
Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c

index 08018710f36360c73f19527e975a059c91a30e28..9c6234428607fb60a6d65a3ea0c1eebfa72b6b96 100644 (file)
@@ -5641,18 +5641,12 @@ static void rbd_sysfs_cleanup(void)
 static int rbd_slab_init(void)
 {
        rbd_assert(!rbd_img_request_cache);
-       rbd_img_request_cache = kmem_cache_create("rbd_img_request",
-                                       sizeof (struct rbd_img_request),
-                                       __alignof__(struct rbd_img_request),
-                                       0, NULL);
+       rbd_img_request_cache = KMEM_CACHE(rbd_img_request, 0);
        if (!rbd_img_request_cache)
                return -ENOMEM;
 
        rbd_assert(!rbd_obj_request_cache);
-       rbd_obj_request_cache = kmem_cache_create("rbd_obj_request",
-                                       sizeof (struct rbd_obj_request),
-                                       __alignof__(struct rbd_obj_request),
-                                       0, NULL);
+       rbd_obj_request_cache = KMEM_CACHE(rbd_obj_request, 0);
        if (!rbd_obj_request_cache)
                goto out_err;