From patchwork Tue Jul 2 17:42: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: 11028433 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 431C914F6 for ; Tue, 2 Jul 2019 17:42:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EA9F288DC for ; Tue, 2 Jul 2019 17:42:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22AE82892A; Tue, 2 Jul 2019 17:42:49 +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=unavailable 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 CD359288DC for ; Tue, 2 Jul 2019 17:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbfGBRmr (ORCPT ); Tue, 2 Jul 2019 13:42:47 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:61910 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRmr (ORCPT ); Tue, 2 Jul 2019 13:42:47 -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=1562089367; x=1593625367; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=nzpq2q6z+7BZy2jXxkdotmkGvF20O6oeceGehTa8YQ8=; b=aZMZtH1m5/y+e/PLk/YP39cvhrVB6sYhlC1sBM8KllwtnFeulHnkQgm7 x6Bc9EL37GeL+WzLi42DojhAHbxAk1/ju4HDovdutdOsh4XNEfJ+VFW4D lGOuCeiwT/kwNE6r6124LygxEGL7///QaXv5SJRCm/M3YeeqilZB7t1Yu Pt/wO1RnpSXR2VqyANWkA9idYpoMVsbpWx/MZ2K0XcDHLcDLzDjBu8etn rt7qICFdZl4LIVbsGyJO2jnb/uN40Tmr2j0BK9RBaa2CZEgh0CC8mBJlA zgps7nQ02EtXZT73A9/lMOaZCsOtj45VotVxpqvMDC/iAey9eNgg6+smY g==; IronPort-SDR: Oy4Zl8QMOfc/k/Cx6aM0x2pnKsYS2V1vubdE0Qp/8w5ZGIGLd9gWBXF0VUsAMaZs04wlGm8AM/ J58rcXW2pNqFJ94OrNgilXlPlexRH2LzxW8RiVvuCQ0BI3ckvL6Vq0gC/4GF5Busu510C0bQLv F24sNqrnX7TZCV/rYrf6QONmoHQCZ33UokRSZrsxL1mwJEiHX/gzuy9NcgLJs08UkxU20PrXEK XqLOW8DzrIr4iZMstWSmDIMN+Sw1tMucdm924ols3UE5I7HTEmH2diRglgg1Flocv1ZTyd5r9/ 6Sw= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="218459985" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:42:46 +0800 IronPort-SDR: Q/SWneQRO+khQugUQFMfLWZg/bBhGqi9xi/zEplVramdjZPfPn3602ZfEUZYN2H6D7GOgwhhM7 CMIUjd7LVhunUl9b6bfHauqHZ4PpvRAHcZ0btgyL5s1mKYCILaAkA+LScYV1yFr+qCY3FUZDcY uZvfmTemxc5rGqt8jg0HIfrJp0/H6y4PYcdxtGbd4zQ5q94rBEDjyLGfc9moLaf8DnB1IPrWmx PZXxp14dRpWuGHjbbJgd0EWGrjjCzo+fziSFJ6/Pfa64L9/IgrEUFXe+94WKazzgkAmQol0UW3 7J+fFOIjBUJhMQ19CMaqXbOF Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 02 Jul 2019 10:41:48 -0700 IronPort-SDR: PULQy2lnpUjzZmGu5JhOPM0yZ067ec9EuCSAYxpuoeel4NTIXUCfgyS4rhbF25Q7yRUqnKjJjO CP1MdvtMJIn2BUXo8nmrX5ayVwfG45PvBnj1Se1hmqO/H2IJqLy+IP8Kg2K+s2Xj+EgkZWW02g anJeJj1nyY5U/2ClaYOMcnAe03Lwy49+x9vakB7tPIjcZZdty/SvzK2wSsXbiK+BxED3VRniEP eYYWAlSc535zS92ZL8AaU3F97Xew5XRNC2UFo/huZ0jIVGZ/OGA+nQC4AFOvTDhTQ795+4uCYY dd0= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:42:45 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 1/9] block: add a helper function to read nr_setcs Date: Tue, 2 Jul 2019 10:42:27 -0700 Message-Id: <20190702174236.3332-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 Reviewed-by: Minwoo Im --- include/linux/blkdev.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 592669bcc536..be7ee5a0b0dd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1475,6 +1475,12 @@ 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) +{ + return part_nr_sects_read(bdev->bd_part); +} + 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 Tue Jul 2 17:42: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: 11028439 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 125B614F6 for ; Tue, 2 Jul 2019 17:42:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF852288DC for ; Tue, 2 Jul 2019 17:42:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E311A2892E; Tue, 2 Jul 2019 17:42:55 +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=unavailable 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 A2B2828917 for ; Tue, 2 Jul 2019 17:42:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfGBRmz (ORCPT ); Tue, 2 Jul 2019 13:42:55 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:57058 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRmy (ORCPT ); Tue, 2 Jul 2019 13:42:54 -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=1562089375; x=1593625375; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=R+PqGxeqtQ6qQlCqmBxy6Ky2+ZJ1BGLcrhWr65kK1ko=; b=Nk0MmSHvjecX3Dg0MS9g5MxEQO8YIvrC1HUmc5u80UNcdYLvowX41r// B0qbrsRxY1rvcMnGcxtcYWhqj9Dg17KtyY3ZWluLmNrMUJmd/qUd5wSH+ R+zm6545AHu5VgHTfiMJ+NBHtH/X9AAaCJKHqTo5QEL46moO5i+HLHQqX XAWLNiwfrdFqa1/NzXebO512TdFqQ8YIx1E9wMjR4V/61LZeZIjVe+SRY 2+dmsG0WoqMgU5gq/LBvQWy8ibN/rR4fo3IuC1T6WPQFgV+RkHS+sXk8X X/u4qgIFKwx/sMSj4WP0ByGa+B7HTLPoLI+bMUy3okMCXgFhOeVXz8/Kg A==; IronPort-SDR: IDGft9eKMXwgXRA9P3Dq6/291xeROOric5MHVIdOyKt5SfnL7wJzwdNefmbLmZs7Cpk+7IbkAI R/soPCR7FPAWfp3J/VagPWYzN9DgsSu43SzGKiWXE45KE0NV8+KV3PFgdFzRFTjO+kvVuoVJen AwWx/i030+GqaBKNVdGASVgOWjNMG1ZcTh4nhjDWRfYIU81DfkBR+SVqSSKM3VQ0ejV/Vj69qR L5TADGeUJmCrh0wvSEwuxTWL/oLV3zJ7DZAILlAyg5xHvvBv+EpICM0eIvujT499z9UbwcE7qO 0H0= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="113269817" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:42:55 +0800 IronPort-SDR: lmuBmyIRvo9NeemR/f16gCh9AsIDPgtmbZob1S8+gONIM9POu0jxc2FXDTXf2L2gVzvbaSQn4U UkWUmfUKT554L65RZ4KD0UJ7rdcy4qnD0PEvEdWH3yjLXBK6CxtRS+7rXu0NvvG3OE+vY6bTnY buUL9ab0LgPukoze1DZVXqH5lUt+XxF7ydeS6oMVcUVe/7GVAotigC1/EfyXyUQJypNLX3Qheu /lrf6lPgnj3zz5/YwSgXbo87hKGhxy8cSXpSjC5RB9/JBq6r875mTNvqht0MUfXunGI5Wzo/7n lrYm4GeMQtwx8SgRCMPnECLS Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 02 Jul 2019 10:41:56 -0700 IronPort-SDR: G/uLmRGIhR1LMbBkSR/mZvxOZKkvqJRNN5K3dh9qNmMM1fa2KZc+jFQU7q7JOv6WNW6g48l0Kn 5v4QxUuHBwr5SzPEAtkc7OyRSK3XTRauZGm59j5ahpw5wmr6DYzqxjFPVdJrrQidjtsBYyV0uM yF9FYqoQuzI3uhdGfMdue9EbSVG3fRedIz8rowF8JYCI1n/lvifOaIQVoyvpk1+8dBIPd3rMmT MA2y2MtsCtTSTxq5XBpfxTUQW0NqoTMAaz3gHx+pwkKc4o/2IB/j6m8UfbKqKaS/cMputBrwok 22Q= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:42:53 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper Date: Tue, 2 Jul 2019 10:42:28 -0700 Message-Id: <20190702174236.3332-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 Reviewed-by: Minwoo Im --- 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 Tue Jul 2 17:42: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: 11028443 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 36A7C112C for ; Tue, 2 Jul 2019 17:43:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21B4F288DC for ; Tue, 2 Jul 2019 17:43:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 162CD28927; Tue, 2 Jul 2019 17:43:06 +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=unavailable 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 F1C08288DC for ; Tue, 2 Jul 2019 17:43:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbfGBRnD (ORCPT ); Tue, 2 Jul 2019 13:43:03 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:35981 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRnD (ORCPT ); Tue, 2 Jul 2019 13:43:03 -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=1562089383; x=1593625383; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=KhPmEM2AXyHo6PBofKblkM2Y3DIiKG3VMw18OQzTeBk=; b=Ug4TLqxC0KGVG08uDgbCrr0hexkMv+2w6c9iobsMfSX4QGa8UrH7CrhD jfHtfuh0BBR42AWQHfvywigpYiZ7ptFqL8LLwIfWLjqbbE8M94lPrZd/J ib/SjfRnoC/tpFVfFF1BV0GFDOtwESfLSNJmr/EtXlMJdVMca7MkK7Wur 1Ukc0UMYAIBo38qxHoNjsR6mAOxf1bigGMSGkOlrNw7nqC0UUEoZEIQM3 iVdssbQsigrUSH+wmGhEXhRu6M5JBeD4/SpW7C1sWPyijtaqs82cCoO+J RJxwGI6nRZRmPbaqqv82F3zBOCAJVXElqCa2ok7eHUAXXtfCo/2s/fRvf w==; IronPort-SDR: Yjl9CEGFlkZmOZDGAJ6xa26XG05CCTsozXp47lNOPXuOdX9nVsmLVl2//7kZQSE1CeVVrrpTPX mBDyVf2mWrkH3+WvTgO+gjzB12XV5e8/M2U9o6pOd3s1dq30PfFs73c05JKdghRdc3uv4D6Ulc aNRcKJopq7vMx+7V0jz/ju9/lMqHNiXnUuC4GwhVONXfvfagfFHIrgdNAwdwlLcMvNsIwl5dfF OA/ijN1vx/nPPCgjHqdtuJteWw5S6z9l4sEyy9Kn28A2FDboiSxr5c3yHh6aJPelty0Jbfgi9N TTQ= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="112068337" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:43:03 +0800 IronPort-SDR: fNa+i1iDFsNKXiyxjUp+ceLJnaKP5KTzBav/XIz9Q8xbn73GG8hrVSNxAjzHYVcd0rkcCJxFcW kes2Mqb5NEbtIDxT5SNeFQRm3BiKD5oSpr8hvvW2v1qo3dMTRAgc0qMtuK0Kcf3S+I+ZDD6aFR tzss84GsayDNozEoaqBvfG8A9M1qlAhMetKgqKHPvsogAWwngjHCKzZONVqupRHv2g0QvbDWv1 BnDU61wfFBXQ44/DDDTwP8yYuqOQNvp98kSsK9jBBQfiW8NaEnOZNv1Ja0KcDcAmfhDWfzoave EJ8SgroiDx4vzR527pHVaZG4 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 02 Jul 2019 10:42:05 -0700 IronPort-SDR: 6aWxaTBrk+Kvq4wIRr/d70nXsFtKx/h2jTgYTYDzRuzGUwI1dcEHM6gt3ZHnktHhEjb4/JCped 7e+xcGWb4ezwmmGHsb8fy4es9zxYPMfyLKqFtHBs89QcpmRPHcClv/6L9uTwE25km1MSTeHUNh QXgH2y1PN79zjwD/6RQNH5TySuXd3fIM+krOne5dzLallo/yzl5xKvgKrBEtFd2qULXFTmMcoJ 4llbiUV8AaOXSwXTCZ4YfFaNEH7P4FlfrSIC/kH4vx7TiGF3X84yZ+VK0d22WjDH7jZa8SWEP6 qVo= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43: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, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() with helper Date: Tue, 2 Jul 2019 10:42:29 -0700 Message-Id: <20190702174236.3332-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 Reviewed-by: Minwoo Im --- 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 Tue Jul 2 17:42: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: 11028447 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 8FC8E18E8 for ; Tue, 2 Jul 2019 17:43:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AD23288DC for ; Tue, 2 Jul 2019 17:43:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C31528917; Tue, 2 Jul 2019 17:43:14 +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=unavailable 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 27A0E2892A for ; Tue, 2 Jul 2019 17:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbfGBRnN (ORCPT ); Tue, 2 Jul 2019 13:43:13 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:21381 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRnN (ORCPT ); Tue, 2 Jul 2019 13:43:13 -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=1562089393; x=1593625393; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=w3BrX382ONqjIyv6voYA3PkjU3CP+ICuSqh91zwGnoI=; b=d2XsBQObSu2aqhe0KXX8g4JZ00dUjCzRB4d4cOeK6Joa7WddQ4tHLRRe uhtvKFx/h8CrkrV58RauT77oXlGK4uf2yI/r6SdaNDpR5ax8tN9qH9lbQ z9H/k+dZcfK0GFTvs1c719MkEHP29kzq4dNXi2+TgcPlA8bqCjwXMKaa7 Ah1wzRXhgnKep2ZdDq9FqRbXf8RQnl9UXoEEgjoDP+RE5yRXcdJ28NqD0 /q+wclz4g3nNslG1FTrULdcLzOaqWQ9B6hjDogkofimh+RC68PiZCBQ5k JsN0bDdVAfzXxmtXAj/nsKR8S9KVsWZd+jMgCJFCswfIPrRm739hMLO1K w==; IronPort-SDR: kQHWdR6+BzXWiMW45h0wwNnqiKWik8ExH/krQ93rCqgbX8JJDEKiY+6HcOGSX9KhDZ2y2HGaba KWgHlN8QOpzyhUsRnXpJbcIK3SEdUJ0031yFZDJZKhEfsEdgGQKccGoMLlCO6KxUI3cjTBVsqY PA1p6w6MtnICQT2RttMX1pn8gHIeFwRXUmG6eJkZKx/oyrY+OdEqOgylVxSJhew7s9182o6CUf HfXgBQ/4T+godoXJiYLsoyng/yLLswPW9H/q01zNfWxv24zvDd1ADs85qN1PeT7ZorX04mxShP WY8= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="113690575" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:43:13 +0800 IronPort-SDR: wv0T8P+g9Sk6hQpSfIyh4vRWZSmesrOA6O5zLHDLHCABJpMYxI1Uf1nOFyMLolISxYeNFdn15H ftCsHuPzKDaZXsUTIVmoAjHk+1gyX7iXFJVyd/dFbhS4aTgx5MWEeZryQttKO2WmT6eDYmxUZX aZ4AbF6HYQBtKNoF2Y9NvWQFSYvkgGE5j5wBz06Q7T1aYzpRByeff+F6o1MwluI3n7AZmtHu2F FJJqOX6He5GO2d3eT6LwOn4H+EcuFPZgXUmguLJK1oTgfDHaoHIrTq+qlNzu1jfVCOlB4Vb/Qq VKFGVDXAmQW0TJLjZzYxSrrj Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 02 Jul 2019 10:42:14 -0700 IronPort-SDR: bTE73XoebtSY9BFEdgIbFq66JMRK553Gy4nlPM/489RzJLQKSuFC647ZNCgK6Pe5K2acESKa/v GSyMegt22LTGo7l8BRZPNNAHwyUWFfcwLZUe3SLCb0DC8tf1ksFmAOjIdeAxS0flNdl1Vpk0Gh lMrR6oroo8tPU1xiW0Zj+Yxt+Jry2cgDdCY4nPBcevgpALqZulp9n3CuGosdEVbiHNDUItK2WP v3BZh8J6bSN6Ou8vYXB9xka6wKDRw21EZx8JHyPMbb3NO9B1CD5BW+/c8McPByloJrrt7CVnbS N1c= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43:12 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() with helper Date: Tue, 2 Jul 2019 10:42:30 -0700 Message-Id: <20190702174236.3332-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 Reviewed-by: Minwoo Im --- 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 Tue Jul 2 17:42: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: 11028455 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 393CE14F6 for ; Tue, 2 Jul 2019 17:43:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24266288DC for ; Tue, 2 Jul 2019 17:43:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17C4A28927; Tue, 2 Jul 2019 17:43:28 +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=unavailable 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 C8862288DC for ; Tue, 2 Jul 2019 17:43:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfGBRn0 (ORCPT ); Tue, 2 Jul 2019 13:43:26 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:44393 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRn0 (ORCPT ); Tue, 2 Jul 2019 13:43:26 -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=1562089413; x=1593625413; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=0UgEtdIHm7+hH9Kxhy5WBonEw4nU5YoTIqQ0fdsN3UA=; b=Gb4DRtMFp+7RK6GLHSNHT0I15Ks//drFAa7QzkRpOohsy0Y2ZUbQvc2z Fr/AN6nL7UzIzhX1458xtHg2dJJVhN+a/heSkCv5q8Or5ZQ2LTCnpVjBx UHJLTCjMkzg/QD0/99oHme2jlcerFClyrh54HFaLUHJlmamFGgjvkNi68 T7Uu333MHKe0bpVFf8j+pC83UZcneoVwD8hYCiAp5B7l7+ULU5lJZqWiG fnZ3JgK0wNIpkrgN9HNrvW0vCr1AVQzPNdvvYXB53RzVrEUYt0XYHX2sX CQZ5Au/uQjpMyRQSXwtUYIzZVHnB0Sv+aWGk7jQ/HYNSZtNARvvL+a5V4 Q==; IronPort-SDR: cQGl3onIsKgOaFWG5QQGZxYIn913GUmhqzikVcaua/5MTFppHifeBPHm/HlNaL3pQbPzdogZS+ 4PDA0rkzTi4urfca8GGBrre215S+vxFuLPm19Z/ywrgQSx5TY0nhU7y292yaYC8tDWGAMXVftJ pFjrTpsTTALtv/GmSIujviE5zG74w9OtTWz6VsQ8kncIJrBj1zR77X7uhhhNLuBNv/dQoAaaSL aoep0K4a+mY3F/0OXqI3T4uAjid1JGgNTK0YiD3U51JsWDGRWnZqeAqYdsWq41rm/UPlGFw4G5 NgQ= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="211924202" 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; 03 Jul 2019 01:43:25 +0800 IronPort-SDR: y/WW7D0ePeoNzW9UBvybMDTdufz6d/iSI7Ekqy/GyqmaArQU32jd2ycYnRYrZhkMiugoWPkRQv YANAG9ljgWU+rSUjrSbQT3uSIAEcgzGRCzuYF1S5eAsCPMxtU2CEXrF3eqMcsbDUU5X044pTju bJxqPBoLfevzTEVLWzsYby3k9vrPkczjAHsHDp9Ih2lCs9f9/JwJ0i7scrC4mMqPfzklx7RWIn ZF3YutXnNwtv+Cl+vg4eTku89DcpbuKei9AkILy/JcN/ztTqOWapx1AI2UFYPFn542/WWR6qPP zzNFSayvBtZftOxDMGpZuaNF Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 02 Jul 2019 10:42:20 -0700 IronPort-SDR: dsdfrG+O+D0YYUKDQmR4iE3UN3zVh/hsdwUfa6x7YhTtUiGIL8CpmfkBwMDTgt0WzdLK9m8IAG jYsHWpvDyzppL1pgzcvOiz9dvRaFzp+UV4DGE2Qj6epyYaGFA0N+k406z9PObsn/0+cPUjLQ/X WE1E455mHT1sBW+V63HZhc7EKmX80L5NAxQo4WHs+RnjTp6Exnns3m6jjZroXcgog5MKSTbJER ZZjwX0UI2MDh6Rwc5quokKaI99tN9VzJI2KH+raddvpBf/NohnJUIwwJVnZcacJhGyuYPLliiT GoM= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43:20 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 5/9] bcache: update cached_dev_init() with helper Date: Tue, 2 Jul 2019 10:42:31 -0700 Message-Id: <20190702174236.3332-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 cached 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(). Acked-by: Coly Li Signed-off-by: Chaitanya Kulkarni --- 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 Tue Jul 2 17:42: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: 11028457 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 9AF2314F6 for ; Tue, 2 Jul 2019 17:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 811AA288DC for ; Tue, 2 Jul 2019 17:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 752ED2892A; Tue, 2 Jul 2019 17:43:31 +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 23DAE288DC for ; Tue, 2 Jul 2019 17:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbfGBRna (ORCPT ); Tue, 2 Jul 2019 13:43:30 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:21415 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRna (ORCPT ); Tue, 2 Jul 2019 13:43:30 -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=1562089410; x=1593625410; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QJX4vVEET/cgf8iBmo/HOlI2NJ0ZitkZSdSK+c4gaYI=; b=Ds9yEL1m57Tp/N9JW6/jKMUOimCqaSTSztTJjgCBLNCojecV3rBS+Y0p dhbSP1o/kd1LnVpYvTJ9GEXwwcRZ04EFQP72BldfhJdLxYQYX1h5qW2HX GtSyrBEfMuXSFFRz3D4xZUKW6RPiW8aj7igHGPB4+f9jV11J+wA5yzt86 m3kBByZ0TKbpt0LYmwul9gP14DB8JmviWCj3oM+PaBVJY6g8jfjaXDlAY +/o5fiKAeNwiazUtI902gy1+1N7vctK5D/Z4QsDaKyezBD3doszMNw6Vl LlYKEEmCYIY+YdqoOnjaWLucqIcGqgyqZaFc9h50FV3sNyKR6IdlNTZCY A==; IronPort-SDR: UwgeHm2R3MiMULKtv5Y5QpMGuabKFrO6bXge9afRhJSuh5mRHPqCTq1ORT+//6ngIZ0Hps0gP7 p8U5oEoaOVeCVb6zSoHD6CcdRVAGwYCI27EUQok/cQeUCDBBfzYrpAaI2E7i1CKqk1jOzcfyL+ ZXwE2ZUhDsUG2LragyJnNai7UJt9C5uopMBB2CdJkLZamQWNZMVKB3Otwah0Z/zvPxiBYFMsbo UDmTWjMxS/152B2Wr9TKTmjos7Iz8eKF5/NI7oaa8hPiXD1hANXYg8hO0sykm2BGnTV1Qf4r/E Nmg= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="113690603" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:43:30 +0800 IronPort-SDR: uYwWl4Wp5ZhOkwclXMFGJOK/FE+Ay3BJ8VIQn03vEyKRpet/9UeXwRC9TuoMLKET0+0Yu8NoDp Pu3utZ31SIvGxBaRm0aF8I4A0JWZkVcsSvq5SqcYwu5GnE6c8JSc1pnvksRyQs0FH5Qh2Vy+vA HEhtH5NmGV51HI1mEjd/kD+Pk/gB3W428heEaqlzEU9Kctit8JpJy8bcsmlQPVw5lq5K/xlpa0 iiBTxrDftLHP9IYbU5BIGw7JmSot+xIRi1mi0lgsslf5GkqafBUSZx94yAZbhc3nh2U1QnKVKH gRpbEjILGVZQ7zWLdHvcXHJ0 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 02 Jul 2019 10:42:31 -0700 IronPort-SDR: ssIi3J7cwArdcczUeEkcZs9ezBQgj3OwOLdLv88ozquc48L2yozLcD/FTp4rI+DlfYhQ2ig1nZ qfMH2sJn0PhKKSsZPZW7HXsPijWKL2zjyuKifOuL2vyMBwlFx/+OH8+GiF/hJcNhoXFnzc8Bwu Jvdu1GD12g+loQ+0d9RR2EtmcKzyWs4g+mWjX0KWARasXSVKim51O5L2Bzl3UZjOKsMqooggHr fiZjAFF7OxS4tB0pB39LHvxUDr47KJ8bPRthGzl8Q34b0q2drY7f9KPoZtYIW7lTI9y++cqaME zdw= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43:29 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 6/9] f2fs: use helper in init_blkz_info() Date: Tue, 2 Jul 2019 10:42:32 -0700 Message-Id: <20190702174236.3332-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 of 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 Tue Jul 2 17:42:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11028463 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 4A95B18E8 for ; Tue, 2 Jul 2019 17:43:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3580E288DC for ; Tue, 2 Jul 2019 17:43:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 293F528927; Tue, 2 Jul 2019 17:43:39 +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=unavailable 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 DE411288DC for ; Tue, 2 Jul 2019 17:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726977AbfGBRni (ORCPT ); Tue, 2 Jul 2019 13:43:38 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:56073 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRnh (ORCPT ); Tue, 2 Jul 2019 13:43:37 -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=1562089417; x=1593625417; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=tQuAUG3c3Ex2NAFDohSdAhtf7sqssbECTSWT+Y11AmQ=; b=fnAPKZmK15ujaWgXfz78j9NridzP/QtnoOpQ3KuZi5q9mH8AvNio+q06 cq4GyKzeQcQXpDQW3w3RUu9XdOgrPSrcFXtXM/qLjVmLAiiur/Q580I1/ WB0zCRMhllpwwSdAhwDXDGUV8dtAg6B4r9R2Ft/DpWxbTLbErp9y4+G0u Z3rwKkOv7MCz5O39Mn3ieL2DOYJbgR5uCZQUx1gf5EUrIcBHMhhRAFwtS mUhYPo4WoecMeLjbqnaqGU3yyaOwWlFM7dsoTHwNyBoRoYk6D8ePv2A8R glt6KoC+NxESm9O0YQBwlOBUnbkqVA1bM2Gmb370AK+D0mmPp3pYdOe60 A==; IronPort-SDR: QTGtTbMp91ymbKNVANqGkm7mVCiI/dfTr7ptCYWvmgsnE1AiDf4w38A3C/ovqWhxyLU3/Yp4fT tpXPyLwEPJTq9fx5wYKHKHPv6lZHGCHjQcYvLXLJYhunSTVSRRwWCHRtQzsgMrye46gi4egEQZ VP6c/1PNSlkiCH0KQsTyhqzubp4wEKtvT9mLhhEU28yudQzOpducAWOGiVuY8Fozr4AZPUU8zP N0ZPmVBzbDja3K3jCOSyhuIYnPdoPclXqX0ggjLoeoFSYjrGY6W0GMbhc1whDloMUJx12/7dfL ETE= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="116916598" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:43:37 +0800 IronPort-SDR: ws0seQawCJnZ6+nabMELFkU5ys0VvnwDSsQXuDJLa/7MOwWm36/NRRI0MyEJfb3KvDwvKYadVt N2ylpuuOIv/VGiojo30TEccSVIWtzo1yF325nAo3OSvBbFm9mZk+AH2yXATzbrmgf1bIVk1eP4 Q5r8NnyVMJDZMIbloVsb3qVWPjsmmq8CODv0rQZ60mi4okp4NKboE0pfS9ceOMFKaCUL5mmYxt esHXmntKCM8bvpa91QJZx/bQGtdtcdaEeeBDu0xMd28CRk38cmweieRXlRKCGJeCldLskFZ6gC pXqoDfuxDlopZBkugoBjyQre Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 02 Jul 2019 10:42:35 -0700 IronPort-SDR: 3pY21X4H4oFet0YyacV+YlVBI/O5kjvwVM4K9RGH+lSxN8T2EcXrvGPqEb2YvDqKJFkrfhunvd wPT3NX+wyNa0Yzhxb/uYEWOC4wde2+iswg6SvGEkFsZEG7xl9F9e8Oeh0HWaPS7CCQMwKIe6a2 GRLymXkPc2sWwjDgBgV2nTvewLvTRednJE1LimHwb7D160IlrHhdJ5+6fX+M/NoUYRwOZ7jWJK xH+13m0ZRYpDhSMhKeTSxyUsymuQr84jPMXHTt+eleYamt6aHvlAIY3bJMXzg/m6m51iKwKuyF K5M= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43:36 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V3 7/9] blktrace: use helper in blk_trace_setup_lba() Date: Tue, 2 Jul 2019 10:42:33 -0700 Message-Id: <20190702174236.3332-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 of 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; From patchwork Tue Jul 2 17:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11028467 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 B860718E8 for ; Tue, 2 Jul 2019 17:43:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A45DB288DC for ; Tue, 2 Jul 2019 17:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9890428927; Tue, 2 Jul 2019 17:43:46 +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=unavailable 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 522B5288DC for ; Tue, 2 Jul 2019 17:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfGBRnp (ORCPT ); Tue, 2 Jul 2019 13:43:45 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:62012 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRnp (ORCPT ); Tue, 2 Jul 2019 13:43:45 -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=1562089425; x=1593625425; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9vWWJtoonwsaTPSwwa0+qd2wOetTCt6y5aKrlPs6UYc=; b=Lo4nNWVM+TaAsAs9slJx39j5yFueysZsaZ5YQywXGAOOx8yk6Gxjjr3X 4+qWgdZ06g+Quu/UShU3Nl/uCYeDasEhr7Anm2Ujq4+HgdByqLyT96wy8 e4BtprMJiULolOseOeYx6EnZ2nJ7hvtPADg/DujjrSevhFff6hf2oqjTg LyAIVafsb58p5Y4aWZuEL0ZxD/EytOoxsmeZlcoF0tid2gJrXX9EfNwFv I+QuiUf49xH4LFDJGxehhxdMJ2p9AB3DJLXq2RZchkN4usf3tTIeg1GOn 3yglokAs3Fd+ug8HSD01GqRD23QQ7U8JV/eyu3/TiSdGG/uCvc1QW6YNp Q==; IronPort-SDR: jHVgxWTE97H2MjSW9ndpr7LZDef7f0hOSVyR5xe6JZTyWShW6907NlSZky5Z3ts3E82/Gu7dNV yleAgO3fzcntgVxa5rcJbEMv7PREL8XO5MVcCAUq6TWBI+Ef5g/rkfJPNo8UZ1jlxPEANIEV9o xg6DsqQc+fRGjQZFYu86JrlWBjQnEPkMxre8+OvaLqR9PjPbZ2GqE75HKB9b/6H6lKH7131mNS yN3ICyEsjUNn1oDgKz2ZXMJ1/9w+KquPd2L4U0gSCPJ/WzyHUBNvo/bltNk+yfjKQsJ3nsolN+ /pQ= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="218460089" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 03 Jul 2019 01:43:44 +0800 IronPort-SDR: Wsg8faVvcN/7yAcEPdz+/mpVheJzMDZubaVmbdK2u/U6TmBxCEdvvVBBBwbSC4YXa8zeukfeNX 5Pa7C0vAEYCJOG6FRcgAnkvN+m3XONm+Dv/iSMZE+7K4xtlf8sVQ8+x3GmSYh46skHM4mFAiMq XHTH2t/OQWldr623rMLtgUpJeRrQxsty+nbVOwM57q5p85SZtXn+x3Y0I+KhuBvE9eCt3HNFEC Ftetmeu+nhT/h8L/pb+a4lNWOTchHEIPgWjTSs163gqDpPkiiawMACsBQLB40yyguFOHXkG2hQ fNUi6wwB71anZ3srtzHTuqH/ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 02 Jul 2019 10:42:43 -0700 IronPort-SDR: ws5rnzCM4RcXwdxe4HASEQFLH1dnYxxAMKAgVbT4JHCN2jgx943DO6rHgKP+swJs4M91iIs/sT gRrZoE1tIOaM6JyLKSoAUUb8hTK+NRvPlUPi1IJhe9ahYwL9curauLL4rf66dnNNMggCfCsFTI 3/Y+IKEv41CBry2zrJeQxThbAE0FA5Lf1EnTSrQvqmPHERsJ+iVZtdFiBfteYsvau3GieAffN7 Ri7patlKy/pzZ/QFGhDZFEMvG9Z+F8UK0U8dEwu/NxE5ZVctxdKWEE4Gv1UuEalLIUAzMIkkPs db8= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43:44 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [COMPILE TEST ONLY PATCH V3 8/9] target/pscsi: use helper in pscsi_get_blocks() Date: Tue, 2 Jul 2019 10:42:34 -0700 Message-Id: <20190702174236.3332-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 pscsi_get_blocks() 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 --- drivers/target/target_core_pscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index c9d92b3e777d..da481edab2de 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -1030,7 +1030,7 @@ static sector_t pscsi_get_blocks(struct se_device *dev) struct pscsi_dev_virt *pdv = PSCSI_DEV(dev); if (pdv->pdv_bd && pdv->pdv_bd->bd_part) - return pdv->pdv_bd->bd_part->nr_sects; + return bdev_nr_sects(pdv->pdv_bd); return 0; } From patchwork Tue Jul 2 17:42:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11028471 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 C8A71112C for ; Tue, 2 Jul 2019 17:43:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3F74288DC for ; Tue, 2 Jul 2019 17:43:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A84B528927; Tue, 2 Jul 2019 17:43:53 +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=unavailable 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 48F6028917 for ; Tue, 2 Jul 2019 17:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbfGBRnv (ORCPT ); Tue, 2 Jul 2019 13:43:51 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:44441 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfGBRnv (ORCPT ); Tue, 2 Jul 2019 13:43:51 -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=1562089451; x=1593625451; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=mMR/hpYFy80l7odJC6OZkX7C/Iat9UiqQzK/zSp4tQc=; b=VP2l2NDJxQaVVtPbjuwxZaMx/HlgE8wnuqCk0OdqBu92Gem3fpoGK7gO 6wfosra8u2TNrpQMdwee8kwbQZ5ncJDeOPUL3SRT1Zp21w1aV8fkP1AO8 NqahwXOpr/Wxyfbl6xjds+7Ks+CLwZgidOtcvZNce+Gd7ogTHZn1wh2P1 KuucLd9o5dzHrv4PSckmb/ywrQHIbccqyfUAkSMBIMDYKi8WySmlCtyA0 HupDGm62+B4Kp++WqkCCl2SRoRlcGF3rg8E5geGNHygrSgIhiizsH1oAe oS6Al6HNExAlTVnljSreCMuPnxuWnqeFD7s+J5fg00dh0J06XZfecpjLn g==; IronPort-SDR: Rxxu6cf6WwWdhuYIIirrUwZtP5uFnB3JN+/YJ6cGeF0ULosq4KG18HLuJEQNeVZCCUCx6vpvg0 H45rXZvY5pogP4VUj71oNsJldmvVq6gIsudJ2T4M0ncw4KLUpNlCuQjKrqN10H5hkiaty33bdK aOv6WeB0zdLgxJAC0NNEx97GQwK2kXuOz4Ors2iOrX1lWGqirSQ6DQYY35fkYFDlTfo5KRPDde zuNuN37LoKUTv+dUd+cvibOp23jIBE74Ax0M5xIT8rzoyUYQKqY7qVD75r9eTcIRxxV+WjJKux Wlw= X-IronPort-AV: E=Sophos;i="5.63,444,1557158400"; d="scan'208";a="211924307" 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; 03 Jul 2019 01:44:10 +0800 IronPort-SDR: kfwnae2bo8FnkKJRSnxuzQFZalLGD64K20P4lQ/FjMhmxAi1SM5CrTG4RitQQF6F3KRhWKaUzv ux8K99snYNUwh5yACl7GDrHJpLdYYF78kWSgOqru4Rsp4hrqU0a6lYAdygYEJQFfPk8AWbDyny jo9QXn8sv/JpXZmDqJxCXSd+UgPFBC6Ae4bWVGOMxP+AGa8/q3RK+Mb719BHScQQWJUeb+GSPO i/STsvUo3WPuDJWO9QhcwNv1Ig3Dt95yFzo1RhUEguGWjpvijHjU4rbHulnUPFVzEaW5z8J2sc kHfo41cOhYpRez39RtQs3Gan Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 02 Jul 2019 10:42:49 -0700 IronPort-SDR: ZZ3hK2bjvxPpoDYY3dGllgVu8h4y5aH5oKqXW08FxIs6lNu/zSn8Lq0Vc3CKh0UxLaxt9BwD0v 3fTd0ZB6CA1nNk66QTwybNGG7hulaPt/5JjQ4RaSIjxNw/RiC1ddUlmt5cVduRWWvDMc6DPeRv QY23K1dCOsFVfF6zsp2JXeQ1ammNVuRE1dwh/CDI01AburqpZV0KpfKqu1xuzoJfo0j+AG3k47 ScfjN3W9uVeTshYH+ctIEZjqQRzreo7anBy5gwBbh5bWBmg6n07aXYscmGEGj90oNrBHWiocWt PF0= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Jul 2019 10:43:50 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, yuchao0@huawei.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org, linux-scsi@vger.kernel.org, Chaitanya Kulkarni Subject: [COMPILE TEST ONLY PATCH V3 9/9] xen/blkback: use helper in vbd_sz() Date: Tue, 2 Jul 2019 10:42:35 -0700 Message-Id: <20190702174236.3332-10-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> References: <20190702174236.3332-1-chaitanya.kulkarni@wdc.com> 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 vbd_sz() macro 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 --- drivers/block/xen-blkback/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 1d3002d773f7..f96cb8d1cb99 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -359,7 +359,7 @@ struct pending_req { #define vbd_sz(_v) ((_v)->bdev->bd_part ? \ - (_v)->bdev->bd_part->nr_sects : \ + bdev_nr_sects((_v)->bdev) : \ get_capacity((_v)->bdev->bd_disk)) #define xen_blkif_get(_b) (atomic_inc(&(_b)->refcnt))