From patchwork Mon Jun 17 01:28:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 976A014C0 for ; Mon, 17 Jun 2019 01:28:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8785B2880C for ; Mon, 17 Jun 2019 01:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B4DD28807; Mon, 17 Jun 2019 01:28:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27F2028807 for ; Mon, 17 Jun 2019 01:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbfFQB2n (ORCPT ); Sun, 16 Jun 2019 21:28:43 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfFQB2n (ORCPT ); Sun, 16 Jun 2019 21:28:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734923; x=1592270923; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AA2LnVOPOxYe1k/Pufd+B/cqBzOmythSvNDNfOGknn0=; b=ezVUULwjWv/hSJlDlMFykyPy6BzUjisQH9avGGxUTgZ0/5r+2KCexU12 uYdTA/JtMGC4FIvV1Z/zYUP0tr5tfBgHJUOmTBZt72za014162Ct33Hwn LlhMtnZviOEHqZzbUgjdamFDTazFi6l+34TcJ+GE5VK4dwgeFqTwXqvgW N5smyJYlXmI2g3FRXVFMYRGKxlQJ6zIk+dR+BzEIP485R42s4Rpmw9EyY Qyg/ywrbUiKWCA5TsKehpFbrObychGrMmvedA4LB+j7MonPncqjz964wg 0wHcYc3sic3eQVRhVY/JFyHjvCNdE2Xiutol4/iv32l1RwixvzeJbC6nr Q==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362943" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:28:42 +0800 IronPort-SDR: aIBPsXjF4qrgs/AUo1mVZbEE2nM8R4mHGPCjNowDIDKNgNR3jOZltO/TSx1VEVJ3ucCiTD903V CfeWGs9zTEt2A+4jyfs78wv0/L2KK4WLvokvvfQ9tS2t9/XbzXAXVuhS15bo6RWJaZb5uQddR5 WFIx+/bQCCND9l8Hd1GSHOatSYHcHHZ/LRhV5AmMw8Ibz7ybmFIsRJ1VfwXF1L6Ji+iE7Lg7PW 9A0qArmmqf2CvB/tXVWEnrU2TdwsGDDwmucuvtUrn0q2OIlIfgzUGqf2pDil5z4w0sG1SkPOAb gpS4gj/wJwCf1qHH+222W6f5 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:20 -0700 IronPort-SDR: vZG/+aMDeXK4QjVguvCY9Andpcz01RKE5tRvsxPIa52ZyiUUHuPVTEOqVqFmJoGaDZh9NArBYo 4h6Ulq4/l0T1Ls1SY/Bk/8HF90YmM2MXhdHporrF0OUVkvNCighn7lyHqsMGdwNhxZ5E7CNWAk VR/2NmlHNMvlfeyv+fPD9axEOGvjjwznKv858ovqtt+zUKPXOe97BpllpBgv/K8fpiCD90tIW1 WWQcbuABsaBW3smE37sXpz1m297ieYm4W7/vLDEUcKiGmybjDjJOGtUnDVeWR3fof345Agz9FK Ifw= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:28:43 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 1/7] block: add a helper function to read nr_setcs Date: Sun, 16 Jun 2019 18:28:26 -0700 Message-Id: <20190617012832.4311-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces helper function to read the number of sectors from struct block_device->bd_part member. For more details Please refer to the comment in the include/linux/genhd.h for part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- include/linux/blkdev.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 592669bcc536..2ef1de20fd22 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1475,6 +1475,16 @@ static inline void put_dev_sector(Sector p) put_page(p.v); } +/* Helper function to read the bdev->bd_part->nr_sects */ +static inline sector_t bdev_nr_sects(struct block_device *bdev) +{ + sector_t nr_sects; + + nr_sects = part_nr_sects_read(bdev->bd_part); + + return nr_sects; +} + int kblockd_schedule_work(struct work_struct *work); int kblockd_schedule_work_on(int cpu, struct work_struct *work); int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay); From patchwork Mon Jun 17 01:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 111E514C0 for ; Mon, 17 Jun 2019 01:28:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01A3828807 for ; Mon, 17 Jun 2019 01:28:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA3322880D; Mon, 17 Jun 2019 01:28:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97D9E28807 for ; Mon, 17 Jun 2019 01:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727528AbfFQB2r (ORCPT ); Sun, 16 Jun 2019 21:28:47 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfFQB2q (ORCPT ); Sun, 16 Jun 2019 21:28:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734926; x=1592270926; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=R+PqGxeqtQ6qQlCqmBxy6Ky2+ZJ1BGLcrhWr65kK1ko=; b=m10+Nbuzf9ZEnwdiIBUaujQFJY7/eYNaebeBc/962JdjT9aiG1j4gca3 FDz3UQbZqy5cinEP6feA1br9mjkblYNvGTY/i5z+sASy3ORBhWqMcMHs2 ivlnCzvKoWCtM/EXTqE32U2H8D+JfY9DYIbcBu+qLRibwW0sADCDe5sBj x/Iab/S+IJFhbjbXlQQnxL+XeERN8dhgUL64An/XVSXss8P/I1KfQ6Zq1 1eYCpNr0r6rl6HfOzyJq7IL7pQEbsME3YB7fUliL2smXzlDB3XB1eflZo eJH9s07oYIhKMPt84TmYfjcHd5OdiSdWtxoRbW2tyneT+dIDMSpL2px1/ A==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362944" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:28:46 +0800 IronPort-SDR: O1jidwzc4TrTxTF8uM7hCTAbkgG0wlIB5kqXu5WphI0z2ttJ8rBht3Qwv7cng0Z79guaHBgFn8 xWzAa5SX+ebxYfyNlnzpReFjRGGRkBhXt/VI7a04Iy8SAtBQAX2WgXbqanI6SgCm9mtqs6omun 4TTT9fL+plMIOZ/luuPWLDWpz7SB33llC6wjYPyIVIosGrpssAQY1f07lPd/FzI+3zw16yvYIJ 7Z4GSn57Q60d3TsZfQRAZxv739niUIJaNm/ytUIJr+7W4p6Tei73eQMqKPiKERIw0QdF9TDdrB r7KYNZ0BlLIQnojkijIucwSZ Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:23 -0700 IronPort-SDR: XRn28JfatW/CrG2aj6GCIkFawG/X3TvPiaS45UR6r+0wh6pbrhAyDjRJ4Yr7xk6NEEAJlWlPod 4WEpd5B1V8WfMXLCxZj/iLNjxUoA3C5b+1Qm6uSKCp6kHdwx+65awmsBWogo0iMRvzlhkDDvYY QbY2bWSevaTA2unLb8ZMhVwmz64hhVDe7E2cOD8gxKQ00IM4198e0TnoRRB06TPhbGLKqm80BR rcFA/8BKC5AS8SqNLwROjNmKP6iK5ZkJyogPDEYLbE4hieCe9lJaZlDkqBJbe19ewNaCLN7gKN Nvg= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:28:46 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 2/7] blk-zoned: update blkdev_nr_zones() with helper Date: Sun, 16 Jun 2019 18:28:27 -0700 Message-Id: <20190617012832.4311-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_nr_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- block/blk-zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index ae7e91bd0618..5051db35c3fd 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -90,7 +90,7 @@ unsigned int blkdev_nr_zones(struct block_device *bdev) if (!blk_queue_is_zoned(q)) return 0; - return __blkdev_nr_zones(q, bdev->bd_part->nr_sects); + return __blkdev_nr_zones(q, bdev_nr_sects(bdev)); } EXPORT_SYMBOL_GPL(blkdev_nr_zones); From patchwork Mon Jun 17 01:28:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC85C6C5 for ; Mon, 17 Jun 2019 01:28:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDAD928807 for ; Mon, 17 Jun 2019 01:28:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1C9E2880D; Mon, 17 Jun 2019 01:28:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8039E28807 for ; Mon, 17 Jun 2019 01:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbfFQB2u (ORCPT ); Sun, 16 Jun 2019 21:28:50 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727515AbfFQB2t (ORCPT ); Sun, 16 Jun 2019 21:28:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734929; x=1592270929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KhPmEM2AXyHo6PBofKblkM2Y3DIiKG3VMw18OQzTeBk=; b=p/AjXauHmoHQ8GlciRjHf9eduSj09HAoPh/EQe+V0m6pfrQTSkxB5+KH wA+1FrMBNAthC6JVneWExcxE+7xkVS5EpsREPxENXNhP55nfWgu/bJYM2 YAwtvHQlBV6qvHU3zZoCvThR/jMXnzz6+ANTnyq374uE+joWQJ35acuH5 G7Phj2r6a/1yN9wnEzj8wadYkYiPaIx+NiJ1m7spoKDSvzggFnBcJzX80 x1oacLh200Sa9S0e4LhBzdIcZcqeIJCFjLmg/YjGyA5r46fxFmx02QTYZ dRFw2+R2sP0Z4k6v5bD63XiLFNne3hfrnyLK/AfT/90K9Yd02q8FYM6JX A==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362945" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:28:49 +0800 IronPort-SDR: aXZvKjR6SSoiaxdFXxhdqHUTYNO7UkgLUyfHyyhkvUUKagonSaeuQb4Rjn+EWEs4TnU6xjZ3PZ uOEGQ+1GDxk4Sx7i5sk4wFfPg6d8BrOHnLiTKTn7vsryHSqRo/wRTilDXXK+N+tZ9p3ioqtDrH +RhRqHDmmtx2zw0PcNkRgy9BPURsY0bQbpmJ3rwRv1CIZul21k0E8h0SdwUlOdXikI/yYCaO2l rgjoMo3u0r6ko9Efjeu1eJ3PGseUjuqFDNgyHyOZR3OAJoYh18T+uPYqnhUH5y+44GkJR+byEW ufIsGw9zO7jkvD4XIz67Uhr0 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:27 -0700 IronPort-SDR: EoDfZ5yRhfY2S7HtrBxRI1Q1pviY36/tFP7YZzy69c5lph5Vg25HaWLKqm6vdDH2VLA1HakPr2 qBv8h2jsCA6CZUHreZtBaD3cVgRXwGpApkm9mW+p31cheR4jprmPDN2vB8+lcdqxXXQJqyEEF+ YsLoBlPRAZ3dp1Wz+xU323klVGFr+q9LNavWYHRo0ZyjhNR5t8MsNni8M2Y+4m+R90nEA6XgV+ UW/YhCevq9Pjn2FSCt3pLrM6RnvxpS7NrryGUYwwqJ3mnOFOIcShRqWb9el61hcvQGYDIlEAN3 HKc= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:28:49 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 3/7] blk-zoned: update blkdev_report_zone() with helper Date: Sun, 16 Jun 2019 18:28:28 -0700 Message-Id: <20190617012832.4311-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_report_zone(s)() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- block/blk-zoned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 5051db35c3fd..9faf4488339d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -106,7 +106,7 @@ static bool blkdev_report_zone(struct block_device *bdev, struct blk_zone *rep) return false; rep->start -= offset; - if (rep->start + rep->len > bdev->bd_part->nr_sects) + if (rep->start + rep->len > bdev_nr_sects(bdev)) return false; if (rep->type == BLK_ZONE_TYPE_CONVENTIONAL) @@ -176,13 +176,13 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector, if (WARN_ON_ONCE(!bdev->bd_disk->fops->report_zones)) return -EOPNOTSUPP; - if (!*nr_zones || sector >= bdev->bd_part->nr_sects) { + if (!*nr_zones || sector >= bdev_nr_sects(bdev)) { *nr_zones = 0; return 0; } nrz = min(*nr_zones, - __blkdev_nr_zones(q, bdev->bd_part->nr_sects - sector)); + __blkdev_nr_zones(q, bdev_nr_sects(bdev) - sector)); ret = blk_report_zones(bdev->bd_disk, get_start_sect(bdev) + sector, zones, &nrz, gfp_mask); if (ret) From patchwork Mon Jun 17 01:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82A8B14C0 for ; Mon, 17 Jun 2019 01:28:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7437628807 for ; Mon, 17 Jun 2019 01:28:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 684352880D; Mon, 17 Jun 2019 01:28:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C0A228807 for ; Mon, 17 Jun 2019 01:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727534AbfFQB2x (ORCPT ); Sun, 16 Jun 2019 21:28:53 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727515AbfFQB2x (ORCPT ); Sun, 16 Jun 2019 21:28:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734932; x=1592270932; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w3BrX382ONqjIyv6voYA3PkjU3CP+ICuSqh91zwGnoI=; b=KXTMPM8glMlNioM4uR4HZAE/K/6umkIQu2hHYPSjkuhYxQW8wIOLXcWj 2Mh3R2nMfhFv+ypjD5+2NMjq9sD9DSqVsQooV8cps9CGmQyu+waSx0vRn 0Rk/zrM9hnOW4AdB5DX4wmB8B6YlbVB7SC4ERr9AOik0wUnD0EjaVRqYG Zini6D1Lb+xbn96lXLgyD6NJ0tC4EE8qVBMZisCmTL1NdfpM/3RzY2Zy7 3VRLj8k/udhd2+8/ItdujIG3Rhz09xkjXw1CpXFTx6VodnsBuKgjYRQId sZMM7uZL2+cU8x1ui/hsOqcAvl5+GJ2gRczZLhrjpJpuTLVw2IsJSTfaI A==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362947" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:28:52 +0800 IronPort-SDR: +p6jlVWxPMzC3aaKtaO5HCUCkJVzFk14K3BqZeyg+kNORoCv/hGlyQKYQt9lv+TbnJBVJy8D3T PbCVyWXcUcJWFGzPm/J9GYJvRHUh8bfv2qPLnvZhkJGUgB+fuFUZBJK52jnfAHL67ikCZ3anPK Xt+ciGdiBhWe17ZLVVhxp/+9omneQCgyoSGmt3zN4phlU8o/iM7m37aThvQSvRRi6kZX5nV/GU X84ZVJwmCQEToX56vKt7lEG+GgDDSax4YlUhicbdLdh8W0AMFjdSflaWWR5ET6X9q5W+zvvbvj xXIeZed+wTq4BuHpcjuRHJrj Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:30 -0700 IronPort-SDR: IfovImoA+4EY5/NblvO2tIpoYAEUdMS5cjLbSWsTG6tAM/VwLo4pRUOFcJlpG1M1X/s1KRZvCc FViDhiB5ulqJYx3EvhpAXPb9LF3ewt89KWiCdN5NjmW+bRtnfSJeIh0gIQo28U4Ic6Cb/IBev0 DiRwNG+TRVQl1Pdgdnn1DGg5I2c29KacTy97iYofsoKE/E3rgP/CNSWvDFR65nuOJUCz9zYGf6 4efGNV5Ug0ftnrfoPQGSHrqcqlQwn/7qMh053FnmHg/zTZc13jaG39OLZOhAai1RA5ZSVeD55T 0Co= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:28:52 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 4/7] blk-zoned: update blkdev_reset_zones() with helper Date: Sun, 16 Jun 2019 18:28:29 -0700 Message-Id: <20190617012832.4311-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_reset_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- block/blk-zoned.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 9faf4488339d..e7f2874b5d37 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -229,7 +229,7 @@ int blkdev_reset_zones(struct block_device *bdev, if (bdev_read_only(bdev)) return -EPERM; - if (!nr_sectors || end_sector > bdev->bd_part->nr_sects) + if (!nr_sectors || end_sector > bdev_nr_sects(bdev)) /* Out of range */ return -EINVAL; @@ -239,7 +239,7 @@ int blkdev_reset_zones(struct block_device *bdev, return -EINVAL; if ((nr_sectors & (zone_sectors - 1)) && - end_sector != bdev->bd_part->nr_sects) + end_sector != bdev_nr_sects(bdev)) return -EINVAL; blk_start_plug(&plug); From patchwork Mon Jun 17 01:28:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDFB914C0 for ; Mon, 17 Jun 2019 01:28:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE56F28807 for ; Mon, 17 Jun 2019 01:28:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2AC82880D; Mon, 17 Jun 2019 01:28:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7030F28807 for ; Mon, 17 Jun 2019 01:28:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727536AbfFQB24 (ORCPT ); Sun, 16 Jun 2019 21:28:56 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727515AbfFQB24 (ORCPT ); Sun, 16 Jun 2019 21:28:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734936; x=1592270936; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Po0y7wi7jBwNRRxhDvOMwQBHOw0QeZhHy5S/KsHyCxI=; b=mEOK4UB2YBaizUvcS7Mgx5BIGPCH+4LAXKyfKeL54aefhMl7q+mJX7Rz NHi9l/Q7YjJHKjcchqZPg8ExIbJ3XtICvKN5uE7qSXIlzpQErkq1xcOZo q+dnsMm3NMsj4ZLsp33gbxMWGWUW+9GgLZG7ru/AniAHMgA566a6geboc EHnQoADTSEN8Q0lCKVX2Ut0d8jXvQPkfmWWLrFiWD4L8+HAO2fWxrd260 VLSbQ18Jpw95mSQPqUhMUI8mmsifB4qOdp+aupQTe/56F0sYtYKasAHc1 ZYEO9YBDuPfaGfIj7MKtW9wcrXmxUhnCC4b8PtkIFV78y2L9LShb/eQul w==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362951" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:28:55 +0800 IronPort-SDR: E/Ud+an33LhPCR7Yzf3N/3jEkjaZFxxpYEH+KzHtgDeS1JAnepxlHWKq4ftn0eSZFo9zCIr7Lp tPkyI+6xXJoggT1tEbqmKhAvL+iyjmFrSXmUkceGrR4KsFgR8y/iYeswXHviTx4xAl0t9y303J /MaPaXeE/r25U4fBRcfxDHeVFsUe8AiGlv94AbBmgs1BGnGyusSNqFgoydUmGRbkrf4QvaOpVW bxIYjUs41zQRsXnYAawR9mcWw/yqKy4aJ6XKeW2c0ZBlRQS3F83RqJMdPs6uWbAyu0c3Ytyp3+ crt5/QaGGM68jvqqK/HqS4LY Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:33 -0700 IronPort-SDR: wpns3c4kKsnbhvcIRUAjqJE/TCZH+cA8O1jQ7RcEkN05WL4rNnDu7rMopee44SQ5O1H1L2+GOS OqRwdB8hxq5Qyn6TyFUWVupa6coyBVcNxRrl/zn8tiPH/D8q0vjND/Go7pte1rs5njH9H/6lms TY66eCzLUPXXhI1Tlu8yvcEHUPx+HwupofYw7KvQpRewyd2yKBkXuy68ySB7yirt9KhTi3GySa 8jmgyn81krAdGXQmqyX4eWNC5ye84nFNM3ucQVmW44+QnUgKJ32bcYDGsLgHMX5cxYmaR6+Z1j /EY= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:28:56 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 5/7] bcache: update cached_dev_init() with helper Date: Sun, 16 Jun 2019 18:28:30 -0700 Message-Id: <20190617012832.4311-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the bcache when initializing the device we don't actually use any sort of locking when reading the number of sectors from the part. This patch updates the cached_dev_init() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni Acked-by: Coly Li --- drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 1b63ac876169..6a29ba89dae1 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1263,7 +1263,7 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size) q->limits.raid_partial_stripes_expensive; ret = bcache_device_init(&dc->disk, block_size, - dc->bdev->bd_part->nr_sects - dc->sb.data_offset); + bdev_nr_sects(dc->bdev) - dc->sb.data_offset); if (ret) return ret; From patchwork Mon Jun 17 01:28:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 793C46C5 for ; Mon, 17 Jun 2019 01:29:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BA1628807 for ; Mon, 17 Jun 2019 01:29:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6021A2880D; Mon, 17 Jun 2019 01:29:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB77828807 for ; Mon, 17 Jun 2019 01:28:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727544AbfFQB27 (ORCPT ); Sun, 16 Jun 2019 21:28:59 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727515AbfFQB27 (ORCPT ); Sun, 16 Jun 2019 21:28:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734939; x=1592270939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=K29XvBy1OHbhlx9Frdz6GnWtW7nW03odbyP22pCCTYs=; b=Hmiz89On8LA3/dwvVhZOxwvPTFAT6Us2TlX6BFv1mr+40xgwV1ND1oC0 wGyqwSebp9nX1RcIoV4ca17mx6Mj7ApeF/USvOeW8iLDU2zqztNzFZ86Y Wff3eOxrOODoYe7DuZby4drfKyMlwQ/l5wCeF1vIgxH8+OxmleXQpux9k M2ZC3b6cUCWXela/CCF+2fkNRhILKoL1NpqM2t7eRio3KzCSC746Se8AQ 5V3jRCxT65cyTOUGeZYCe7NmO9f7vVhU9R2UtbchVeBsQBvokxl8J0WqF foZSdjHFdjW3tYIbmQ+F/EXNRxRFuVnZKd+6LuCAQUlsqAJKrxa5CuehJ g==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362952" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:28:59 +0800 IronPort-SDR: tBwixJBN+DwVwWGvSh2gjOX0vMPu1LdRtTaJwOSdb92nn5NPkbniUOmdxkblzZkJpZXOHevbqr ocnY7mU0kI1+e1sWIo8Vl6PaDJWFofgxfKkcnJRxAn80jv2VXgMUwLIyvz73cakmDkDWd9jF91 DQGrnEWl5HnEcA1UzocTnJHwwdTth1FlfANf+IuEeXX5ytiXPCUBARlJxboOb6Cpcn3LrWvhI4 T530akYmsU/LV3e7PxdEBxtm54dkYLc4SrETYz8llP+8AKi0GK2/foqDhluno4e1YgmQsogdLn mBieyRqJ6nCUdLMZBfNPyZbX Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:36 -0700 IronPort-SDR: CruxJP3S1RgdTPbb+j4RhagDod8aT0DppNlv7Hc4gJ6nlkYw1OV/BFMaiTqoaKy7B9Q75ko5dI MdnI/+GVbrgrK2Dx2o7t6EjrDbUl1czNu7z6Nx/4p/lk4XweJTtsW9qja9mPCh+E4Qjmyca9nk c/nulsNngUm3vS0Kr493ZqMC9/Bq9KKtI6Az1bEDJDuOvI/VPGL5iE1YUuAcPEa8+faIKcwjJY 0OFsd9IkEEMkgqSZLSBGE3cOughgybztTr+uLQn0lA5/FQzYCynNImOzNzjGCYIEKrTWJVcVhQ PhI= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:28:59 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 6/7] f2fs: use helper in init_blkz_info() Date: Sun, 16 Jun 2019 18:28:31 -0700 Message-Id: <20190617012832.4311-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the init_blkz_info() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6b959bbb336a..24e2848afcf5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2798,7 +2798,7 @@ static int init_percpu_info(struct f2fs_sb_info *sbi) static int init_blkz_info(struct f2fs_sb_info *sbi, int devi) { struct block_device *bdev = FDEV(devi).bdev; - sector_t nr_sectors = bdev->bd_part->nr_sects; + sector_t nr_sectors = bdev_nr_sects(bdev); sector_t sector = 0; struct blk_zone *zones; unsigned int i, nr_zones; From patchwork Mon Jun 17 01:28:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10997727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4351E14C0 for ; Mon, 17 Jun 2019 01:29:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 348A828807 for ; Mon, 17 Jun 2019 01:29:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 272FA2880D; Mon, 17 Jun 2019 01:29:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D305B28807 for ; Mon, 17 Jun 2019 01:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727546AbfFQB3C (ORCPT ); Sun, 16 Jun 2019 21:29:02 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7477 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727515AbfFQB3C (ORCPT ); Sun, 16 Jun 2019 21:29:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560734942; x=1592270942; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bpSg/6/49xNUBvpHkr4oWgwqbw2GWcRonP8ByaQaYRc=; b=B2oyxpz6gwOOQLBrlNZ1gojNHwqFNd2iHmY98znGJaWLu+4xlFcbcCDm RlUnbpKkfw+6XUomf9De/uyHEmfVfdiwZWsz+h32natljayxdNRPAJxlq 7SDSCJqjAzcjChJVZklT160z4W0Awe0V/YZa82QkcN/679mVkzqznCRZJ EccUYRK3e4QBt6olyXwTlGaQdtR+9MU+4FT2eIF68yY5NmAo+FHtFSzkP c97H7RdzyZkBAaAhTE8El18LObWfKwdbRzEjTwpWdjnff0WKEVJeyYfou Ri7jyVl6RT3MiwNx8o/REDlRvFSgQiL3985OyNnQLwdTwcsq9zGTRDP8+ g==; X-IronPort-AV: E=Sophos;i="5.63,383,1557158400"; d="scan'208";a="112362953" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jun 2019 09:29:02 +0800 IronPort-SDR: At7ItvQq1IPi6N0np3nZKmFV/i9wbGZg6GRwMolTmGUJYlpHpKQwz/XPHOYHrMlHxo37FA4aBc magsLinxSZ75Yxxw7jrjgMqMLhEJz+1NIkv2I8Ykr+UQHpq7lmG8nzKAnf+HHeQ1CU+0casNAk 3D1Ygpt69cqpVjg9ePlxypwPVh//80l4lNRssbYGA18xnjABzPmmOKKA9mHbgZkuYQACQ1isEj qB4h6nHN03gCRMJWn8Y83DAsxYGNwdx7UtkvIR/qiLi+zHkXbHrVQx0Xr5WbafKvy8z/bE+FQ8 U0uo5VwzruRfWkUiLHQQpKz4 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jun 2019 18:28:39 -0700 IronPort-SDR: uW6g7HlljLGkgBxVb/4abf8Z+A1KdrYyWzlLDdR8gSIYP2vTFx8PAE4GFYBOpJQ4Co45JacDDR 0J8woBye2Y3vs/PlOBBplYJB/q0op4ANl+Bf4YABXQLNIY/wsp+EpgQ7WrRkKWgm6iiKte6YFy 5wYjVRKmEDzvVMJMM4eE6EgtrRAIhOxrCZuQaZAeXRzwzTimWPvyH5mxJq8TNMqFBjpKbYF4Ll 5C9E1Kzen6V77Ow/YU3nHFT1NOKoo6Pk7mXUa4d+3ggR/eLejDmSIWkT9mjv2MnMU2uNdBrjAy uEk= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 16 Jun 2019 18:29:02 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V2 7/7] blktrace: use helper in blk_trace_setup_lba() Date: Sun, 16 Jun 2019 18:28:32 -0700 Message-Id: <20190617012832.4311-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> References: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blk_trace_setup_lba() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- kernel/trace/blktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index e1c6d79fb4cc..35ff49503b85 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -461,7 +461,7 @@ static void blk_trace_setup_lba(struct blk_trace *bt, if (part) { bt->start_lba = part->start_sect; - bt->end_lba = part->start_sect + part->nr_sects; + bt->end_lba = part->start_sect + bdev_nr_sects(bdev); } else { bt->start_lba = 0; bt->end_lba = -1ULL;