Skip to content

Commit 5ee61e9

Browse files
geliangtangidryomov
authored andcommitted
libceph: use KMEM_CACHE macro
Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code. Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 99ec269 commit 5ee61e9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

net/ceph/messenger.c

+2-8
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,12 @@ static struct workqueue_struct *ceph_msgr_wq;
235235
static int ceph_msgr_slab_init(void)
236236
{
237237
BUG_ON(ceph_msg_cache);
238-
ceph_msg_cache = kmem_cache_create("ceph_msg",
239-
sizeof (struct ceph_msg),
240-
__alignof__(struct ceph_msg), 0, NULL);
241-
238+
ceph_msg_cache = KMEM_CACHE(ceph_msg, 0);
242239
if (!ceph_msg_cache)
243240
return -ENOMEM;
244241

245242
BUG_ON(ceph_msg_data_cache);
246-
ceph_msg_data_cache = kmem_cache_create("ceph_msg_data",
247-
sizeof (struct ceph_msg_data),
248-
__alignof__(struct ceph_msg_data),
249-
0, NULL);
243+
ceph_msg_data_cache = KMEM_CACHE(ceph_msg_data, 0);
250244
if (ceph_msg_data_cache)
251245
return 0;
252246

0 commit comments

Comments
 (0)