Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03d94406 authored by Geliang Tang's avatar Geliang Tang Committed by Ilya Dryomov
Browse files

rbd: use KMEM_CACHE macro



Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code.

Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 200fd27c
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -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;