From patchwork Mon Jul 8 18:47:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035607 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 A5D9D1805 for ; Mon, 8 Jul 2019 18:47:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98D652865F for ; Mon, 8 Jul 2019 18:47:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D5D428660; Mon, 8 Jul 2019 18:47:23 +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 4B26728658 for ; Mon, 8 Jul 2019 18:47:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732365AbfGHSrW (ORCPT ); Mon, 8 Jul 2019 14:47:22 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:31778 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSrW (ORCPT ); Mon, 8 Jul 2019 14:47:22 -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=1562611642; x=1594147642; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ynS3SVE1xBuxWEb/5le/J5u09MnENI/7CT28vcHZjn8=; b=BfudsQEwRVLnbiVYUzG4TSf7ipub3330pzAtrJCpJzxW27M+CekGs5ml KqtkSxTVSNnyYBJaR0Y51s1o/9Ho1jjp2BVv86Ehd2CzxMirooE8C7oMA hzo1Ik9e1BAAFdizoJVfwe4WMR9LjAMlRQfBh3jKDwLZnM1XO35AdMAaT amn5Vxd53uCW/ZY2YKIGYRCNiodO59mfllGTGo1V6OpZmMGI8Mv9fIa8H 1VRjbaGkDryKyKtehfCxEPLh4lToOhANi1xiM+DH4uxenU4VYsvsgya7k qwmy8kNzY2N8SiCrE6e8ONRPdaPmY0deuQlNSFyPLtIAZUyyTsOZA74/B g==; IronPort-SDR: RDp8cmOXNGuAroY1U/Plvg3UM+2c+l4kMMyUVpemoLRjcHT2owIhEoYG4tVrjkGDXlK6NNnIAc m6osBCXpn43dr9SXKSPZ3sHOYfm39DR9Ze7xlABprMFkPvCXsHqQMHg2/1WtrxU8SM00JT2bJz LkcXmxQKjfeTu8Pdr0wnYYDqWl4ulW20czHFk92lgiQ+tLgjmcsGZNcoTgbXJw72pNJW357z7i WcEje3Z7HWfNoTJukDKRNkW79vDZ3pt7xtWGS/Kf21cCOzNXdqq7KfmEBeDb2WsIuS1uADGAby ufA= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="117296105" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:47:22 +0800 IronPort-SDR: iQyLP/CmEyYtBcUBapNh08zdOHv5eE5PpNUGdP/EaAu6733X/POlF4azMDZwBGDko9lRQ+yWFJ pIlS37rcgEZYxlCzT/WDwsg1t0bKxRtGWCPuLy1NkPTnt99emua7gbaITXkWTcHcWPPvg7U19n IG50Y8S2Wjji3qOix5lDvuk4xTn6crYCki5LOQRKZXHYGXn9+gQt8GS36U2rHkfhSCNpxlnarH 0gzEpzrnMW7dtSzvxhEWoOdgARMY65BaXr9OQVQDtLLr/BJ52/AdRfdXSlVz7NPs7Qxg0mYo41 Wmx6HRa3fMrOIgoCmgvP21F5 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:10 -0700 IronPort-SDR: XdrWNX/tHtwcbFCNAB6UtpjebhDmq2dIv5jQgtYneGZQJU5abS18Xxpst5IKOao5xF9DCI0hfE xaNjjXfl7Gy+wJkpahPgBFEUFq0XxSkv0wuJyr5ATn74oeIFo5FlSPmRmUkSaDm6J4qhHKgvbj fCx5bhYCef4cpXOOhHrym3RKYWASi8n2UtTD0M6qXFVWYaJt0b3P0NNZ/V/Th9cTV6+fg3R8cP bGRKiR96Ui7ZbwZSEA4GoKxvYPky8Mm2Rk9rD/6gna+OoY7JIG6rdt9GtjZ7CveE6MEpnuLfkT GXg= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:21 -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 V4 1/9] block: add a helper function to read nr_setcs Date: Mon, 8 Jul 2019 11:47:03 -0700 Message-Id: <20190708184711.2984-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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: Martin K. Petersen --- include/linux/blkdev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0c482371c8b3..578383712093 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1464,6 +1464,11 @@ static inline void put_dev_sector(Sector p) put_page(p.v); } +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 Mon Jul 8 18:47:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035611 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 C6CFE13BD for ; Mon, 8 Jul 2019 18:47:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA04128658 for ; Mon, 8 Jul 2019 18:47:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD05F28660; Mon, 8 Jul 2019 18:47:30 +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 185F62865F for ; Mon, 8 Jul 2019 18:47:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388394AbfGHSr2 (ORCPT ); Mon, 8 Jul 2019 14:47:28 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:33559 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSr2 (ORCPT ); Mon, 8 Jul 2019 14:47:28 -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=1562611648; x=1594147648; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=BLEYyqiHt/Wv6nLWVBfIZztbC5fI1sQcHli3j0z2Rjw=; b=qjhaFsekgVu0cRARq3vV6acEL8US66ReUsmNN/nT4kJhL4pFBFyf2Wgf q4yrG9Qe1eTCmAMAnVG2WaKvccbuq73vzHEtPe86ff47QCNrgTOGkAQN3 qftNplTw/79ba9LQJ1ZCj275T1anyyD/YuzBud878meS7XbqKH64rurli oY8McbazFnPA+6NtoaUhFEqSbqwuV1hINc4rHurTjo3NfDnLjhLNkxFL4 grNPm22FKatmk1sUJJvBD91lK/TQ/W9vAZHXuIeJhdJtO5PgWYD5hiuae HZPDIhcYCwAkRvQguJo9YiRD726oX2aBZBsMZquZ77oIJ/dhd+ok+IO3F g==; IronPort-SDR: QbPiQpAGhH93y+VlpxHVE627bpUli33APC+x7ek8a/Ev2YaYMx7a7GulDdh02ae9UhciDv0zfE sSSxuhDqGzVCe10ergPEm4cwwbDiAu6N7gLE1Qq+bOt75zyU5GDgLRjeg106PpTMajSlEeT2sW asgmsWgqQyA9jpEQx4cHs9ZHg2/JeZ6w0RfWF+KiHtaag4D5AzggkJI+/cVmUSC/TkgRKH0Bo+ sd6+TEmd+i/HvzUk4yrJHUmfAa3rM6M44IYcZ/URODwi+L/uH3SATZvnKPavRVK1oZPycYVaz5 Evs= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="114094080" 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; 09 Jul 2019 02:47:28 +0800 IronPort-SDR: E6L2P1FXIRezsyTNejzLazahkgMrcwlrXo+Sp3KZSgcN++52GVUDDmGMphtUYPN7wRl+IRp3gl O3Lb2lYogKLOa6Xk6YNpQgOz9w9ZXUP8hSSjITbEff0fqU15rS1Yiou5LLkQ4Np19ST6Qz6DE2 x68C3ssJA/xh0wsQkGm6H/ndKvnVAMhSskGm3a2qpcFK+Xje6FFev2W0uIGVs4n2vWjBch+zUO xpPp3a7gfYPXAR/l7wM3MpP68RHKp9crmJflHl2ngtyd3F0VXJdPwnrU72Xjc7m6wY6MbrXZLP gB6NiShcUe9K5GqjMVdBrXLL Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:16 -0700 IronPort-SDR: YRRx/EURyyId2rAn63ItMGwUJucXOYj/rfVXRkkyVSj/PtgC9c92Thdp63KOL6fYEaXTRbz/kU 1mfBfPgUOnEpRMI0FiaKN+4XSPY3ldYWJMZobspJSp2ODImnKlumR4tmOV5PAQQ9SRk3E9POWF VPn16WelTwmPiXdpUSqS8jeH0LDODQfnndrN7Ms33RFBa41zXzdS74G4tpcHX6MAZ8OgbHv1yL vhfCazKm6xZfVAQUDl0uXtbCaC0Nxr3Nufc6fjTg69fyi/C5Z3rd6iqUXjZe0g0eJdugYt0WSc KC0= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:26 -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 V4 2/9] blk-zoned: update blkdev_nr_zones() with helper Date: Mon, 8 Jul 2019 11:47:04 -0700 Message-Id: <20190708184711.2984-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 --- 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 Jul 8 18:47:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035615 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 78B3D14DB for ; Mon, 8 Jul 2019 18:47:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 686B428658 for ; Mon, 8 Jul 2019 18:47:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CBB328660; Mon, 8 Jul 2019 18:47:35 +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 0822128658 for ; Mon, 8 Jul 2019 18:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388531AbfGHSre (ORCPT ); Mon, 8 Jul 2019 14:47:34 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:53018 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSrd (ORCPT ); Mon, 8 Jul 2019 14:47:33 -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=1562611676; x=1594147676; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=/pc9L2crAxHB7hq+ujlWtvkrNrky6qYpFgcsaAJbQKc=; b=XDhUjm7ARMF9mIOlWFqiSlNvlT3Gn/qwEhpPfm39QDqFQBR2fk5zmWAD 204hrAGCWfu5ECYRHJNo15iSc02HhqXRO9Bvz4/iO8B4Ex2e2WmBALWCS wxbDMG4x7+POxh5y7Oeu7oH9n/kf7P+8XMcHqeXRRDSaXr9EEKsrH5HBW mc8jUU7TI654b40zS7OgudErXexvU3sovAujKm4OOcVs1IffoG2mtCaQi sEv/WcSHjtVJCHtDXANus0rkLaTNX7bGEfmGBAwIBI9okh6kp/MpuIYZh ZqGRS17FUIEGFcNaVRgBHslLx1NDC53TQ6Lzc1wyQJkJ7gbFIh7IybKHc Q==; IronPort-SDR: +YoqlgSn+nVgeprFGrFWPEjgc3vh4ceAPdDE8HEYzdSeZtVqSUN1Ttxc1vW9daizoRyOpfFDlZ nEi/IvvwTCK3PCWgQJiSAG6kOAyhOIlhlpau/FTIvymDWxQOk1KYwwEHIY9pbU69PUI1Hg0i4v puogyiseGfyupGZie3Xh2gdm2ZU4g2jkiMlZnvbZA0x+U6efvyGL0QxAsH6TwZJkIgsMBSVJxM TIEifvGav6ey7UyvtTUTEF/4JZMc6WQc2OHueBPQDW1u+LwiRFKaqmHbAljHfPpCkYFSEHutnP 21Q= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="212364709" 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; 09 Jul 2019 02:47:56 +0800 IronPort-SDR: WALF5Wta2uM0vvSzAZjy62hfnofdTsrZH95OoeU7J2apaoqYpV60biSvUInU2Ao/meqhgZkyYC uE9TK5p56wnAR/YTpF/vGvBH5vGGSudFiE5D9ycxU0/B+bkqOwOT6NzeTIg5I6Zl+E3QbTJNbw nHao0UbIY7xyM6atnDU2zGROSZM5s5kewEgFCikxXklAjNes9dlXRElXHB8pWhUaqEh4WgVl7O lYiDcRVLmf0Sh037oMKpkVs0UmDLUWAjoPd6v4E4Vy5CP9gCIxegJcrUPMzAWFl2kIAt6X9GA6 Otq6Eo+9oZTbSVQXRnaiJUmC Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:22 -0700 IronPort-SDR: jWdfh5Z5t7pjUC0B9fFgAyqOLuJnVq8Y8Vuwuw3p7a+MWysaGbZwoaQwzshB2rHxKcfqUwLipY XVsaf4oWX0EjvpBNWkaZZfPekQOryyganAT5TONr5hleW1fklSNaogTOGJf93qqApcdI8fz9mz KfZHtl2vopgSzLQ1sb5TTaY8qXUFTJ18FRvM4b3y9NCSYdEddF3MpV9glHcmCofAwi4dZkmIVC gaihu23gkcHfYLTnJNU0ZelUPMn6wHyW13Dx7Ze2Ij6N6zfOw7fSaRbNf+nH3JXFZwBS4Rrg8p HLQ= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:33 -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 V4 3/9] blk-zoned: update blkdev_report_zone() with helper Date: Mon, 8 Jul 2019 11:47:05 -0700 Message-Id: <20190708184711.2984-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 --- 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 Jul 8 18:47:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035619 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 899721805 for ; Mon, 8 Jul 2019 18:47:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BCE528658 for ; Mon, 8 Jul 2019 18:47:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7031D28660; Mon, 8 Jul 2019 18:47:41 +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 2669D2865F for ; Mon, 8 Jul 2019 18:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388637AbfGHSrk (ORCPT ); Mon, 8 Jul 2019 14:47:40 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:33586 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSrk (ORCPT ); Mon, 8 Jul 2019 14:47:40 -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=1562611660; x=1594147660; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TRJ5mIHEpUFUMoE20YZUADV3tKY+JE58H4HrPBkkQ1M=; b=RRemQHUudUe9qclr4zzg/Lb7ptwYbqk5TfKSYFkWEs55hkaPDPZpL7lS 26krxYahP7DQKKEij8rfG2AQzRDZX+vAG6hJgcSDg4JYIWSEbrE7XdTmX l1K3hukRf66zf0HxA35EnA0CpWSIKiv3pQExJwiy2wd7Q/X85FOUPR8ju czuTlLHWcBaNmi/peJhCEmCgvR9E5R6JvNlAIH/wUuAe1J3dwK/kHYklz prwwJVloT1ek3K9eEqD+6E/5ZwUBsHw9lkhFpzVQSHgnWfI1HEjO0d68I pCLz08nHw8etjMEcxmCJdMEcuwNt+aT94pWIN6Y8xUA5B36+0M6b6figD A==; IronPort-SDR: DfrIdr7QJ6OzXXCwjrQqqEU+6tlfn9a7aBPVaF++1ZxdPP17MGD0fELYVbrZkxdKKeY2XccfnD hqSpDxOrxisPUq9TF8KAqoS0Kpb4FST26Aq267Y+qcgxleVqZTgA6Ol55LkvboO62ZjZrp0mhj yb0wwXVmVPHM9iRQpGyzDqmpr0EE7zLtND2mhiSvvE04pInYuHFIPBuHbLgNyNieMP8Bv825ET oKgIF/pTnYKDDxOypuYq4BfZ8DejQekDtGrfzhGOVAcRFk17ARal7GQIrKFsJB//tUztPqjkRI 87U= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="114094107" 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; 09 Jul 2019 02:47:40 +0800 IronPort-SDR: lGIQObP1a+qmj+55abIf0fPEnQjtC9d9i9VdvH5p4YQuhlt6/0h7eN4GvOtfGaRpxxUEYkrqOl 6X+agu3Ntxrb7OM4h1GDtMNYnBrajlqvQUBW1dcLl6CsUHI87wvVX1WN3lgopOuyEiJu5sqtUF jMsXQhYsAcGQqiq6JMF8XvEBQMqeqa/kPG3RSNbqZctvSLmnjoirLESKKx3volDKXCaqWDNsOT /JjF9VLi5jhjbE9JMCFEKd20zw5JjCmW4Uf4B2eG7ARcmbs3uR4M5tHsLgp+tbCxHzwePri/DA bHR/PwDoA9YtR3UMzCVy1wIz Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:28 -0700 IronPort-SDR: e+wnXG2Mz3gtPkzW6JVqDomjkR+WsCClgTYVA68ZPRVD1/JbzvZKAnfiawuajy721alH/4cYAz 83R6mt/izAcA3wYqxabLbqAjyVd0jNtKCxpgAgTCPzpasYEs7lbnvuC3N4aFMecDj6sBrnSifF 82Ij40bI/YXlgLYOhl/4Oh93z3ngwfXd/OnW7O5HcGk/NS0jd+rAtkLqTzWO6jaL9i1E18+AqJ 7S99xr7IczGeGB6g7ryoF5o2/SFFru90R9W1IEnAhWc+kyfKs7iZ6KzcqN/cZ5rpgMFzYrCS1q EiI= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:39 -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 V4 4/9] blk-zoned: update blkdev_reset_zones() with helper Date: Mon, 8 Jul 2019 11:47:06 -0700 Message-Id: <20190708184711.2984-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 --- 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 Jul 8 18:47:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035623 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 9E72E14F6 for ; Mon, 8 Jul 2019 18:47:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90CBA285C7 for ; Mon, 8 Jul 2019 18:47:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8457128660; Mon, 8 Jul 2019 18:47: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=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 3A69D285C7 for ; Mon, 8 Jul 2019 18:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388737AbfGHSrq (ORCPT ); Mon, 8 Jul 2019 14:47:46 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:20316 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSrq (ORCPT ); Mon, 8 Jul 2019 14:47: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=1562611665; x=1594147665; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fBeS4/ZwqvDjhy1b8MtLdfBATaR+YEkh8G8mPyvIJT0=; b=H4yH1nR1e4FzfyMqUhn9gSo/grI2RcPhhLtoTLWkMhowaMtG/Xksx8K0 5IgBuvKCOKWn4sgYdkYzexAzy+CRov5uAXi0q1GkzElzFSUhLnfnJNQWT 8x9Hos0ylDN1Oxq9k+M53PkfbcnEzdBz6O7/JmmTPqGmy0RvnQEwpwA/Y idg408KqoTjbijb9dTY7CMvNNby/0NaPTYQ6LTvtg1P+mIRrbdVSkNklz dDFu+kgJ85ybazBYM3pYn7Nvhf/sooq4y9HhXoB+1IpCks3MF72EKnmPv 2wMqauqxVlNehhM8wDSyvgHqoQjKuJHgDSvj0ukKfT/ApL57wXfS3LyKN g==; IronPort-SDR: pQKkVKpiL3BYJAYp2OVQbPw5Nthk/JD/kiHlnQvuHNygFXBS1lDjeZaAXqm0LAOid3L9M03c9+ F0EHLh4xNBgLiI0yGcxsU79e5u3Xh0s91KuB5kEGn1gXXXuW6/6QC+79hKSQrWditQS0zDL81d mY7LRjDGJpEqFrwCmTFzumbxFBOasznfhCJz8t8FVswekAts8WbopJHIxpKOu5HfSmMShc5ikS Z7vySjh3o7LjwO1qC2PEQADM3tRz/1VfFCKj1irrdQZ83tgwJhv0vETYIhVaOozfDWCoYkyAl0 Dtk= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="218874419" 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; 09 Jul 2019 02:47:45 +0800 IronPort-SDR: DCHipo5YHAO4Hx4ZpqqtTplzHohMn90+0KgJO0sVbPvFWxmodo8YEHSs1yimcMXj+4xtWuYPnB 9LSvaoTq8aKBHYvdUrKCTIFzum3+qQ0d2903Q2+CgCELFdKgfN2JHTK3w+TVwdEJSaTy30ahWs sVs7B2V37wj/FFpo1CuCtI77vJNsrvzouWtMY0ZTRO9rr7cZlCpEhpy7zssBEalP98k/j8GniI /X68NtoDw0yrNgQft+RcD6R4SBjXdRGAAxwTnlAQDAThB5mZZUN818KBPeIp7MF+6L+n3CEMFt HR009elVE2L26kRWy6Nbk5di Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:33 -0700 IronPort-SDR: mSzQo+wfNgERgCVFud7JBTp2NieFcrt7EnGnb+zRa7q9bK08hCzDg+CJfwLIldFz0pOGFDaOKS V6OLvb+6LzgoSZ8fb06fYk117r61T/uhgntkoprDYN+CpfYFFy8Z4K5aL8MlfWEEC7slAkAebQ RzEUF6LpJ2Fl9VRSOL/l7pBDwfnAJvdasZYCjnUsGlYv9bAJsIIK6krklHTnNtryjtwKwmHIup TcdxBUboya/h4ldKo3V5LNG4gKVzAq1Ws/lBSg2Eets7EHoT7i8XMvEDqQtXp9sqLszOkgy8Ka Yhc= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47: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: [PATCH V4 5/9] bcache: update cached_dev_init() with helper Date: Mon, 8 Jul 2019 11:47:07 -0700 Message-Id: <20190708184711.2984-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 26e374fbf57c..024c52d11b0f 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1302,7 +1302,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 Jul 8 18:47:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035627 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 9F83514F6 for ; Mon, 8 Jul 2019 18:47:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9202D285B3 for ; Mon, 8 Jul 2019 18:47:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85C8228628; Mon, 8 Jul 2019 18:47: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 41810285E2 for ; Mon, 8 Jul 2019 18:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388837AbfGHSrw (ORCPT ); Mon, 8 Jul 2019 14:47:52 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:20324 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSrw (ORCPT ); Mon, 8 Jul 2019 14:47:52 -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=1562611672; x=1594147672; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ZoXNFKbL1AElJNl2xVVOKPlcS+hzkE1sUFGwmoc7aEE=; b=jbRG2QcL+Fp5jFnzjcQdAUnYW1CqKjw6ZOkIXJsIkT0s9TX9useZwce9 sEsx8Kn0rUWNNukXBxSuHk77jvK+6WlrREclWLQC9GMMPFJfdYIclTpTP 6c4WzZkvsONFv7BnVKWDkbJkf2DvfHysIsh8GZlW3uR8nMXGO8RXHs6W8 BaiddTTv3baHbfzXdnQKDRyoCi8Oz4H50brYghGdC4TNG/79Ce9EYrp0D M1iBbK4GdIhkyeC7BruOdl3ZUJtr3SzkDO64ox7AYpe5sMJq3rC4zZ2Rq Kb6uJHWhtEPiBm+GXsgSX9AYeEcnDru2TaWPu9vmW/6hZQ/ckNFCyU/rB Q==; IronPort-SDR: 9nXA8Pgj2A5n0AiVpNibIK9TuP7rbC50L0xv80/l1IZ7+vSYGlKtefeBOoFTUaNRTUyVuPb0iE ZAPM5j/Aq/cfZPC2P7+DGnX/4lJRIE0Bo6h9h73L8sSkC1lV7w58XwgVRZy847/vO4vkMJ/su3 fYQvCYHTweMpzYdPGyk7nERgP17ogCg3dyPdJwo45I+AjZtbujkACp7dYK1z7JBNMBIghFYqv6 DIJWoADKi/VsvRr4bmqzGH4v58YHx6Hs8jv1H3sDQdB9PGV1h8AXlGmcE7iUYLY9cFr1TiZ9X9 WlQ= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="218874425" 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; 09 Jul 2019 02:47:51 +0800 IronPort-SDR: dfYI6parzq7gukJNBbhfs/X2xKEGav0slIKsU8sNolk6WAJno7fm357PtEFOZLthng7Zve/hCW 952nYZRzmHXU5UyjGJGsi1K5YgXWZc7zQAEi/SFa1cY4r95ZdeDVpHosZCxtx4ExCVGEwHp8jB 1VEThFmVodm6KblZ2Tm3KBpzVywO4hZMgZQn4wO0qTjik4FNDLgtI6XtzU4hL8dOxFL595ONyy Iuw+DyyrB+bWQx8G2/9tT3VD/xBYTcIfRlazwwshl7kAk3aO6pcINerwxwSRl6LtWat+iGaihQ 437cbfMB3tTtBzBkL5S7+bP1 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:40 -0700 IronPort-SDR: kecyraaTh4dfkJYr6JIVW0Suuw0udo/w+uOixco2i06qP7L/SWcmvqt/OPQcFYibEwQdrOi0nK enRpRX7ANej55ctxwPbFJYb7fqRPzb9iUsQ+X5ZNEUrTgNq9FFFFtCk8Uw0GOXwADBWlxronSY Svt1NhhCrvFTzjTb0NAJyLkYX8DO4fah1yOc1ieVyunDXipVwQlvdQUxQXLaXQ7YfMQ8I6zuux LMBm49s+scu5jetOVTy2vWOk4WWISLi0ojSm1PhlAA0xRc/M8yQejIviSzITpm3H1FBND+zGZZ tNo= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:51 -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 V4 6/9] f2fs: use helper in init_blkz_info() Date: Mon, 8 Jul 2019 11:47:08 -0700 Message-Id: <20190708184711.2984-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 Mon Jul 8 18:47:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035629 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 87DB1112C for ; Mon, 8 Jul 2019 18:47:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7946E285C7 for ; Mon, 8 Jul 2019 18:47:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A69E285E2; Mon, 8 Jul 2019 18:47:59 +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 E82B1285E2 for ; Mon, 8 Jul 2019 18:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388880AbfGHSr6 (ORCPT ); Mon, 8 Jul 2019 14:47:58 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:40616 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSr6 (ORCPT ); Mon, 8 Jul 2019 14:47:58 -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=1562611678; x=1594147678; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=z034C0lu3K9Pmhpbgqrk0VEPLsTVbThXKUwaZzmZN9k=; b=ntZqPbqf5yQyYKuT73EMffoJ728XDecBRWkzz9lH8qLcWf2xMVh4DtWh whr9DA6gEbTQV/dBqXFqCY5BUpyBe7LiLgEW3Fg5VJP8kmp8IEM791VQK wufXTu5q2XUXF+euptvV6xBLshopGeXvaZ4kKUvSfut/fzomsDPpgLjm7 ILLwxv+UitONEBWfH7y544h+pQLxi2ONAi1SYfdGOF3n+aim4dFKtUeiw tyLzPDrVgpMJY4xveqC9Q0rxGaCt5TYMBFnjIkadnou7QjztcmJeM5q/A kxWg1oNchHpbTrnV7+ROUz28LbpWnfrrBW7pr/mYB9Ux4iNmMgFxQfnzm g==; IronPort-SDR: +ALQZPoeY8xIUY+RLY3ASBYwsrFoNqQcNK1R16gk9A/WmSBnKIjfFpFTJoEjPAcZ+q0qyX0d79 g3dm5NFnfu5k1QTn3heDEHDViuOtUs5sQAM4jORb0K6hhzlRPDG1p1D18E2oA62/D9q4aC2WXq SYBilEJQn3eI4tovXxG3V7hy+ChA16a+sl52XNBaD+QTR8oARWliQdljoNpIktCkMeR52efmbh o7jbHa8r0Y6FBKBlW/v1dwT1nxp7qA8J1D74QvpKsnYB8dGQI3gDjT4puBNOB3HLvluIibR//E UTo= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="112477280" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:47:58 +0800 IronPort-SDR: ErhjjZcU7NsyPlyoD3BHWkIK0fXot5dfwfXmX1bY7QiBDHDTVByfL/mVLrvo3lYeabscn8Q3k/ PliIZCFKLgiPyNyn58CWcuEtuMWGCf+5dAaG4Y4RQ7OpcWUIF23Wmurd9q0A4mv1u3VjEh9gBZ sdISTV8G1VjHGC4DWhRcd6Mov6ftuxMdyQHxIJSusAs43wePFeJpUQ3tdsZ4nTvm4BXa3+BmWv Hu64G7jiZUULYYYpapJkfoy6HYvDnxQFU3FJNiHBJGjaXHeWcss37+LmIsQsP8f5Q+qNAJQG6+ d9cRL9np+otH5S33tDbeudea Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:46 -0700 IronPort-SDR: /lvUb5Q0myDa5zcgSkRV5mq0xWp1dDUOhPS4Wf9cFbmpG/IvRSSGEJ9lGM8k7Pjd6GkWTfDTv+ avvWzfyzdR+eOgrKUapLjgHI2vMsorvgoJy9+HYsgkE8YYl214niu7w2HnG8nciCH6ySy43zmH ohwVHaTLIjzccyfIkUQ95mnACdoPRdlSU5MIKSY0Z7xcK7GgXG7jb4ypPBfDeBz7hFQfKTcB1z axureZOqr+I/9iazjQ5dwfRkKdkMZP03pkSPzM+08pOLf2ElGq3Di+24xjBJ7cTOHtOLO4EHwy eec= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:57 -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 V4 7/9] blktrace: use helper in blk_trace_setup_lba() Date: Mon, 8 Jul 2019 11:47:09 -0700 Message-Id: <20190708184711.2984-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 Mon Jul 8 18:47:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035633 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 53A7D14E5 for ; Mon, 8 Jul 2019 18:48:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 445DF285E2 for ; Mon, 8 Jul 2019 18:48:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38E1128660; Mon, 8 Jul 2019 18:48:05 +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 0D42D285E2 for ; Mon, 8 Jul 2019 18:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388923AbfGHSsD (ORCPT ); Mon, 8 Jul 2019 14:48:03 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:40616 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSsD (ORCPT ); Mon, 8 Jul 2019 14:48: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=1562611683; x=1594147683; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9HCTUA025JIZSm64FGSGpZxpfChbQ94lvGtg+dmKvTo=; b=DK2EioRQ9/WEfpCU2JZ1MUa9aEfst7J7UpNOaY0ygb5XP2MDQgK6IoCK BhqNfs1+rdQN0XeNcnsNBHlAUog043hezMIE3e9JeGO1iUOkLd2+nRQsm kKwdc3oCFZNkmBIw1HfPlXcHCG9Y01ZboOb2vzgMOBilcWvUHSAgQrueb 9CEKB/v7t7LN2bbHcStqSBSDo6ahqXAJTNiahkgBhv0Xj9OukLAaSHcpe paWfKjZGINo5JEiVxtGXKL/37NWHtrcpt7TxFMCc8b+xlxQ548gt6Cekk ot3EzwmkINpV4bqJtDYbHq6RUmy+OBYubHxNTYEu9nMVXlBGIWNO7FBxK g==; IronPort-SDR: o7PA8DYD9ZXarrkV/RelgHnhi1PO6omk6MM3WsyRgksxy35NnovVtRsPyDxbBBYn4tO5zoP9ox i3uep1IfbSliL6DQF4TZwvfcsRjrUvyKfCC5imnzhsW1TI9xTR7tnjhPQQCB687DI3uOASJfjD 41+H59T/7C6eAXbwJ3J0LIZeqkswdlqRddcHkqXiNTODJSXU3EQH8OaBRJsNwcdsA/Cf4EWB6z IzKpfFevTBwi7+X56Z79rydEHtpYNDDMI+7MYsw+TaYLxQF5ytZDJofPyyCRIXZxM6fqjstD0U C30= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="112477286" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:48:03 +0800 IronPort-SDR: 3Mi+U2FENEv6tIBaw8rijg8FkM09NXQX9SXQkGwNVCsmhgIgMZ3T0/UUy9uvPdx4PlXL0YnQVX CXA6NY6hv4/6NkyUIa0JZnElR459z9RXN+/SUB0ezQRaJdxqFr5cDiCRnD7LHK3/znU6QiPe4x ipXAxpdBi1qLUyyrhL0qusCCPce09ch3cfwFlT9sl6nLhbXnr93ood1ngmDekZNgdCQtQt1CSH dm5EP5pzcjegbj8iPqve99Rp9R2i6aznNRRrEC+oBA1Hs3BPGxHdGo7x/drn7OC0vevqoD5YE1 9UI4aEZMwejLwBTexYQHndm0 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:51 -0700 IronPort-SDR: IANeuyJ1+oRIdNc63u5j8ED18tDaGyZU+gvHhHZl87+2ajQm6m/jQpodcxPNu6UDb5asJbFKCF 6kz3QDjj06c+UBwngWRsx/wVxzGhe9RxGj9M6n8nOLjRppziguHG7Au4OsvD9KbRnMH5je9sId HZ4Az4HgCGj+Ik8pP5ZOAxIWgro9VZXW9hO0HsvtN/hE2ky3WsAJ8tq8rmu1xhjScNYGWeQANg CM/zAZ7im7Ix2Wx+pAYuDpo1aK5GRVnwAfHYBnzr+C01DF6NPe1R8G3EOZVTfz4MlWW3FOijlF U58= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:48: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 V4 8/9] target/pscsi: use helper in pscsi_get_blocks() Date: Mon, 8 Jul 2019 11:47:10 -0700 Message-Id: <20190708184711.2984-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 Mon Jul 8 18:47:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035639 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 08BCC14E5 for ; Mon, 8 Jul 2019 18:48:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF7B128628 for ; Mon, 8 Jul 2019 18:48:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAD7628658; Mon, 8 Jul 2019 18:48:09 +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 99E8228628 for ; Mon, 8 Jul 2019 18:48:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731424AbfGHSsJ (ORCPT ); Mon, 8 Jul 2019 14:48:09 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:53112 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbfGHSsI (ORCPT ); Mon, 8 Jul 2019 14:48:08 -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=1562611729; x=1594147729; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=PIKkEzI8jjM5eH2i58/XfLrTPoIAapkGFdyFIcgq7l0=; b=D7m9jhZ/w7ytqY4qt57MaOvUI0X3w2TszWj+9qp6yVAWaTiNp0bMASHE nb53gK+Dx3ys/gr2ZSx3URTw4bpI5/a0oeZJXOKsYSQPrvq8ag61CZpXf DUyTXkuqRIJzKSDAKbvIgjIhCY8zEy0OXbhfNBPskLKoYBlzY4+EDdgPk nbrmze7bq9l7Q5ukK5LE6puwPCLuRTZv74+nmWwPlOGJtkmdarzQQxgaQ TZ2QfH8WJ8B2j+4j2Fn8Sq0SH0CLoAqrpICV6sZtt2LXiJ5EvSeXJm+Lp N0/+XdPkEqhnlg4O7dTR5h4ZJQrzIEJtp1umwSKpYkIMzxKDrKP4loJH0 A==; IronPort-SDR: SYJw6nnIMiB63TiQHxHc6Oesr52ywaHISi4hsjDOMWyh402oM5KiJRVlpc7uWi+dWe8RO5AGrY 5h6pOW2ZZOVzAZo9FMF0drCzgiMWdeQI7SiFNbSz9mv5s9W6ZltjIuAZlT23iBku3WWSty35Ko AX4KgYXpTrcR+Db8TNQUnttuwHSZgchg+7nVL1bBrhKrHA/Luy9i+IK5hzKBWdu5tevz8nkD0R lTmFO7O/0XDeEqDbjMumatXTQszW3nMEpeQkRUO6qvYKdsiL06IVOfd7ak+UcCbF0JcoZXsEVh DW0= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="212364780" 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; 09 Jul 2019 02:48:48 +0800 IronPort-SDR: 7F0abe20jJ4Rfev6an6sV12LgquKG5mTMWnj81vwxdxoORs/HRfYQI6gvwfAe3O/Lxza/2Ksw4 Q8s9O9Z8SBe9QOwcRwX+ypTsJwn5aYc3Eq4hIUPWrLwBxTeufkXsEsBMaWJjiQKeGISb+EXoP8 EB0J0jZ6TAGL2v/dncy2Y92/eIrrnpaCUdMPZ3oT7OXAclZZaI+c+895pFY0bZ2oDf0957wvD9 4aVJuiCnWnqW/zzWxOVz1qxw+0/GFmIwXBir4HC4A5pFKPJqdZw+aHpo/5oxXNknOj7MCvKOx7 aKCk5i4lfGLdLrwuX0rUsmfl Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:56 -0700 IronPort-SDR: 26GGS3luZiL/5ckkNXHpZvmNp3T9hhLG9lVgKoii3ZrNjTfbn7JDDAdDbg3EYAFCavGLZwgseq bZ492xPRRMIg5a4Q/mNnufyTTDO/6t+CSUsrr62FgCwL4fDxOvEe5/ShBeTSWY/Bvhpct7909Q fLEbyMa16Zyu2TnBE7i5FRyyZVF0XAyIGTClGLHEislCugo9rwiVPBoIuTe8R03DFt4VG2cZH/ zk0t7Rms1al8fiv4wzxJ/f7DZivEmKC0K+mbDMQKseLJ16+Ye4oALigBMwGdWxAp4zWEJdV9tr 7V0= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:48:08 -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 V4 9/9] xen/blkback: use helper in vbd_sz() Date: Mon, 8 Jul 2019 11:47:11 -0700 Message-Id: <20190708184711.2984-10-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-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 Acked-by: Roger Pau Monné --- 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))