[1/3] rbd: use KMEM_CACHE macro
diff mbox

Message ID 9242267d62daeec8a0de5a1230f750ca486d62cd.1457853190.git.geliangtang@163.com
State New
Headers show

Commit Message

Geliang Tang March 13, 2016, 7:18 a.m. UTC
Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/block/rbd.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Ilya Dryomov March 22, 2016, 4:55 p.m. UTC | #1
On Sun, Mar 13, 2016 at 8:17 AM, Geliang Tang <geliangtang@163.com> wrote:
> Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/block/rbd.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 4a87678..70eba86 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -5643,18 +5643,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;
>

Applied.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4a87678..70eba86 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5643,18 +5643,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;