From patchwork Wed Aug 21 06:14:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105489 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E9C11813 for ; Wed, 21 Aug 2019 06:14:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F13272339E for ; Wed, 21 Aug 2019 06:14:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="MaMiwGfR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727817AbfHUGOf (ORCPT ); Wed, 21 Aug 2019 02:14:35 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:34498 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727766AbfHUGOf (ORCPT ); Wed, 21 Aug 2019 02:14:35 -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=1566368074; x=1597904074; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=YxWj03mIGVcVbYKOln1UBPzCaYS0qRuFrw+e6W6O8fU=; b=MaMiwGfRcNgMb7+ytBS3Va8PMKEOCH0BlzZE0NcmTMppBfMs2a4eL9Yt LlqUkKVBkbdNaoCydPT9PzeCKEg7W0HHsQdchztkdxCLGbO0zNddy+MHN rC4VzB3J0JOQnZmEzVY2CEZxpazoPaY1QQJjkimpfxqCbMHTFFAkHHeC0 tM8atciSbm2GmRE/y8rLcsbhLYdDHzZN7SN9TBNMQUd8788htt4hFGIY2 k6pBiHt2SR8SLc05p2kqdIifHyGTf6hOqQTQDpnsl13ys9O0QFjkoBc4M BdX+qJWkkPJcBIv7hGasdC1WM/BuQSoDmFbhxizu+c8hhiLHwW6vUsuW+ Q==; IronPort-SDR: CgKU5uQFZOtXSnflEOa9Wxs+RJ2H0l+YiQq04NIRRiPSANXRhk4mzH4dB/m3raj2w44GTjkm4P a/crukhRhFmiZcz8klbtG2imv91wSvGz+HJ3PKo51XZ17g+rRh1ClTO2EHTpt7Aaee6z70c45U bcq022hcHPMPXjDOKRC4Ng4SlgJ9N3Bpy3v4W5y3AzgI/hCo52nprmQPTilc/66Ky8DbaXQRDa GvXMqLUdeMNeEO/EIdCPghc7zsfqzSxYTOnlhDjorSvktcKnhLxHPtBTb/wFqWhM6NNF7pof0Q Kn8= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117904641" 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; 21 Aug 2019 14:14:32 +0800 IronPort-SDR: enE0E3BSbWZ0lvkP1xxRNohhL4LJHuEUalT42vk5hP124w4r4S3JRwtN3HrwfLSDL0Ftv8a6By xpv4wuPtxypizvxVauvlYHuhmbJbnUAQ2+tUppy+naNEKGyOo5ZJdCkJ2RHH+N8dMakO0b4oH8 K1q9Jbmc7aX5KRCcpR1ctYV6EUKHGM3PGGxWp4vIXvwwDFxZY0jRlpy4Dm2SwC8D9v4FcY+qGD x9Iz5yoJsSruk9FLMaPPScNpzYPEXrn7pwBibknNp1xOWPVzkEHOIM+iyfjM8aKaImOJjt0n3K 3vVqLFTPT5mD6ElPXOvL/fQe Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:11:54 -0700 IronPort-SDR: J1I/5bgiTFIAu8nNl9kv6CSGMFr4yg0TlUcqLzMJdDy8EZZg8n4rfy/XPfR/JjpgmOnfkVltBx ssjiOGwNssK5XXLGHSuoQGzY72APilAq4AuufFX7XHX3TUf6fMAFSvIG+S4BOIvcE8H6g4FFk4 w6w8aEGbtPr28z7XjcaeIOJwLHNeebOJOnfEd1HlWA5+RnjTkgiUj/gkJ7B08lWbk1QlQ2RUaA iYA9zikhwLYCTW/T6a0mIofhJVPKp5ODf79l+YclGUXbyljEgCoXjsbem9ACoYAnj3ly4+ysyD mtk= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:14:32 -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 V5 1/9] block: add a helper function to read nr_setcs Date: Tue, 20 Aug 2019 23:14:15 -0700 Message-Id: <20190821061423.3408-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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(). Reviewed-by: Minwoo Im Reviewed-by: Martin K. Petersen Signed-off-by: Chaitanya Kulkarni --- include/linux/blkdev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4798bb25f1ee..aa5801c8ff73 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1468,6 +1468,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 Wed Aug 21 06:14:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1189C1813 for ; Wed, 21 Aug 2019 06:14:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3C1C2339E for ; Wed, 21 Aug 2019 06:14:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="YG4jaOgF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727873AbfHUGOy (ORCPT ); Wed, 21 Aug 2019 02:14:54 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:49516 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727481AbfHUGOx (ORCPT ); Wed, 21 Aug 2019 02:14:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368094; x=1597904094; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=KskMhIccdhyYejQPXHxAAXs3ig7LJbUasu+JL5qAjTA=; b=YG4jaOgFKeTYg0ti7PvIC57yt5m9AsxQ9iU5BzcRswX/BTFd9phF3l6y TNkQs7JLY5LGqtASPE945Y/am4IQZus4qMZOVAmiijPkdtqC0LGHDh7ED CIIag/IKOTXJ5Tp6GdNAY6GZNH1UVNe5yRHxSh53w1vKPyskYH4FCbsEz bGDmy4jXXEwALa9bIzPDU4DxVrE7gkOMC8OQ9METyk3i/1OrWW3RZx34Z zygCIEV7L63/MH+VVyN6h9I/2DUDNtSHhp1dR1oYwHcpIEwYx5LagvFpM fzoq9/3fCv4XUtd+VwSOg6b3ZCssyq6JIB1XjE1nxWeileH6fNUOiaGwD A==; IronPort-SDR: mVJm7nUgQqO3RI2g+IowUVG9hAsva9CpG7hITmQlyad1SUd0Hkt7n8qjYctfVf1JUwU2i8zku5 ELz6xoUgkL6TGgAcAi/4Pbb6NsXI2xmpneHIyubRVM2MvyVefjQcLAOAWT0oe+td+lNNtJPXS/ lWS9p6SCV+sj8aZSQJZ0SlzRGq8pwORoouAlgLjAfv7UNwD9oa0VgEZW+jnrtuFk9BwJBdE3If egHxU+WAxQwNY+NjB2DqyUp1mluKzk9JBSdafdWDZL+fLl1FLkuodHmGV0DEe8zwNh5W4+eoA0 q+0= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="116306276" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 21 Aug 2019 14:14:41 +0800 IronPort-SDR: rZsy/B4B3wwvVJpTKt5hf+tLSIV4aBjcGSJB0F5pyqqF2LRQr7RCz/RpUUxji/n1b45gZXn4tO JLbDaZjrT2zlapApFTNp+Y2hjM00BQ8s0FfeidZVj5sK5w/rPUWGzVP+KKwtqirtnOGGFjVjAz J995jgWR+9csnWPzHEKNLptbawpZy0S0NSCSRmFmgi+1dG18yG8Y2AVZwfDmUM8C6ZeFS9l5Ko IT3XBHrwHQ68+aPjSX/Fv5EQBOFFSySAsZR5bOZy623Wi3icEzhXxQQw6+bvlWRAbxHEmOGlDF lsdLjO6uIgrPiWEpcenropag Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:02 -0700 IronPort-SDR: Wkxy2ajw+rcxmh/A1OPQtV/EVpqzu8VQYhbba5Ebo14vmpR//tFwqZJh/KAarh6nBHY302sfLS f9y+8m+P7OM4ikcpCf+hrIOkI8rUOheGzIZa7JJEOFgHfeh6fIDpHabHw92QGl2m+MUfpkURBP lQz6Vvn3QwxeIwdmkjnxoiS9l0kPa0JFCdZzE8f2tfJpY+Er+2QWJkbPr0OEM04oU8Z5q+nDf8 HlWWVyH6PtIzzUMmJlH7BSX4MKo4ABaBnXMVRa0qDzPRLG7b3ovnpkJMU1P6TTZ7PmsuGmT6Ci NZg= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:14:40 -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 V5 2/9] blk-zoned: update blkdev_nr_zones() with helper Date: Tue, 20 Aug 2019 23:14:16 -0700 Message-Id: <20190821061423.3408-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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(). Reviewed-by: Minwoo Im 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 4bc5f260248a..3f5e9bf03486 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -93,7 +93,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 Wed Aug 21 06:14:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B913614F7 for ; Wed, 21 Aug 2019 06:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95F1722D6D for ; Wed, 21 Aug 2019 06:14:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="kPHet30H" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbfHUGOs (ORCPT ); Wed, 21 Aug 2019 02:14:48 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:20504 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727481AbfHUGOr (ORCPT ); Wed, 21 Aug 2019 02:14: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=1566368116; x=1597904116; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fAftc0jXLF+PYgBKMR7sJr2letplG8FiARgg+iOt4Mk=; b=kPHet30HfrnzDMW2pcjrC2T1a7czFNn7aTCRU33dtJ1jXIRv6s+/MqHv o6xg5VCIKrxR1wR4wMTwqP13v0ty2puNFECEnIk2SXcGi1MTKQB9cQZTk +J0UZICLwrFeGV3vimQjTf32CjTQD8otI4B6/dmvz55ulV7OQ9DNlD1pJ 9lKE0KAwrW8YvnnVE/13vBeNwraFBlMN9Gm5nXckQdQnmZ1VVk1rb7gXF yxdz5AotKrJkdWUcVV6W5Gs2+/8eCYfORNIlZLAG8lMDmV3ovNBDZhyyp i7mY/AJhBF5zGTMN/CDGuLwLJkEm3+z5S/jkEMXdvF7juZ3YqmS4o27N1 w==; IronPort-SDR: 8T22Y9rgiAC6W1kZwtmuWZNBPuma1XW5LZasuTnmeuLpIrqQW8n/8hHfq9OYUK52t7cq9pDaIq IaDXrjn1RsCxh0OEZM4L4gCsQYSSI7g/sdXmV6h5BOQLIontqJ+FvCN2ltfOqp3pzeon1AwhdF JXdXRT2JWVoqF+p96xAphfi6z4lRmuMVBhncHak+GxeHrH8NZlaGiUn0ZjVoxaAncIKRhK/pfY MvY4NbLZ7+SfWMTiGv646IFhj9vd1HLXbkjQvAr1Yd0bsUcDNwiHcX/ehZBBBO34LfucQf/gDk +6c= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="216721083" 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; 21 Aug 2019 14:15:15 +0800 IronPort-SDR: BNUaaEfCWLEk1cprItBV73tnJNQuJC3CZosVgRYFUeUfk3LCNJiCfff42GFeu5TVDHE5AP43yH rDVkEtbZbN9DR1s3ruTNFcbjxBENdRDHSTei0YDZmnucWqVb4olQolFFONROmU/yDhrsEE+T+y QxgJoGW1oPLWluAuePh8d5231fmy8XxM24g7qw1mXh4G2XtHQ0u2mP+X/J/cRiUpexLjdHHESz 2ogoS6HDjUJ2/N7RArr1xX77gAlGfMz1+XWapPmTH6uMNZojftgMfBO8ILsPqvzs2KhOzxx8IE qRZaiX5T0RpfV4VwIEM0P1fJ Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:08 -0700 IronPort-SDR: 5VdlNZVMNPdB4YJKi8PvEuaTgpLYyJfh2G/rBJ/AFXXZQlCBvtiNoYa7ESeeEq6JoKhDakQyQ3 bzj4rf3rS5gKcHvy0LSRr1h325MA8E4vMf0unZpmXiHbj6LGx2U6Y9bgmSHdFLKdRjPf4RGA9+ HwIzbBlZS6rNLPIocY2VAP2a1yR7H1bp99zjaHM6EqIEWm1ysT1yq9XJYu1XdiXk7/3pAgpb4V uRKAxSzSii+HX5bHYsNUptuuDX0oQ0jdvrOp+F5m95Slc4aGqzUCOtNlfEJhQ7uyeuvqUB4rIT KXg= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:14:47 -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 V5 3/9] blk-zoned: update blkdev_report_zone() with helper Date: Tue, 20 Aug 2019 23:14:17 -0700 Message-Id: <20190821061423.3408-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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(). Reviewed-by: Minwoo Im 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 3f5e9bf03486..7e0c0b54d194 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -109,7 +109,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) @@ -178,13 +178,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); if (ret) From patchwork Wed Aug 21 06:14:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105499 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DDF2112C for ; Wed, 21 Aug 2019 06:14:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BCA52339E for ; Wed, 21 Aug 2019 06:14:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="O1RAlnrq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727880AbfHUGOy (ORCPT ); Wed, 21 Aug 2019 02:14:54 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:34533 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbfHUGOy (ORCPT ); Wed, 21 Aug 2019 02:14: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=1566368094; x=1597904094; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=dNQR+/WArddUJx9huMcsBlSubmN9JNdoAJJzC4US2gU=; b=O1RAlnrqTa23+EExriBZd/Ie66s0TTz+kcVcerKbEmRK4q04pL6n0Fvv LOMisZ8WpGklLxwVLqHd4NYnNVD2noFkxcqRYTnnb5FCNLJvdQ9kyl6Fh BI5+1Rw6fhkmNU74Q4dTsdYOA8i1Wy4763q66f6VLY5CfWAoP8avgg5+K stu3WHV+9XlEoYcMB5mr3yErMzWucbyuXyFcEPdvgJ3ZuRT/P67Ze1ANg CSjXIjUvNrC4FjnKL3l+xE2GuXeFNSGymxFKvNT2THK00zalrPp5ab0rc eQK6RF9cf12N0vFLwyEYtbV2lL8549GbMYwR16M1xP3ntjAtlJlReA63J g==; IronPort-SDR: QtPJnJEUbx9FyxTGFGOQ+28+nywff34iJ50uyvjsSM+dAALCLhx1YBAwKxW480va++DJow71/H 5BXDvhm2akWvLtP2cvfGftQCXA2jAAzBuVyrQkycVQKRZYSw47OH1AMCeHKzSbTlD9uVpHGOVP sZpFJtu2vLIfeYZ3buMyaUwRBFtjaZEmQkj2635fo2//8AZo5QxzecPrFXPnCMwr3vvGKg0B9n FqoSAD9kLE65nBH7gfax/absNpiF5G7NVDq3I7rnA1HtfhW73i1mU49EfNM6ll5YxxrCnoOqf9 250= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117904699" 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; 21 Aug 2019 14:14:54 +0800 IronPort-SDR: RsDDRzmt1V+Zcx9sYmP64LDNWh4yP++YbAbng+qoqCtH/U84XJhiwvY0WSwveCSDF/B+cnZ9V/ k05dyuClQfjODaNUzqbvYaupvO0LGN7GofrgiXs7yrHH6PcGYLAnuzrv6De/vfjD76Uw2IPaTV ZG1D3T0p0QVfqkxmIS3h+uNLFSWW+HPJZsWuzxzHbozzxcIPjwadX9OakhC3PAT27RK40fz550 wLnYTJbSn+XWPeBMDuCucgb/cAL9Qlt1B9s9T+MKeH09gewmhjD6R7RvOSnNPKgtdKYZGgywOW 09yrW0DMcrrXeVQ7QKDW15LI Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:15 -0700 IronPort-SDR: WGDSV7zozYwbRlbZcH9Vsh+dYPGAeQLVyYHbXF8UemtuqeBj1gbc3L2/qhUPOCHpvgps3+qYTw 6KCzf/ZLXk78xFV6cdmLogFtTGmboLlw3XK2ceoI6b2c+M7ALIPJEQThmicDSyitL7i3yOytT1 v+4Y82D+aKvlSZujII8U7Id+Kevc5LUiaZ6XBwmp2zgzzCpxiE2eRE2BNPGklnoPiudQmcQiOV UcqacoGyWtWWVgxu10FPvyFGi3BggvrpIAb2Pyel4K/An3TBhmBU9rAfhfEJ4/GlAyYSvjR3bp +mc= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:14: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 V5 4/9] blk-zoned: update blkdev_reset_zones() with helper Date: Tue, 20 Aug 2019 23:14:18 -0700 Message-Id: <20190821061423.3408-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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(). Reviewed-by: Minwoo Im 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 7e0c0b54d194..53f9df376cfb 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -267,7 +267,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; @@ -280,7 +280,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 Wed Aug 21 06:14:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105505 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E433112C for ; Wed, 21 Aug 2019 06:15:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF86622D6D for ; Wed, 21 Aug 2019 06:15:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="EA+LZTQs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727895AbfHUGPB (ORCPT ); Wed, 21 Aug 2019 02:15:01 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:20530 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbfHUGPB (ORCPT ); Wed, 21 Aug 2019 02:15:01 -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=1566368136; x=1597904136; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TWIY4zyMbnSdbPfWCQisLpNGsxuN7LEVg7rZifVilrc=; b=EA+LZTQsBYVP8k4p2DwByQf0hKjkf/qjFji+709zpUiveLzuYnp3hyvF cNxrl/wJaP48sNjPQRZxno4FxfEFeB3eRgKVSZz5nxnc0gMslTGNE4jXS 69LFUhVkhM7sAQTqXNl+X47Hx9zhl5hGEvoF1a3L6Yc4c5YtB79BKd5Ef cAusdRJRx2tMnxN5E3tZOE7DzM8K4LvnOzhupyqAUTZJ2ZPWMdhXDF4FP I+GbOeGG3/BlpNtwXp27dHkCXOjuGrV2nohdTLf+cB36JgKQ/WmEd/jTe 52c137Y2CNJzF6/PRDUIgZ5Hy/gYglAPAEi7Hz/fHip+SArBdio4u3c4Y A==; IronPort-SDR: AkOcSXb1xSHhsvdm+qxBgRS7q0NlKRZ1PjV1vMAS3yr+1dxEc7hL8D0IaFjRXE25pcEVQad2gi MaMU/bF+ITqtRboULOeGGhZf97kTb/6cPpRdNHFGv7Dgj/3bq+2ehtOShFnnQnlIXs+KQbm9QP WovmWYQJ5aWowUklvbjON4pHBpIh512KxCn/KJGw7U/7QCye0OHwNgBSCJOGOKg+8AEmQAu5Id ta9YWFnDGnoZ6AJGk+2z+MtZ0heGCqMZLtLPlgjEz+Us+Pn009fJvTEZRrZFyeCm40fvimoHj6 Z4c= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="216721093" 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; 21 Aug 2019 14:15:35 +0800 IronPort-SDR: 1Y5OOr7YVnhPcXqFLuyOgw7Es/7E49v4sq5KtU2m/dzvojM4H9rDcTnFjXDGwUKkwoq6PYdujW N+27bWzLQ2yXIksho1/JXA28HyGf2RR3C0kApePj9ag7rP7Fn9nOd9yO/GVZM5NFGgQWrHPMhl XF5m6xBu9W4dt3I1UdPt/mIigMMuV/AqeAkFLKRonkTX1nmGvmIqmHDcGbt0otjZirsyz0jB2R Ah8pPoGAorDFRFruCgQNetUJfygHDfJMy+lLegw7dIjysRtnRXoD9OPMPt6S72lEbNWEVXWDbe VJsoKFmy9SD23+cyvxcWX21q Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:22 -0700 IronPort-SDR: 5/S77yaPX7vIPc8Ykudto5lXNWJHWMf9k8eRp3VA22ShuUnIWyO7HBQ+5tzxRnuB/rl895d70I 86QpiaX1uJ/JbLojGMgXm9WeY140bDRfoabDuUfUsNls8qwqFznkr5GENwDhjTPYv9YElxi/x5 5nW/zc6pDo9no7FW7MUum92rzmL3Z3p7aRGH12FMJl75j77cAWHqi4J3a7DmFbACMIS2GPs3g5 uX4v7+k8k0zwseAE//uhMbrgJlegwYblO909AXAa1Kdxm8kkfVOoN1UvJESvG3Wy20saiTR79E CZ4= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:15:00 -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 V5 5/9] bcache: update cached_dev_init() with helper Date: Tue, 20 Aug 2019 23:14:19 -0700 Message-Id: <20190821061423.3408-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 20ed838e9413..79c848fa5912 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1305,7 +1305,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 Wed Aug 21 06:14:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105509 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF11014F7 for ; Wed, 21 Aug 2019 06:15:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3AE82339E for ; Wed, 21 Aug 2019 06:15:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="GQISnMNe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726970AbfHUGPH (ORCPT ); Wed, 21 Aug 2019 02:15:07 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:47070 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfHUGPG (ORCPT ); Wed, 21 Aug 2019 02:15:06 -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=1566368106; x=1597904106; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=PRIc+qImYQi0sq4kI43ZLo0IJMblnfPTP0QUTy0nhdQ=; b=GQISnMNeNMuW041BmfLoBVsft8JFH02FZJMfh2boo2rCfD3iM6LA8MO6 MZ5Do/9y2FQxXPD3CYWQlzOjj6ObEogXbusBxsMcaMyi5BuYbLzNQoc5L +Esgjxjz6CPtVzt31hWjktJzAbd+T/fZR/UC6YAtmPF2eNGCGWb7yU6qs zS1VQLAkhz2a8tFXFw6zZjdE2dSi8uHkdNms3gQGBTb/Z98/8NLijys6n LK2J8iE6ZEgovFGdtmqWHuYuir8GKJqewnayI5s91nuh0BmKyOaNsJTMs DkX+yQKx75c7nja9kO5hnw+Gctmi1o9PeV3yGRqaUZNnnGPIHLuPxfE4N A==; IronPort-SDR: 8/A2c3tJUGm/VoBAofwLkUD3No5LVQQ+6VdhnPChhOGTfSvOi7iRPPQHE5Mda40M1mwHJtpHlH MlYB9A04CGLyu8tS0W4k89ByHmfVcinTLMz5FSEzl7l19MpQReqM8coqX6GM7zPmr3lvA/1IK5 l5nb7pxZcHemf2Sp0EEl/3iaQFbQr/Np3tDPNizAtj+qmLQKe+KNDhpGzoeFh4mUhZjgMxiz7y h0d3VA7WnIwH/qvsyPoYUf4nxxYMxldqQXNGhk/pM7D6gFaSnvpdKqpxFDahEFnzBrh8E5ip8I Dyk= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="222880836" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 21 Aug 2019 14:15:06 +0800 IronPort-SDR: RFlkttASNNJpBMKKScjnW+y6mLIrc1+zu/C9ygjzVwAZZaimZBPdBlA3G+HHdC3T6JJPw5fsej bzb0+9tjE8JO7+ctVmlsB/PJRsXzI3Da4gp9VzJZj0pjVdMBRyxzhcUXmaAxOpjeSCEN39JRmD s8bGZaZYL1+mvJpAZo6JuiFfZylFjn834jxvXxA8+yPL3dU8nWqS6CMMSsZAoSu4+aeYIm6Ilt d+rLWxPERou0CIPsr5WTPApbqHToqkC17YPyRXZ7jXMLYOWDSLEQZxSxkh7IwKIo6w+KeE4fR5 Yt3xLXnIgWes+AoiDWNt5XQi Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:28 -0700 IronPort-SDR: 5OITIcW+05bA5Z40gygWOJU1w9CIPQ11BCkLaBNmFn3P/VNeT0sYheeUS/i1HqpgVD2aksn/0T 0jmTG7ojAxndIs1tRyw00R3Gt8qcdicEt+6yTPu8vzUU0i4fpKYySbuvVoWZd8g+Abko1qujuu j4MC7leRfkA7azGPBOWylw7p7ZKglYFk9SHsW8rLlacSj/f7OCusSE3BCYeePrmX6TOsUVfbkX bPUoBBhF6ojUMTV6YAgSaZKf0Yh8+8iUQCm0hYI5wPdi5onYmHP4f2i3PqgeIT3YLVaSFNafh4 3zA= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:15:06 -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 V5 6/9] f2fs: use helper in init_blkz_info() Date: Tue, 20 Aug 2019 23:14:20 -0700 Message-Id: <20190821061423.3408-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 78a1b873e48a..78f8f834aa44 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2775,7 +2775,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 Wed Aug 21 06:14:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A79D14F7 for ; Wed, 21 Aug 2019 06:15:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35866216F4 for ; Wed, 21 Aug 2019 06:15:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="fvIMHJZm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbfHUGPN (ORCPT ); Wed, 21 Aug 2019 02:15:13 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:47078 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfHUGPN (ORCPT ); Wed, 21 Aug 2019 02:15: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=1566368113; x=1597904113; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=D8YDUL5tZ05jSVemJWK/Wkcu4fkxmHw2a5twadHpA8s=; b=fvIMHJZmy7nxIAAoibjPzhsQguo6zFDc3jnb0nelgobqNC77sLaG5hGM FIa8j7xHknUPE7ux6Ptgv097FD6W7cS7l2vGTF8Jsjn3fLfgWDySo8rU7 wxQZdG7vKNUdoaB5f2H3+RGyXkXkZgRAHZ3rxI2/tTkzQW91kcR30sunh PZjAtFhltBYAFuJ1tODRVQBTeOtzGrUwzgMCp6ZuFpKJ00XUwRn0uSE4s F41NhM7FdQ5z0uhzrcHQnj14HBVlqlh2DOl2gtEz+/ijvtKBpiwRdhrQa aLQ9ge05xmrAwKwLwes6+JJBW3rRtagP0uRrxrXCuN8RB7hIbjvzrpEVN w==; IronPort-SDR: h4xAvQC3q6mfo/XYh0NIxyMbppFaBpVOSt3TXAnbVcrpNhYUIpStxev0QyvHwTjoVQ7J0qbYC/ j5EKmfGyAuUYWsYJtDAoGZYMPIdKv5ijtG6UBqMXsDKLe8rc5UyrgOQ+jQ6anxmJEZAdVbaVeG StAwf0e1k68eUZVPsFSI2tn7Odry6ngxGW3kRAGdvALN8dKz6xfE90ZifSZ84zMrTLuEIpT8sa C80GVJCWP0xRE/dMO5le6JIxk2trN2rknWsUgFvb8vMbBNh+8qsNBFZB9D9b0J/QseanmShuXp w0Q= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="222880857" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 21 Aug 2019 14:15:12 +0800 IronPort-SDR: Vi9f/McXNG7htf+Oiz487a2aFGqA5HqxQzYxDtCxAg9pcdi18lHp1G0xcRV5pgMkDm9XLKrQVv YqCRPHP/m9tsZbs0nTtfyEgrnlCpemQIjHkrxxOPdI29BnNQkMtJx2DY72vRIRCWaVVSu7kgYE 96rAnyR88fVxy+LkriHGzZxr48kx4w0lh1v6rmZv5fbV0/ObwPgymKJP367m+qB884ht3Hcgv4 eO8+k/zbSxtw+atpwL6svHcL1IOYLu5Vda1IFawyAtonAnx6kBNl5k3GxHtQoTrymTO/6BoXaq 6BMsGNdad+h2mvKTsb+b6Jxq Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:34 -0700 IronPort-SDR: BYJvRAQ6DwECniwHRLKaUr9x6qRGDsHdaIfg1ud9IVxV9yCvCNuNuKVUzzdBhpZt47I0lH4/y6 r8D53/P4Z9aK688Qqew0ezt7T/dj/JP9UbtCLxA9CqauIB04CofRKbjlP7H/hR6qwV2wLWIY73 tGseFCARD4wk5lDXH51RNjF4YV0l1IIhsgm3K/Cp29/2cpd8FPo2YMLKOYoeTxyJ07eENw5NDl SHreBRLB3prhQjINcF9sFUTYXHo04Vn7uy1MBlNW+yKasuLS/7NJkLGl8Z0zDzbZJCuoLufFp4 AG8= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:15: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 V5 7/9] blktrace: use helper in blk_trace_setup_lba() Date: Tue, 20 Aug 2019 23:14:21 -0700 Message-Id: <20190821061423.3408-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 2d6e93ab0478..801f8c465bff 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 Wed Aug 21 06:14:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F29F914F7 for ; Wed, 21 Aug 2019 06:15:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF560216F4 for ; Wed, 21 Aug 2019 06:15:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="e5r254pm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727138AbfHUGPT (ORCPT ); Wed, 21 Aug 2019 02:15:19 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:34576 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfHUGPT (ORCPT ); Wed, 21 Aug 2019 02:15:19 -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=1566368119; x=1597904119; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9HCTUA025JIZSm64FGSGpZxpfChbQ94lvGtg+dmKvTo=; b=e5r254pm5f1d3g7KHFGUkhwbpdrg+7+BozZ+BYNrFVIs8mMlU7uDoeCW wdLy1RTcqoPuR6BuH7VZA+QD10JieCZE8UH0ghf03qnWZx9WGSpG/pIRJ Z/X+fMpb3lC5VM+OUD8baO0ih9guZ40iCLES+xQD1dRlxxpv23qRiK0Vr IbEWm0POGLWgYcYk5j4GfMWc7RCqE22pRUpFO2eTi4gqfdnyVbC3W5Q9C 1ICu2gSNFYcbQ1P00IroJAvHmUmqEU+6lTIKrbvbO5RW7S9wnnNvD93O7 rUnRPAu2ELl4YwWuNyGMtQ+1FPq/bRljMurzC4YzJn90+dhthu/lVFx5y Q==; IronPort-SDR: eD4MHxrnAa6mK6OIuQ8pEcDBN7erQFnRfZPHad5zOLrPkIio4dIMEdt4F649RQpbnD2TLJQwhI qqbJvMR/zeycO76gQaHBTz4klDxkzapParWkZNRZF0TbuH+T6Zw0QjrOIGUpRiHtAVMwmUyW1I huxDeADnts7wljHlaxORKr03uOjR2z7eW4tkSY4UAb1PpV4xbYAbRzGqJcXIy9Z0wgBWQ7ZO/J /6VIbQqYvQVJymiv2q3015T9QyEPN+lTVpYcE9jX8lRLXRzlKIxHUDNv95+3jbnOLjjTy4fYet 2LQ= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117904728" 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; 21 Aug 2019 14:15:18 +0800 IronPort-SDR: lk+I2OtviS4A0ddhsoaX8Pjmp6dgZSdlkmj96UpYIPPnODEDs10JtZ5/50HqGL2bNhDMMMWS/t WxG++gEhnNF2+X9G+DO+uJsiqJ1/oa8fP9KDIcJRSrYdJVYbO40/RitjpvoAtCAaJhaid98msu jyoLeUGT+H1dgS736WnTwrMz4E7DH4a72jN4MHMnO/E5ODmcpci3LjDa2wNtW+SXZ8883Kw9no bdYIUP0FgW/CCdt8eTQcWzBFNDVKMer1bXUnd928e5Kl567U6GdmaR4GLCIP0cciHyp2n23ijf Mw5FDOiz2SCDnkFD52CFTluL Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:40 -0700 IronPort-SDR: 1yyzw1PKyEPWh8uB2oJ4KRZ7o5fJYOCS3TLjOfJjglT/lGWvLyF7NmCbICpqjeV9uwoFw7sBmV nJoZ8sJ5Wdusbzi2NM2t1/6bvQvetVzJBResAGi6iRHNn8y3zCfRh7I9MBJXBsny6rNr83aMIx uqewzTGkqWRbDAG1nxzDKivWsjDb/QHL9tkpqMGfM2elRtbSBA3gZ1zdEE2ldZAXE6deT1xBWI U7VASCa1lSf94SNnDxADwyjBizyM8Y+ZkI/gi6oZJV3ZNsGYz6OiM/GGSlOshqrL1LpuA25Xqd ZrU= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:15:18 -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 TESTED PATCH V5 8/9] target/pscsi: use helper in pscsi_get_blocks() Date: Tue, 20 Aug 2019 23:14:22 -0700 Message-Id: <20190821061423.3408-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 Wed Aug 21 06:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11105521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91FD214DE for ; Wed, 21 Aug 2019 06:15:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 70738216F4 for ; Wed, 21 Aug 2019 06:15:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="MhoLzyal" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727831AbfHUGPZ (ORCPT ); Wed, 21 Aug 2019 02:15:25 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:37713 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727818AbfHUGPZ (ORCPT ); Wed, 21 Aug 2019 02:15:25 -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=1566368125; x=1597904125; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uCmqVTMs+9n224hBF85AnzvmEf4HCe67ga81BlS6HHI=; b=MhoLzyal7MPK3ctpoS9qPOM+HyTdph2/v2awfa8qpYPLcpSYATVrcy5q twrsrWHD9zoBZJWwRqvB2m4NGOfg8LQS3h6o4zrLTZPz+l9F5dEnDKgUN 24EKwsldxhKr1Kv722M28/YTC9ddECMfuaiGM8RvbrG/h/djpL0p+hIB8 sd2unZLNqXzKVwtFFSrpCDtRhLLHOYOqtKwv/swIuOcQIwvjtdMJa+KdF C7lxYTENDYscA1QfyIbZypb3fsCZGDS4jaDrGrELFDNrV0KiRdsPX9NLh TbfN0rb1qT0puC2CPiewxTmOptI8a1j54f3NF4F/qRx3sEE8li2iq0x/q A==; IronPort-SDR: 6/XICoeSWbHOQoldRyXAeykBwCQRKQRoaA0aDQQB1mHk/sEEfmCVfSHrwmWN9TkwFxngxWUKQb N6vBDDfXHERuJuZz2m1p5gASdBszbyLuhpbvJhym9+fGLnNcvo5RVHCy6XYVYKTDNl9XDsuG7m kw+GDhXwxwjEw4BAHvg/GOYKC5RmLH/FXF3+iGFzKU8gXHq7ki2JjLqpmMvMMQI3UbKnTo49Zd KOm7Q1EDJ4G8xrauOALESTLbD/6vcPeZ/D0zeQSc9QuT3OvRPZtOwkvtyoh4TMHpqO74bonbyP QQ4= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117239112" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 21 Aug 2019 14:15:24 +0800 IronPort-SDR: 0Ohb5ITSJVXJbUSWe7fW0QkaUZCAdmwPIXSREYCv6/y/OV8jK6RNUZIxRwUdK1yJEBU1d95pGA HzeGgAaS0JVi/sM9Qw0bxIIFHeJWePDpB4nGPvbBEXi9GFAZCR3Wq+fX1lwNcuXjKffKvEpPBv 3ymXJmwrtfQLKS7RQZ+Rd/rK7D97iB+WC98kppMbGKYkkUtA3kdMLWfLQG7V3SsgDwgJ1LtDN/ rxoSIUYKAgSLdB9c8K1ZpdNfgTCEf69G0wGS/iWr0szlLKWYFZLqHMCF/UNe+HK2Al0/jJwpFK 67coq3AnDGhmi2S4qG9UoTY9 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:45 -0700 IronPort-SDR: OdxGZ+ZIUZXNxHsyk4r1jitBzzOKbws59uKyfKyGqxJAsocaYs8oIxpzZfzjt5ML1whAzbLmaX RwM7I6UulMIpLElfhfQc5hYfBEAbff6XiTo6OdUg2IOOnMUz0R9KML2qvnTlEseLVHNS7pyeSc 9CTOUyji2b5zizhazjbzfCPSVvgrBe56YrLfQaH1Zt4rfNfxQIaRAfBPRZjR9OpapUegl1b+jL uJtoBjulj24n+tVENNu5L8VD++n13brc0PAUBMrQdHgf+PQ6TPFgyBzEVVQm4JhNIRu+VBGZP5 OFY= WDCIronportException: Internal Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip01.wdc.com with ESMTP; 20 Aug 2019 23:15:24 -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 TESTED PATCH V5 9/9] xen/blkback: use helper in vbd_sz() Date: Tue, 20 Aug 2019 23:14:23 -0700 Message-Id: <20190821061423.3408-10-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> References: <20190821061423.3408-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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(). Acked-by: Roger Pau Monné 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))