Skip to content

Commit

Permalink
libceph: use KMEM_CACHE macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and Ilya Dryomov committed Mar 25, 2016
1 parent 99ec269 commit 5ee61e9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,12 @@ static struct workqueue_struct *ceph_msgr_wq;
static int ceph_msgr_slab_init(void)
{
BUG_ON(ceph_msg_cache);
ceph_msg_cache = kmem_cache_create("ceph_msg",
sizeof (struct ceph_msg),
__alignof__(struct ceph_msg), 0, NULL);

ceph_msg_cache = KMEM_CACHE(ceph_msg, 0);
if (!ceph_msg_cache)
return -ENOMEM;

BUG_ON(ceph_msg_data_cache);
ceph_msg_data_cache = kmem_cache_create("ceph_msg_data",
sizeof (struct ceph_msg_data),
__alignof__(struct ceph_msg_data),
0, NULL);
ceph_msg_data_cache = KMEM_CACHE(ceph_msg_data, 0);
if (ceph_msg_data_cache)
return 0;

Expand Down

0 comments on commit 5ee61e9

Please sign in to comment.