Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3730064ybi; Mon, 27 May 2019 05:09:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVvl9PPQokSVv97wbQZ4rLriCse8RHisdMH6P2wNanMIMTlZPLIfIm/qbtC/uLXcUlB3Rc X-Received: by 2002:aa7:8f2f:: with SMTP id y15mr124103701pfr.124.1558958992128; Mon, 27 May 2019 05:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558958992; cv=none; d=google.com; s=arc-20160816; b=u6lVZpo+bQbC7ZvnGzDYCyOmnK3waakz6EQmNQCvQ4fZjf35gVSy8CyTF7dV6r9vHK ptb7bHo9TYCcs/JLRp3vvZdOdjX7A2LcxAVuFd+/Ri4MZv1kdNbqsFDFc/lXJf2Y++0a Lb64DyMsU5mEIOnoXEmz6tcAT6O3CXEwk7YUl0UgK2JlEiTDa+gGcE2hbsuB0pcc/K4B zjuEwVXCuHEcCUs9Y7JIQBcoP5gGOIeydBiEoXYuZGfX+6KDMMqEfPPXhk3/d9ujyppO RqHgCYxulPFT8pvpX76CYT09W1XlPAkZq5MDKR/bLTJB3/02+rOYIjcMLKBwgjXd8E2/ oJAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=y1gqZVAzVWe9bM2ba3Sp7s8R4yyC6D0IeItxFE4jExQ=; b=kKpnSxWYrMGCzwMgXRKTeNzYqyiuw57zLx0LUTgqR/5NXNSIgAsbtJ9Dgk/raFJvWN ioiVHO7nYL5yMawzGRESE/Vuv+MpoDwBxOWKv6HXHbxljJn3/e4bdJJx6TxKMW7lMSts 9O0sktvHIOeamvrtorLugccxgdyh0xzl+HCwiQl0u8w8JDA5ffSMUnCdhJExH/wc/T1F x/vbhQ2y3WGFbpt2No03CEfwJ8gNifjrbZnj4Wfd0T0bjJtZtZO0/9uwXsl6DuuFRmYD aZSfsuSeIfMGubLf7mfTjm8cHEZYZz89OxNo2OoY7NSJ3z0HZnsisuKAE8r0rSpE3eRK bg6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si18847131plb.69.2019.05.27.05.09.36; Mon, 27 May 2019 05:09:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfE0MHB (ORCPT + 99 others); Mon, 27 May 2019 08:07:01 -0400 Received: from app1.whu.edu.cn ([202.114.64.88]:42472 "EHLO whu.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725943AbfE0MGy (ORCPT ); Mon, 27 May 2019 08:06:54 -0400 Received: from localhost (unknown [111.202.192.3]) by email1 (Coremail) with SMTP id AQBjCgAniKXW0utcGsnjAA--.59650S2; Mon, 27 May 2019 20:06:50 +0800 (CST) From: Peng Wang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Wang Subject: [PATCH] block: use KMEM_CACHE macro Date: Mon, 27 May 2019 20:05:18 +0800 Message-Id: <20190527120518.3703-1-rocking@whu.edu.cn> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQBjCgAniKXW0utcGsnjAA--.59650S2 X-Coremail-Antispam: 1UD129KBjvJXoW7urWfGFy7Cw4rKFWrWr4kZwb_yoW8JF4kpF Z3GFn8Cr1jga1xuFWkAayxZry3Cw4vgF1xWa1Yv34Ykr9rCws2vF1vyr1UZrWxurWfCrW5 Xr48tryrXr1jkFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkm14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6ryU MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_Wr1j6rW3Jr1lIxAIcVC2z280aVAFwI0_Jr0_Gr1l IxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfU0CJPDUUUU X-CM-SenderInfo: qsqrijaqrviiqqxyq4lkxovvfxof0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the preferred KMEM_CACHE helper for brevity. Signed-off-by: Peng Wang --- 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