linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Wang <rocking@whu.edu.cn>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peng Wang <rocking@whu.edu.cn>
Subject: [PATCH] block: use KMEM_CACHE macro
Date: Mon, 27 May 2019 20:05:18 +0800	[thread overview]
Message-ID: <20190527120518.3703-1-rocking@whu.edu.cn> (raw)

Use the preferred KMEM_CACHE helper for brevity.

Signed-off-by: Peng Wang <rocking@whu.edu.cn>
---
 block/blk-core.c | 3 +--
 block/blk-ioc.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 1bf83a0df0f6..841bf0b12755 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1789,8 +1789,7 @@ int __init blk_dev_init(void)
 	if (!kblockd_workqueue)
 		panic("Failed to create kblockd\n");
 
-	blk_requestq_cachep = kmem_cache_create("request_queue",
-			sizeof(struct request_queue), 0, SLAB_PANIC, NULL);
+	blk_requestq_cachep = KMEM_CACHE(request_queue, SLAB_PANIC);
 
 #ifdef CONFIG_DEBUG_FS
 	blk_debugfs_root = debugfs_create_dir("block", NULL);
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 5ed59ac6ae58..58c79aeca955 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -408,8 +408,7 @@ struct io_cq *ioc_create_icq(struct io_context *ioc, struct request_queue *q,
 
 static int __init blk_ioc_init(void)
 {
-	iocontext_cachep = kmem_cache_create("blkdev_ioc",
-			sizeof(struct io_context), 0, SLAB_PANIC, NULL);
+	iocontext_cachep = KMEM_CACHE(io_context, SLAB_PANIC);
 	return 0;
 }
 subsys_initcall(blk_ioc_init);
-- 
2.19.1


             reply	other threads:[~2019-05-27 12:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 12:05 Peng Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-27 11:48 [PATCH] block: use KMEM_CACHE macro Peng Wang
2019-05-28 18:50 ` Omar Sandoval
2019-05-28 21:00 ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190527120518.3703-1-rocking@whu.edu.cn \
    --to=rocking@whu.edu.cn \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).