From patchwork Thu Jun 13 14:59:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991957 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 31A2014BB for ; Thu, 13 Jun 2019 15:00:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 223F0208C2 for ; Thu, 13 Jun 2019 15:00:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 166D8212D6; Thu, 13 Jun 2019 15:00:11 +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 AE70B208C2 for ; Thu, 13 Jun 2019 15:00:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732827AbfFMPAG (ORCPT ); Thu, 13 Jun 2019 11:00:06 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:40636 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732823AbfFMPAF (ORCPT ); Thu, 13 Jun 2019 11:00:05 -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=1560438006; x=1591974006; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VBC26O1p/NtpU2PjVzYsY1MQoQe3JQazvQ/PjsDbWN4=; b=DGFia5/9yooq+Xom5nEK2BdrIDLzVHeN9GXtc9xh2Wqpl9v8evoZ/cfE hhrzZB3wwifnRC1qSDDmj4rkWaHYfwVl+OTHwWD7Tn5wlCopN4c1KmHoN TrAOTb1Ul713lPPdsxsemfr/e3mJD+VJUWI5o/4lMkQqJlDGwDvQs1/S2 wVgy4mAQdUT/syGtJ0hYEiMR+V6bYlo+m6s44Y+fzyd5R3FRgGfKooPwf 7nreCalimDbFeonXbrHP2obsKvnUsasOu8uWDB2P/n8VVFeGd7fP9Xkou W68ImWj0N8vzKDj/a1iJ4nLCYckxcvXyjExU8/Ne9A587MLUWiUfoRPnl w==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="115418338" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 13 Jun 2019 23:00:05 +0800 IronPort-SDR: RihYE+Nz9olAJKOoBJ6gtR3ByXy0VuCdSKc/24Bz9BsAa5zeXBG+0ZrwPDiH+N4cNaxhftNGSH KB5AAkX9n1T89ZqZSWVziNnOZGhoQPAo5AZHI6B1hI1aDZtIcB2qPJ4FIle/exLf24GYBcjCr4 hUzaDj3ynSH8KzZlLXBN3rqw8YVOrCYlJDfuN3Oi/kMtnFJqrGoVo0puSoB4JANrtLjf8kKuxs G4MRUE7vhU5xUYpqEQebuCg3QQQNzReqnZee6mMxJG+xuyHFBvDuoazWJIvvjyOgD465UFh+lL 0kVM9+he0HBNktxqQ1NMXtwC Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 13 Jun 2019 07:59:48 -0700 IronPort-SDR: h1RuY/8orlvoKCWmBZmvrXctNkzEu5YO4Th1rUP0mWjpFbDOMJv22E2X1f1BG0pD0VIUvGRF/K wuMVQAxd8n91gbNYATRmm+EyCJTmPddVXOFOPAZhHDKlfVqRfiYiRpRWPDXBhNJiwHjdYzHe0E IYnz6VNunrAGQflRnMo2mFcQKnS672rTQVYa+W8wn54lCwOeUqVvsqtoIEytv7ME75LBj+gSVX nZsS+vZdZdh6kzMIDUlkCA3HuFTTbeCyCIaqLM1aTds/j/zJ2O0eAK/ylPue14nNlWiyq066wU +XE= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:04 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH 1/8] block: add a helper function to read nr_setcs Date: Thu, 13 Jun 2019 07:59:48 -0700 Message-Id: <20190613145955.4813-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces helper function to read the number of sectors from struct block_device->bd_part member. For more details Please refer to the comment in the include/linux/genhd.h for part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- include/linux/blkdev.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 592669bcc536..1ae65107182a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1475,6 +1475,18 @@ static inline void put_dev_sector(Sector p) put_page(p.v); } +/* Helper function to read the bdev->bd_part->nr_sects */ +static inline sector_t bdev_nr_sects(struct block_device *bdev) +{ + sector_t nr_sects; + + rcu_read_lock(); + nr_sects = part_nr_sects_read(bdev->bd_part); + rcu_read_unlock(); + + return nr_sects; +} + int kblockd_schedule_work(struct work_struct *work); int kblockd_schedule_work_on(int cpu, struct work_struct *work); int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay); From patchwork Thu Jun 13 14:59:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991959 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 E7A2F14C0 for ; Thu, 13 Jun 2019 15:00:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4B12212D5 for ; Thu, 13 Jun 2019 15:00:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8B82212DA; Thu, 13 Jun 2019 15:00:13 +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 4550B212D5 for ; Thu, 13 Jun 2019 15:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732845AbfFMPAM (ORCPT ); Thu, 13 Jun 2019 11:00:12 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:28007 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732593AbfFMPAL (ORCPT ); Thu, 13 Jun 2019 11:00:11 -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=1560438011; x=1591974011; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QMnJHJeyK2zBHP7uZNpeZhh+2JxuOJeP7H5x5fxlm0Q=; b=ku+S1AH64wC9MZN7qXgoHzXCeJGMuheAtLguCx+/IcpU0b0MYPzP17NI 1KbKwhttQstJbIYtT6xiUMaBUj+jqs/1PSsBkXMOOS67j7CykkL9rvt44 HEVTkAK/7x6zdIJ7AP1xnLFjT4yAO78PDbG1lsOIdxT4BU5TggDUU2G6+ vDrCnxJ3Yg2Xfyk2GT3aJMxXODeQm42qnQR4vO0i/j/KQzyK4F/kk24Su qJV8f2xwGki5ePq8Afw+yBkLv1jHTE/azYa5+Ll+SnNVVX9BaBvgRz/Gw H5WjtHgrXK4fpm0TO2iQJkk6K76LfNy4eIxttfNQJlY16G5azR57beM2I g==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="110477836" 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; 13 Jun 2019 23:00:11 +0800 IronPort-SDR: 3hAtYaPybUCW7IherzczATAwuCdqRCNooFDtD5kF3THg0GUhpPDfWIRM7XRpU1rMfd+APjKmcU VYjpu4KYAe7Y/sHT8iIKabN2gl9dlFL/oJw9YJUISM92fIkcxiAyjMJ8UlRaO/Roa1FYJxdfjq lAMfKglXoHzBupKlr6/W4Wh/Axy5DT0X6/5nrir8I7jfoXN/TLIj53IRBUhsixhrOHBT5xaAAa KQFg4DsVzoeNvFySTxwfiWHpIZwEpw7fdcqm1jiwhCXTbbCzSXovY4QDDOiB6XDfkO3Gv10YvK /YwyH7j6sTAqXuWPwNl/oz5h Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 13 Jun 2019 07:59:54 -0700 IronPort-SDR: dz4r6fkdMMQbaQ9czUf1eIUpszHIPH2SCzb4uLNzZPD81N/J8lYnhxpeuWEj9qMJuVfRc9tbXx 5EN9/T5qzl/OIrOklF9L6hFGOG6VWV/rx1JLvNDUZ7HmyQcAyBFqYCiLYVB8FA7t7IQzykJGVH Yx1PneSFY3+KEsUz9LEklkhWeC9ZBhLcHQufoSykCeZ2Cz7nug5/+k5K0t6HJKezZ1RaD2VnR7 UsZwQHXQg93U4mt29VFdDoF//VhcHBBwV4uRhFPCRGS2PGOdxTtJ2WvCFiwDs/3or+ILCjJZo+ JaI= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:10 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH 2/8] blk-zoned: update blkdev_nr_zones() with helper Date: Thu, 13 Jun 2019 07:59:49 -0700 Message-Id: <20190613145955.4813-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_nr_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read() protected by appropriate locking. 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 Thu Jun 13 14:59:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991965 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 DFCB414BB for ; Thu, 13 Jun 2019 15:00:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2FF52022C for ; Thu, 13 Jun 2019 15:00:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6F5D205A9; Thu, 13 Jun 2019 15:00:20 +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 6EA812022C for ; Thu, 13 Jun 2019 15:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732850AbfFMPAS (ORCPT ); Thu, 13 Jun 2019 11:00:18 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:40654 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732593AbfFMPAR (ORCPT ); Thu, 13 Jun 2019 11:00:17 -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=1560438018; x=1591974018; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wytOX56Llp9R5Ix3gmRA1mJrjb5IFGndC3dWCSN9gqw=; b=CSf94yE/LqyLoGlHolaDjC3Ejo4T/sKcVR9mJq7p8HOXhurYtwNcz2q0 lFNfhaaSJzqksse40XT65jtkgHGYllv3IkSe63Mm59XjYVu3wINCnPSjd t5HbIpPZWYiItjAG/cH+665ogIvg9xmz0JwgPmdD3/HWUGdjPPF+MiF5W 54bwBFu64UqT/6SKiHQstQHX3LlK2O10SJVIfYiCF+MWM1iUkFglGkvDq OgbqTe7LsmFpWuvh5nBJy2iyrN7ctvK238PVgbHGiuvb5jgEgGBTrdmjL GqwkzGcAL3dSNHIpzvb/msmUNyV6x3c3vFJt8cPzq0IWtpqCMvOmpETLY g==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="115418364" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 13 Jun 2019 23:00:17 +0800 IronPort-SDR: ckkFWwonagJQN6zgOClvBDRPOhKsXo0lAZp6tAvcSLXHqkbfOFw57PbxREDWw9LEUqIHYg0TnH jPhRYs7T5m1uZEmUJmVlCpqAGd3DQNrFOxxLJ3NWBscmNYhzi8yfhpU16mbU/rD5WiVcqzHVG3 EBDwHfWbuxlZ9892qlOOukmsmy2HCduB8XAymK4LyP0ZtrIUcqzUmgw5Zo4bzWAT8/OpHv3/3R CerhOWvTo7xoFSEwsQgBeS5gbMBDUh9dZUiOg10sq5LSEJT6KcFYka4AtDd6/ht0ngZ8dJtaMo I8dMyZ95xYa8MHbXlm/TOXD7 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 13 Jun 2019 08:00:00 -0700 IronPort-SDR: 1nJW5aoBERQkIvJHOBaJModWGHLvHv3vgNgcRiAJIvPKseZfoNvls22FiZyso6lAZ/l2xj6so5 tguAjAWysrzL6gsqdqjIe/0+fMQP8wSLxDbnaZiApzOFZUjHeiSKE921qR0B9eAHiupuFlgkVt BWdlcOn48mSWg4t4NCwgETJDmOBVbi3jMjZavjgoVLWdJIVjG5LxWvSdVDTt4FfInTXvOJrSNQ D6z9ugnvobWx8jw3zScv/3IVW1YehiPJpj+9A5x2yxEkLo1dUiTYM9cUZ3mmaWp3e8YVpvxInz PA4= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:16 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH 3/8] blk-zoned: update blkdev_report_zone() with helper Date: Thu, 13 Jun 2019 07:59:50 -0700 Message-Id: <20190613145955.4813-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_report_zone(s)() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read() protected by appropriate locking. 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 Thu Jun 13 14:59:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991969 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 A819A14BB for ; Thu, 13 Jun 2019 15:00:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9913A204FA for ; Thu, 13 Jun 2019 15:00:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D802205A8; Thu, 13 Jun 2019 15:00:26 +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 4AFC1205FD for ; Thu, 13 Jun 2019 15:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732873AbfFMPAY (ORCPT ); Thu, 13 Jun 2019 11:00:24 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:28024 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732868AbfFMPAX (ORCPT ); Thu, 13 Jun 2019 11:00:23 -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=1560438023; x=1591974023; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DOgy94QccoYOl8BNrpBpMwTFlXUNeTceno4ux0l31BQ=; b=IIPp6kS1rDY+KqzdkI8nAI8s3o6IlnNHGnft6juWeQYJeg0PXAkyYdBI oYt22vr0hD//Fnphqv8pVT0WKgb6MbGOaybQXBO9/U0ZaQK0FJfeGRTv4 uFRIRAPlywQUJtJNG7pjpQBw0f4DQAi1H1KCpdrqyUC0z3fMHBbQ/nxYc OKsLc9+V0zaDiIYuRi6Jr3gwFPjOWy2Mu2WNC0zkp6gZmeyw6f9AATPhs 5BJwSN73OVqgQfeiDGI+phvFc7a1aggLQ/L4olXa14pgd1Htg556A6iih d85vSEvXBlC3CMqCJIOYGEL+GylSDwmnS9kOmSHIeBMYBfi67noLHN7va Q==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="110477889" 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; 13 Jun 2019 23:00:23 +0800 IronPort-SDR: 3ZBSMsUX0zBe91YtOrCB/G5mlw4tbTYHipvQDOFnKy8F++xtPSnZiW0yY/tXBKKO/h131RhtCy o6X8HpVoq8af/oBKGX2uHg13zhJ0t/yLKH9km4hdgzqc1C3uYac10oMMLhGMjGou+FtgT3fWfj qERXqJh0DUXbuCC56tEQ4hBWorJ3QlbwD4L62pKnOvNNgJxS5KLIp3G7OnTIZYSbVSB6G4/+i9 yuMfwIbUTTSJkvhHNkN2eiL9anse9lY9utnY0h3Uizd27KjSAttj5J1RYCA0igULT45yG+3V2F NbJSybk0Jelwr6MR2XdVLnIc Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 13 Jun 2019 08:00:06 -0700 IronPort-SDR: pbpA2y6HwE3tNh1R1zJZ30pgpN39RHued4F1JDg3vRN64piaUZfAcH7khujOnx9Mgk5aiSFyGZ 4IZCY88eF5mjNj8CYyAuyiX9WSXJw92BTbpZI1UPpNKseJJ7L1ZYzCIQfukozUSCmxUajmbUtE qWFfmDyJFdr6v5lDecHIOnvMJU3uHRts7c/F+vaj/Y5riUJ8iQ8wACBy0OCOYyChSkZ/7dV9jB QjdQBr+PTQEhMepxFwsSU9sMvxqUQIgLyz5qTMCUysvMK6Nw21IKHhbnVOv37ZniVHtz7AY2Uw BqA= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:22 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH 4/8] blk-zoned: update blkdev_reset_zones() with helper Date: Thu, 13 Jun 2019 07:59:51 -0700 Message-Id: <20190613145955.4813-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_reset_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read() protected by appropriate locking. 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 Thu Jun 13 14:59:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991971 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 7B60714BB for ; Thu, 13 Jun 2019 15:00:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69BE9205A8 for ; Thu, 13 Jun 2019 15:00:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DDDE208C2; Thu, 13 Jun 2019 15:00:33 +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 0FE19205A4 for ; Thu, 13 Jun 2019 15:00:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732907AbfFMPAb (ORCPT ); Thu, 13 Jun 2019 11:00:31 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:28031 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732901AbfFMPAa (ORCPT ); Thu, 13 Jun 2019 11:00: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=1560438030; x=1591974030; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dPhUA1+cc13a48v9hC5jFZOu/fNuKpP1r0BY+977toE=; b=TtC2JPv89mwKfznCzrNa6iXc0sfMHC5RgOEq8MHmjdBH6cf9giFS4x0A h2kqI194vbbUK3nNvKfLiWdI8cyMo8S3ghcwbBoRZeMPnweTNk/je00+L EjIOaLUbIkmVh8YGFKbgbuQ/87w2Gph9qBHoxkoJLobE2ooFS7XxRjpMa HWlYSOgzR5fcM8uR5PfZqjb0Q70/fkvMduW10Hb9H09GjO9OW1/88qV1B nEeYNu5G/b+Ouw4WLWQpEcdEY3IfzlXiGVh+t1zr9f5hOLKvQEiGcQiYH hQmQY8KMcdcSrlixOz6LCBSkHtgcluAsh5O/Ri5wCeJwEZAzFcM1aIBJG A==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="110477927" 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; 13 Jun 2019 23:00:30 +0800 IronPort-SDR: 5FoQPSooDdZfaEzgVHwrNyHKUERLDa8BbmKJySmBJyxmDfflSV9r5CNkQcJ4VtlHvBth0pk/kj rhGJwEbTh7YwnHkdjaZ/QnLGsYfvOIXyby5PhyHxAbomBzc1rRDYihmbyLbyzSO+pkRFQqqxwA 7CySiSSpgL3MPJibXNq060rlxLxUvl6YljMDghtd7a6n/H+AWLsgBcUZ24JFi4lGkPcDcYZIBp dwExuyCmBdYYyhwG/X8Q9iZs171r85/atnsPJkHaHQO/9krBt1X9M2PZeqcUTseyJQPNNiqkiY w4fzj3NXB5OPjdZxaXCJUjcn Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 13 Jun 2019 08:00:13 -0700 IronPort-SDR: LMUwsamurQJ27M9W1XdZRzdaCX62e6fvBH48L5GtZmtaP5/Cfr7XkPolh0Ovj7TECZYOmHmCSe WaZKa3XZP+9Zqx4j+h/dW3Kh/UGLXfDzNsVgPFufk4rj59Wecn+VMK1SwGe0Mfdcvbd639u8xV tTejOOrYQXnXK7jyHMcURl1TEjTI7nDT+jWqifhYNMkbnLbjCOBZGHoQIgJuSgLfpmdS9sdo/+ RWeH0JkgKC6NgjsavVjQ/Js98NRhXPhA2vlDi/jR2E6Ag3J8WxewFyry/kjz48krJeV+b+qS0G uQg= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:29 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH 5/8] bcache: update cached_dev_init() with helper Date: Thu, 13 Jun 2019 07:59:52 -0700 Message-Id: <20190613145955.4813-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the bcache when initializing the 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 if part_nr_sects_read() protected by appropriate locking. 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 Thu Jun 13 14:59:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991977 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 68EAC14BB for ; Thu, 13 Jun 2019 15:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 570FA20CCF for ; Thu, 13 Jun 2019 15:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B61D212D6; Thu, 13 Jun 2019 15:00: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 0BCBF20CCF for ; Thu, 13 Jun 2019 15:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732947AbfFMPAo (ORCPT ); Thu, 13 Jun 2019 11:00:44 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:64461 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732938AbfFMPAn (ORCPT ); Thu, 13 Jun 2019 11:00:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560438043; x=1591974043; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O5KQeFcpa5oDQTKNk9Or1W6DnU5mVrpci4gg06xOIhI=; b=kMy6KwGUjYo0P4RJSKZf6X1cIQGJaj1C7pLwhy44/UO40k21S7EAK+jQ w8IZ/hzurgpJplij8fbmOANG334FSbFWsAA8kdHSxRvrkoYQfdiu+3J3D Xxsfa+6VE0mK0iTFqeRRqkPvMRmtlN7JSbeirTcj6ahKKsmXqXB0gmbBm hSqrmkzRfWVS6vg9fqSNtFJWzckGQISLyKOdu5O3DWi1i9Y24iAOjSbE5 98v8xX3hGBXEAc63FFdOR4jmfU8pEo8GQII1YwTFRiiDiuAWOwinpO3G4 tPR17cA7urhau/CjzbwMkQpFUf4nJT3P9rZ93ZRm2gxA1Wv5+zM4187eI A==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="112137108" 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; 13 Jun 2019 23:00:38 +0800 IronPort-SDR: Sl509DC5AJd4p74XuFa74uUUmv2F8n3G70Oc7oals+9CpABVzqkNwiOdhD0h7L/tGpI5Hi5+k5 JIx+WrYTp/BWcq0u4rJlpi/pOAcq8znRrCqL40rhodrL/IOnDjHMqsAouZNhFDG4LRtA6aPKm4 pxwIDVX0ejBmR7e2/5ilk0tCsEOxTE1/eJYPbzBk9AAtvOf9AvYjLeQATXpxgU8yxoipvFeZxb QpQlLTy9PoVvxpvpV8P1TUMsMZjgDsrA80dKsPPh7l5kVItlWUlXy9/diO2y9Xqgl0z4R/GyCe 6zg1F3az7L0N2sYFau92kMX9 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 13 Jun 2019 08:00:20 -0700 IronPort-SDR: GvWuNW7r2PV3qNc62iAsDmdDRIJbJV6YnZnTWhRilRu5TXO6729tqaTycEJHEjnpobzzMehZqq CJkJTOtD5IeTiQ7/vYdEM8r9tAciRslVf2ANzgWe/N2JD7gT41wzKkVBantCxA0VH07BmZ/ktI 6YzlykAB5Z5R0UjH7SCP6q6lN9RCPwIBNRQ3CFpEHd6TidW56KxCRrRjHQT2lLj9+2vFrj/5ft Yg8jBjFqMDaJ27NAelHpRelSW4wjhG7nXaLwBD+z6Rqj5IFJC1fIAZOihZZOZF6mtDLrAKBBi5 FhI= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:36 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [COMPILE TESTED PATCH 6/8] target/pscsi: use helper in pscsi_get_blocks() Date: Thu, 13 Jun 2019 07:59:53 -0700 Message-Id: <20190613145955.4813-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the pscsi_get_blocks() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read() protected by appropriate locking. 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 Thu Jun 13 14:59:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991981 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 36E1C1515 for ; Thu, 13 Jun 2019 15:00:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2668820602 for ; Thu, 13 Jun 2019 15:00:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18A15208C2; Thu, 13 Jun 2019 15:00: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 CC17820CCF for ; Thu, 13 Jun 2019 15:00:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732877AbfFMPAr (ORCPT ); Thu, 13 Jun 2019 11:00:47 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:28067 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732943AbfFMPAo (ORCPT ); Thu, 13 Jun 2019 11:00:44 -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=1560438044; x=1591974044; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DoBGRhewgNmovFqTGu8stJENDg0b73ZhN+6fsPSmUI8=; b=T8/5m2dBJEqkuU4QMlSiER1HWfIjiMn1Vg/z+77vNjKFMPOy3pGUVX6O rxbW1CoH+t57AIS85k5sqG+6YT6hJTM9tKGmHNCpgHbQtyINF5j7Tf6FG yER4vh7GVzZqM5QfQt8agS1PjoNiuvJiTLLUKIBO+WjKFT7/QGY+s+wfj uQJsMpjvNW3+ie/FFm3Q55tYXS1lApRKKHRrW7feB68GX69osFYGC85k/ QHKPS+knKcV61xi0aePE7PEVyrBbwvHK+1U6pr235i05lwSt51pLs00iW lFyTNrJlhC/n3O/ZyAVv5hS3325A1VTTE93+AIAmmN3f07KCjG7tBrfAp A==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="110477993" 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; 13 Jun 2019 23:00:43 +0800 IronPort-SDR: AENcPtSl5QXKYVgSyYPN0ett3/DwXmCJgpHL2V4fciUgOSHsJS54ljjvgdr4e6ojii5jir+tP6 1zjHN0IZPsCXDYgDmdiKVYbC8OPN5qyt/9CBYKwfVmt+j3ZH7jS5osLjVhS6c8sfDrg/8pxP2I MtKTeTiRR6TUU7WcnEGixx5p+ekdPgEvLxXe40UpUONwT2A8yIRvYwFyhEJ35bqPm798bkzbpV Xu0Tb2l4DimZi/9S0/8WFqIp5n9GEeyPrfPhAO7Xjv925G8qAmqN/TPngDA5+KMpOr9gld5Vh1 e0162sjXDMcop/btGyKVxa41 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 13 Jun 2019 08:00:27 -0700 IronPort-SDR: HdXhwhVFHJ/3YmppU2XrTWFWGN+w45Th/1CzVBjqxDbs6kqOiTr1AH/oo75WxkwJypW0fUKTuf 6H3WJMcesJLrgDL/W9CxMRft+C3zvMYK5okwUE0rtwxwk1v1tZKEX7Ui87RSUi6/WxbiDuBnWW 93l0C5PWf+wVW+AzIL0pSURMKkHAN+eHE/Sf2IGxlrVd4zirTgBlXsHF5g7beGE2KBZAe3siUw 2FiUAvPpDLZ5Q1chXiLT0CXSdW2m1XEDIKMJ9FEAvIKEBdKW3aHFX6AacRV/ZP+viDnZ4fkksV KeA= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:43 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [COMPILE TESTED PATCH 7/8] f2fs: use helper in init_blkz_info() Date: Thu, 13 Jun 2019 07:59:54 -0700 Message-Id: <20190613145955.4813-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the init_blkz_info() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read() protected by appropriate locking. 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 Thu Jun 13 14:59:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10991985 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 D05321515 for ; Thu, 13 Jun 2019 15:00:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C09DF201A4 for ; Thu, 13 Jun 2019 15:00:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4802212DB; Thu, 13 Jun 2019 15:00:51 +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 5B5D0201A4 for ; Thu, 13 Jun 2019 15:00:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732959AbfFMPAu (ORCPT ); Thu, 13 Jun 2019 11:00:50 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:13747 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732854AbfFMPAt (ORCPT ); Thu, 13 Jun 2019 11:00:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560438049; x=1591974049; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B/236jbkaiRrkc0lA3JhYQDl5t+iiEvCT4RzOYq7iYk=; b=kBOpgLs/WwdQ5qgyUw0bUubiqyl0GG3DWqRYcnv1OeGnof/qbdlX2T/H zBeUH9Y/vhE3L4zTaf8rZYN3CuoKNfGefV6dGXrTULeSkJYXbDvnq6e0/ mdcDYLw0ED2zb9qzSxI49GRoVU21lWRuTa7im9m+Oi7hVLb+AqUH53B9T wLSWEX/AR4KBwouv4PNW97R9wwhLfi65WsrxjmAXis7xX7VaxtsBNSNZ5 +xA03f9PKtEh6wBiW53m1srmkWdZ/bEJ+fQdLP3d2ZZO7spFBojC5Fa/+ 852huZDeOOyklG6mORMAZhta59GdSPbsd7MB+Ge8/UuHN7hOd+Cmt1YP9 g==; X-IronPort-AV: E=Sophos;i="5.63,369,1557158400"; d="scan'208";a="216832963" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 13 Jun 2019 23:00:48 +0800 IronPort-SDR: EJ/q/CYe96umvfGn/a1qXmkKWG/MPfTGZG0uBMFUi0z3cnHtruwOkWTsL9IcPok+ypqf3r+boq DBMRXgZRbo1qAp9AyIYk6EY7zs1uKblom+X1C/974sUUsLoNTUqYViAuzF8K6OoSbrSlwVuNOY ODopYFdzvMxExQ+ingzUO3F0fe5Q4cXSmEtDidZVSxqrqvydipta8CPE+CP8qSLgXFBDBU5S0z eKh0meUiHiAg6rhxlu25Gw+YAfhcfFncAx5f2gj4Cg/nSOjNxlfFeLcRR0FX0kj1pPiOXijIAD B261B6CJs2lLEZZ3ninI/Wy+ Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 13 Jun 2019 08:00:32 -0700 IronPort-SDR: 7aK0vX8frD8+u/MtbTBVoK7pbwqBiQbprXpR2WVWZQx+qDw6LtiZR3jArM9y6vyLPeLEOdDAvq 1GajpKHJv+5s1gyfr3gRSfQT90nbHIKRSuAzKiB+yXSCot0X++QzT1EdQxGp4a9pKubsiUrSXE ALks+oMxUuesOyemLFB2hmXHZ6lK1PDWV61uHdkqHixNKc4t7bG+OMsWQuO+PvmJGyADAAsDw8 C2xmtwJ4xC4PUyfaK7eMR26D/T+fFiyz3QMyIbZt97T8X4fSrP1FshIMM953YMTgfPotJ/5lOt GY0= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Jun 2019 08:00:48 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-scsi@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH 8/8] blktrace: use helper in blk_trace_setup_lba() Date: Thu, 13 Jun 2019 07:59:55 -0700 Message-Id: <20190613145955.4813-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> References: <20190613145955.4813-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blk_trace_setup_lba() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read() protected by appropriate locking. 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;