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: 11105531 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 76FDA1399 for ; Wed, 21 Aug 2019 06:16:26 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5314D216F4 for ; Wed, 21 Aug 2019 06:16: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="AZq4qqFD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5314D216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0JtH-0003vD-Cy; Wed, 21 Aug 2019 06:14:39 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0JtG-0003v0-6D for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:14:38 +0000 X-Inumbo-ID: f3710142-c3da-11e9-8980-bc764e2007e4 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f3710142-c3da-11e9-8980-bc764e2007e4; Wed, 21 Aug 2019 06:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368077; x=1597904077; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=YxWj03mIGVcVbYKOln1UBPzCaYS0qRuFrw+e6W6O8fU=; b=AZq4qqFDmj2jz1DIlP2elmhJ736U9W2peFNz8VKlgCvLF8ycI63NWZlr gYvJsAo1RQrNmsNaaT0CgMN/B+/ohPuOzBhyFXvPKAIIwUSQLWuQJwR0f Y/+yOCvQymDLq5nP8WvRz0UFo2vzdj4zcv7tdLoIeP2idEAEPk19Q3pOJ 7JCe5dCOextv/kDlC74d3EmubmAcog3AKenLBh8Cu5dy2ZjDM0RGyRSdV nZPsWKjILbDBvlHO4r8eV88uchGhr1c5c0HR6hTR8E4cYBTzqoL5IKFz4 KIEuqPtaLnPM3SzZmXpfmp1Etaz24exSrO/RyPOLkrnkGtYrH6fHb223T A==; IronPort-SDR: MsVv/qeZcm0Ji7q/gXpc8i8DrO4rLySfr10vSgP4QDJmywDnNcKBffT7L2ZXxZZF22syJhmP5K MpVRCjXzaLyhFX3cWqzhFCin3j0PTltnF1d7LKKRT7nGeLdeVY8WUM2yCPmgQdTvcmnZnGrb+c OCt4xfDYQfh8Fa40IxHIWIrleRpHenhUlYu+eBfok9ujiM+9o9TxQsrP48AfRYuONwZ/sNOmz/ rbENHQJRwQ1Mwzdur4sW9iMl5w8ykeP7zZU3ibTw61pODMurc1aAyOXupw9X1Z6LawmcokEkg9 J4E= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="120898331" 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:34 +0800 IronPort-SDR: /x2WVFwhMssmG4YuCAUPOp71T5HaHEph5tsmSLnrIS/8Bft81w+S9EdUz8hkKcgQ4RwvHBfV06 CEq9lj4emOc45f/Aqmjf/tMfzXXi4VrHzVqsnm9DFb0vhCF4bKTz6OtrdyRnev4N/SVu16R0Ng 2Ww5YvZ/Rm0A/gZ5+0h8ZgcoF3X8neHkPY4zJtlJgsHJaRsfDrxvZ1PWkNG/VxczvKQqtzov2r a1bp/ktFheMqrgprUoWcnlNajrOc9mEZ8KUXo0/ggb/H+5ziMiKSulnIvlgu4Uh7U3Hwl+4iPP WZBK2JRLl6EFhz22hkPsvVwz 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 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> Subject: [Xen-devel] [PATCH V5 1/9] block: add a helper function to read nr_setcs X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105527 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 C3F5714F7 for ; Wed, 21 Aug 2019 06:16:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A079A216F4 for ; Wed, 21 Aug 2019 06:16:15 +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="XpZmSoG4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A079A216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jte-00042n-An; Wed, 21 Aug 2019 06:15:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtc-00042B-KJ for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:15:00 +0000 X-Inumbo-ID: fdbb3334-c3da-11e9-adc0-12813bfff9fa Received: from esa4.hgst.iphmx.com (unknown [216.71.154.42]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fdbb3334-c3da-11e9-adc0-12813bfff9fa; Wed, 21 Aug 2019 06:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368095; x=1597904095; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=KskMhIccdhyYejQPXHxAAXs3ig7LJbUasu+JL5qAjTA=; b=XpZmSoG4hf6l8cR4oMbYVP2uZMDk2QEwg86sBwq9bZXT/Af3TR09SrI/ YcEFPylMmees2A1HItETeuhZtGAxOZSNKpYJreVqYTGuUPbjUfyhmO3Ms M6d0OUvdj5MhVg7992E5/vqmDLEPzonVbmEHlDMKq7evIcLzkM9EZf1U1 XVjB6mIMPB3qHcNcLVOEqC4b+nawK4pYnn0YESUKcJLZYo2A/2mspytDo iJPCFva/n1HFl8x/K4/tYYJ3E7pcBsc+biKYDdTE6ONC/krMN/dDTFVdn 79GUhnRGLAf4JeQ+aD1CU4uzb2zBGNPbwZMaa5y3heHWDNGC0QzqtFUCr g==; IronPort-SDR: 7ez0SONoiXesEQU7bNEd5zbizOK8jI0GeO8h6r5c5ju+eHCfmsL0TrDg/JoUFUkuFyDgSkcVsl 7iop/6Uewj1u6m57INEs9F851nFcGd1EgzKgdP9oX16k0hIysvyMblKE0OvQQHV7HGmaMMjOhv z6cvPrZBJ2jHalQeYk3xaWmpFVvaukB5lJgX9qjqozMoTEFWUGXfeMJjJGRwf9z1IwApduYyYA 3iBgl+ms56ddnbGASe4cPIP0Qoor3HlH/0G5d5d4VWz1zQpEIgyK78SSmp43S6nwxRhlvlKRKt 5pA= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="116306279" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 21 Aug 2019 14:14:41 +0800 IronPort-SDR: 7PeBxu+NbZm3bFmEoO7jxZGjtzgHNXTJuWbQQIr99YrCXMX8ctUGsP1bA5JCvyWTp3sD8vD+TH Pf8YqISMpomxhaQI706Tr0GN0F5V+Q8qvrlRZGiIbGkDOS28j0svYZ0rAN2OozwMx3TU15poC7 161Cw9C5ynlTb/ozFiIqyAZ+dwtJ2AP6b7UCsz47yhEW7xsyX9qDiXuIXIBjJW+yX7lZptgNvn VsgJZgLpUQi73X3MvyHKayTBZTkCkuuotgay8yAwQ45dLWl+NDzSpsyQrCkF+2TgbCs9dQA8Ol QNrN6bRdghtgQSQNjEaGy4jO Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.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 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> Subject: [Xen-devel] [PATCH V5 2/9] blk-zoned: update blkdev_nr_zones() with helper X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105525 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 DD02514DE for ; Wed, 21 Aug 2019 06:16:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8F5B216F4 for ; Wed, 21 Aug 2019 06:16:06 +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="kOEkZG8s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8F5B216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0JtS-0003xY-Mt; Wed, 21 Aug 2019 06:14:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0JtR-0003xJ-ND for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:14:49 +0000 X-Inumbo-ID: f9fbab8e-c3da-11e9-8980-bc764e2007e4 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f9fbab8e-c3da-11e9-8980-bc764e2007e4; Wed, 21 Aug 2019 06:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368088; x=1597904088; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fAftc0jXLF+PYgBKMR7sJr2letplG8FiARgg+iOt4Mk=; b=kOEkZG8s4DslUbNnuq6fEsITInDsbekOalx3uxL6EHbIusecf7sgQ9+i GJsyAXnnudLERdFZd0NY1e1hpcWWpcTdIytR/frtwiHK2TIXAFjtglcrF 2eUckx5FcNbJFIpwXy+4ZljKjYwrMWNEa8OMBylTNu/lx9nzE9tNvVRAC oPXGzUe5MakxXEQ8FbiqkGWGS314xD4DnwZT3A2MIySTmUYFHrhPy1AvS Od7EvnWiPEgvOlGk6XtnLFuTeAFIM5Q6wHbioMeos9NW5fEvbRMDFf+gw KN98zCQY5PV1Uk3auepW89Zd0z6jRcR/iAwse6ORjN+nBwgOiO2ixEF3j w==; IronPort-SDR: FVb9DtIC19fDSWK5eoeMb2oYg3TR4U/0Y6UWJDtJJX709E8VgETEkLdtlmL7EiLBVgrSQA+O0X VSrhyqpkfDAQsCqNI7gzMnoSlnn3lc0i3cxQFg91mVX+/9vHIuIdgfVw+K4a3pxV0tB3izP3wO QVYxAv+QD6v9MmNW0xOmtxtzoEQFeLjjA6QV5Zo6iAR7RAC9sduUh7g7b8dIZHcfKFpzr0fHo0 qjfwbKcKx46A8LoASCCF/ao6ecTD6uqWveLSuvFgx4lXYN1ex1xO0Da3mLGksy1HBdbPm+mfnh hX4= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="222880789" 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; 21 Aug 2019 14:14:47 +0800 IronPort-SDR: Q/VIHExfI1uKQGKfaJkPgo0rKRmbxh733orgHp6u5yWTFppE49jVGqKIFWmysrOWU8ppRyelZB 3zseTYVTqUeHetjuS6iRfZVZPF8n5SWWK/jZ4qNvqBJi75+H9q1a6fk8/TFWYbcY6VqyV7unzk fj5wQgtpL1U8BSTRr1EcFy3Y1F3FhxGmH5Oc1uuut5MybWp8RVFfZm0MbHgvP8Gc7To2dXtkM2 5dvYmC3rva7Rkcbp8DXWG8JN6/u558nKXENCMv2OjDlx2+kO+g5sQeahHavZ1WZvQ2tRhV/3uB 7FqZVX+tW62v3io5Hfw/zSO0 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:09 -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 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> Subject: [Xen-devel] [PATCH V5 3/9] blk-zoned: update blkdev_report_zone() with helper X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105535 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 903061813 for ; Wed, 21 Aug 2019 06:16:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 68FD5216F4 for ; Wed, 21 Aug 2019 06:16:37 +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="A9anQx6b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68FD5216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0JtZ-00040i-0U; Wed, 21 Aug 2019 06:14:57 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0JtX-0003zY-IU for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:14:55 +0000 X-Inumbo-ID: fdb66a7b-c3da-11e9-adc0-12813bfff9fa Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fdb66a7b-c3da-11e9-adc0-12813bfff9fa; Wed, 21 Aug 2019 06:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368126; x=1597904126; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=dNQR+/WArddUJx9huMcsBlSubmN9JNdoAJJzC4US2gU=; b=A9anQx6bIO4naC5PB1G9WXevQd/HRRBu1/MN7ZPY1YP0VlF7VKcKzVDq iEtAzmPWNSx94PvQIdjXajbn/7AFMF+jsaHxfnuXnwOQWBEgaHutbh3ME gQp52am86gTMkVd/kBQ+3A2/TQtan68hTByVfFeSAEuqqmXGBnkn1/z8E pqPEDEPt+V4mvYXpHBoQukzAhvVtI874YBtTSRZ9z2B7WJOZTwX5At89D WiJwt516+cdJESYRYFwAlwe9iZuDWPtMD1IoGSu2jQvajg6d9k9PXJ1lM mHxg5JdG/uwuNZefBM6Zrwzn9ZhKEodzW2oHR2eCdBguKFxD+o/Rkg1pO w==; IronPort-SDR: rfiKeW2PSYgY1/818PQmlT0ItGSPJZJNGJTe8z9Zk11wlKBKkDWqUeWUjaZyqkl1xH3iikMixj cpIWlCumZ+QwTYN6CH1/DrCrQZV6dgIyVXf4k7y6xJoU1ZxilHHxcc5jog7lybNGoLPpaSw0A1 UzW+g3XAhqzyLQH7jqdmhREErTpulFnfuKwxtvT7e3CnFYoYDGT6pt9ky0GfyFmCTgTanmuYEn 0ymn4QoOR1305DiFAZpsZNrTDqfwTmPQJhJlzH3V7+agtKhXz/dH5B8Xuu8dc1D/lqpaKDmD/d g+c= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="216721088" 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; 21 Aug 2019 14:15:25 +0800 IronPort-SDR: xuF51Ei9CYb8jjqtod4lAhT87w4TmEBmkRgt0ChoLDr8emBvuOUaNtnQbkQlM6j7HS3WIFflem jnF+4oFYMkqGJwx7eUk+VgzAcI+4mzQDGqzRrPD9KESvTjg7dF76hsMQWbNeZZ2eDxrv8Bt51E obdoa7HCz5RqE3oq9szN3Qvb97s9PzOcxCY8XTQtik01weJ2xbitadoucyvK1Fz0YsuROBJBUc oDyANNgZ+e5oqev2oSIj2IjXJERBlz435/5LzbR8xaKArmnwrtXmgiyXEkTIOYG8Y4cIB0mwj4 mVPFucG6OfK4rhNopnkcDrs1 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.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 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> Subject: [Xen-devel] [PATCH V5 4/9] blk-zoned: update blkdev_reset_zones() with helper X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105537 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 67BB814DB for ; Wed, 21 Aug 2019 06:16:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 438C6216F4 for ; Wed, 21 Aug 2019 06:16:46 +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="pn/JINVj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 438C6216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtg-000449-KY; Wed, 21 Aug 2019 06:15:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jte-000434-Ku for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:15:02 +0000 X-Inumbo-ID: 01e03874-c3db-11e9-b95f-bc764e2007e4 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 01e03874-c3db-11e9-b95f-bc764e2007e4; Wed, 21 Aug 2019 06:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368101; x=1597904101; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TWIY4zyMbnSdbPfWCQisLpNGsxuN7LEVg7rZifVilrc=; b=pn/JINVjgUqubKHvgPvCNqgn7pG3wqXXyOaw89kYE6ytO+EPzlFvjK9V 3iUNRRjXj71UT7gIWihPDYKnV3rxqa4ZDe2qoP4pA7IndBzTobT0giYbV LLQdhQ+rv6fnm93evU89aKSfc7WIZ4pYOVamQxRFf1XrEkiA5t9CY1ilM djcJPOWsOD7PmMVEqtT1ofT0nVjjvTIgg0heIFQ9riXXr/Wv5U75eb4ZU 59fJm7TwRDGdP9TRjZc5+ikZqmC9t5feZQV2veIJ54bfxZNehNK74jjDM ce8Pv3EKPgImkhNKEeCNJKoWJHVHYNZ621V3kvkrFI3L68RHvdnB1zWNG A==; IronPort-SDR: 4+JRm2EKlRPM7Eie4NTCXUmVv7g4sQu1v79uXll+BfVC2gZP2JgUyTaj/N/MrDbtE4rrVHvPQl fmNhIrf+okpm2ApU4ufXgTSo+t0AaVhwipAVgCES8Tck/+uS6CZhdZaXNPs2ctTJmI4U19qMqE J0juTdEpZmZy377gWYrB8z/ENK3GsRXn3JkXX5i4Y3p+kFev3yjNET96uhUTDcXkCmy6s+DZdW otZZVDynd0OWjxgwKcbTAUjasbxULVH2J1chOFHYRraPxUv/5a5jpS8bGDdM2HrnTMwOC2KQKL wrg= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117904710" 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:00 +0800 IronPort-SDR: lO/l1zblGUq94kn9nZ48rBDYJUUay1zBSyRMbRSkGHJHg5RPyfcMoRBeqUCOp3gEk2siFpYa5f xfoV9q+gUNZgkSijYA9UzISQxROE2FT/lqcPsYsPg9p3RncjmljoUQljQHzjsfExMx3l/U80Il BaPZN7age0Hdp1xcnE+dZ8CP2DNbnAoMKk+TH4FUtY/9xZfCtVp8ynBhsuwBKzRIaEwLvraDUp P5W9ZC/1O61u3ktX5/8XNJF7kt4QD2TXF9jsNHiSmu/+xow9qlXFVEFN7G5oT8cN2OTo1GoQ8W 6/OnikgphnBdFRgtaz7EeYtM 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 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> Subject: [Xen-devel] [PATCH V5 5/9] bcache: update cached_dev_init() with helper X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105529 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 56483112C for ; Wed, 21 Aug 2019 06:16:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3228A216F4 for ; Wed, 21 Aug 2019 06:16: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="NuYxSd83" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3228A216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtm-00047Z-49; Wed, 21 Aug 2019 06:15:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtl-000474-AX for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:15:09 +0000 X-Inumbo-ID: 0568cdda-c3db-11e9-adc0-12813bfff9fa Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0568cdda-c3db-11e9-adc0-12813bfff9fa; Wed, 21 Aug 2019 06:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368108; x=1597904108; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=PRIc+qImYQi0sq4kI43ZLo0IJMblnfPTP0QUTy0nhdQ=; b=NuYxSd83Sg/Ct074JSbtGgQg+5NpTGJc/XfETWuBInv/oibqWejIlZ2L Fr/BWbPjjNv+iQM93DY0ivM9WALdnaSdnV202PXvxR8XharPnfzAdmocc gw7i+pQ/hK2ZeBgnQvNcpkEY34cKOluQyDyxyoikcfKcz4R+gnenKhVhx M/44RbagdsQq6O2b70HN+/IQ6EXxeB2e2v+ojJMr13iFxvLzkiwFLSt8O bkiQndprvGpo4iKe3vlvHifj/KJX7dbtJ6fmjikJOfslfXhm2BoLFYSEh 4c2t16+c4bn4P2BaHU+XsU7LDdzcSI0bDCzCpETo6Gg+qHlFAHgEWdi4j Q==; IronPort-SDR: mi7cpFVYmr5t4XAxpU5sUSy+w/1dWUbBk0BHGSff4aKQ78H0sO+5Gvb+Ijqz26Jo1rFxUcIM4c UCzQP+Fub3v3YlgXH7UC/aQRlRVk43GQzW6q8kcPJaauoBuAoi2pGL/uBQ2uoAVQA82Bq0GTLp wULr0cpaG1XeyAWdWejSEd/w0+AuJzkO1tLI6C/QqwIWzAQC3wGEvolQpTMPmGFGMAQmpwR+J8 +AhD3+yNFsnNEwb/QJKIZe1f914rYGBI3nnaCjiwzYwr9SdTjYXwkiPG3/CaMHX5/4dyy4pqmS N00= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117239090" 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:07 +0800 IronPort-SDR: 39Ey0NAQwuaSLAJEzA5u8xPkoSqztuovmx79SvlP3v+o/sHO/Cm8bRL4OT/YypijwMvzD/o0Mk MUOt6+uCVVh4EUgJZenUfrpJPeljUyfLdcrkOjyO5LcG+SV4PtfpNcajWxbFM5PNpe20hoPOG9 6HjN+EyANTz5bTUDd6O2v97toPpX84Cn4sOzNoEh2KY9ptiWVWDeA2nI72jw+KJ8/DBeVhSlhd 1f+j5NKvVjlD3aFYEg7DWY/+ccVgOx1ddVfAJ6p0QDbvtkRxL4hCBMmQdJV+s0NLI1fUKxwEQ0 TKHFASIiFfLo5qIte8BiUcg0 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 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> Subject: [Xen-devel] [PATCH V5 6/9] f2fs: use helper in init_blkz_info() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105539 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 1EF9F14F7 for ; Wed, 21 Aug 2019 06:16:54 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF111216F4 for ; Wed, 21 Aug 2019 06:16:53 +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" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF111216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtr-0004IF-Ec; Wed, 21 Aug 2019 06:15:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtq-0004HQ-5v for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:15:14 +0000 X-Inumbo-ID: 08cefe72-c3db-11e9-8980-bc764e2007e4 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 08cefe72-c3db-11e9-8980-bc764e2007e4; Wed, 21 Aug 2019 06:15:12 +0000 (UTC) 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: f99C7JuoOOLlVUxfYCTSggoZBtafhjy1FSb4QzAEHkZAV0Er6RPC1l7Xd2mVFWQS9vv2Mg8qxT pt3KPrZQkvfEnu2ZtHx1sFpK+EizeaehgT0EGnNAqGycx3J9KjqiTd7/F9WjMrPYXZ1dupgEcR MK0mjaeUks8hQxMwNjkKHL6KpNgFqw2412eYzUZKwh7QI4d5rzDIdtudnQ/jo7VhrQbh/VHrEb mBVCGSg4jgSWeezmHxd00JvQlJxIowFSenjzIp7MTooaWSTLOqaBGX5wbaYvd6gwGVMM6V/42a ZjI= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="117904723" 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:12 +0800 IronPort-SDR: 7ybJ0sJ/FhmmPtwXJeFV9uvC/bHzoF2IUZ5gPs7OxlbfN9DmZwRrjmzL81bBlMPnGaq7RqN1nQ mKbnLuJxHd6eVfgGBeCXhINdHDfQDPT5jOtbb81ANjxq6cPpP0jbgYxvwp9g+9Iuf8ACcyhL14 qsEb0Zn0LnxuAMBVxESpH+PpnbZ+7ppbN9IcciLtdLn+IKX8LSKP4QSjK0caN8mDNDrT/eKIbG M1MtqU4YiUjgf4+r4HJk/9InaNSFhXRSV7CCJvjYSl8EoVmVuVAerQJK9n2mqQFzz6hUk1iaLV QyevNsWTI/tFBULgnzRbyu3a 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 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> Subject: [Xen-devel] [PATCH V5 7/9] blktrace: use helper in blk_trace_setup_lba() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105533 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 3816B14DB for ; Wed, 21 Aug 2019 06:16:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F17EC216F4 for ; Wed, 21 Aug 2019 06:16:36 +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="hucN0T2x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F17EC216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtx-0004MX-PX; Wed, 21 Aug 2019 06:15:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Jtw-0004Lc-IF for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:15:20 +0000 X-Inumbo-ID: 0cb1f54e-c3db-11e9-8980-bc764e2007e4 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0cb1f54e-c3db-11e9-8980-bc764e2007e4; Wed, 21 Aug 2019 06:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368164; x=1597904164; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9HCTUA025JIZSm64FGSGpZxpfChbQ94lvGtg+dmKvTo=; b=hucN0T2xVYZVLdPx0AuXGLb+BL8r3GJXKXl7C2vCnAeV1Bo3tLUTuGBF WSroQ1nMhK+zepVGB4O0b+N5d+2HO2Ccum+/1ko6GBkhW13HcamTnqIj5 RFNoOOeTQjr68lL6tbTqSbs5neF9XMaRr6Og0ZjTfYl+hJE5PcG0mNTjI scBazf5zU3ASJz05hFgWD0KBG9hXSRFR8hkyGj5zd9gtItKWGaYQ7QhHW 19TV6cHy3KZyGzp390HekPbRsHurLIs4Tp9LF1IcFw0mhQvDpVqFPtTy7 FcBr3n0+wwcZUkc2tkKLt5XdhgcggON+w/eWKJnxUODZRgJEc043L9ouF g==; IronPort-SDR: ESuskfTbwZvU/ioZ4wD03fqJkd53Nvi+fcpFUfou1Ibdl8h9F+k0HeUy4+6nk3p/6XLxgTtbzy VLaCDOm4OgjbJ45Zs4scVJPXebObXDYhlT4Uov11KmZ4qg5J8MTprnjalLPiksTZ4Uvtzjzusm Fv8Au7lG3mSBzWHTfc6DUJzzRrnO8kiAqeMJoggvqLK3w2QnkDu71hPDWC8xGLWL1sp4tCbITI MgV/7uy8F17XcFX5XqbEVQNLY+OBZlDi6lYdS0mGAvoG1tRekUjtjWyXLqu0tbM9VpLguzHpoc XAI= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="216721107" 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:16:03 +0800 IronPort-SDR: L182bfiB4orBuGOY1RLDtsfrLuQy+fuRgRsvKWyzbi/Wk9tNCtkJEN+VCkNtBxR9v1+cNCvo7g JMNNT3bKVBz6esG51NWChzGOA96fhW2botYV0XSHiZW3TMCf++qleBVay2bLrJkcjv/KcYa2nC /yu9TriDM6tsec0fS+g5xnkSfYNkQOzIx82Nd+89G38wQkDMHbVDtIw1RnlZBGaNmBvsW40AP9 294JpDud7s7araDwTzAaBoTgQl89wpV/E2tfA9kpXSjCmGItXZgAxZ2w+dKMXTKqX4heY/p3we P6hpdkAsRk+56QkfnFBpFIPz 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 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> Subject: [Xen-devel] [COMPILE TESTED PATCH V5 8/9] target/pscsi: use helper in pscsi_get_blocks() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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: 11105541 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 29DCF14F7 for ; Wed, 21 Aug 2019 06:17:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 058A4216F4 for ; Wed, 21 Aug 2019 06:17:11 +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="dgZ4AYCa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 058A4216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Ju3-0004Q3-2P; Wed, 21 Aug 2019 06:15:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i0Ju1-0004P8-KN for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 06:15:25 +0000 X-Inumbo-ID: 0fcd9666-c3db-11e9-adc0-12813bfff9fa Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0fcd9666-c3db-11e9-adc0-12813bfff9fa; Wed, 21 Aug 2019 06:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566368172; x=1597904172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uCmqVTMs+9n224hBF85AnzvmEf4HCe67ga81BlS6HHI=; b=dgZ4AYCa5JPeTgVYGeKhrAUGQ8o/zJ15wX+PhL31aACDuF2rgLNvCARE sTZMmHdPqza3YmUk0TDX3xVybaqwury2mkGOY6eoJ1qPVTgBXjf4R2y5p +ObTtl9B/maJpuArEkt6TW03EYRJhKfgfEE36rVVLdo0+AzHMye5t6aLf A9AhuEniV1GClMGnN7HUzKwfuym3er21GF8TPXkmHc81DyDlgi/Zmh0q1 k6IMtX0pjPlkcAtpvTSmE0emVwGM49U8FsoBFkVljv6EmLSyPArw5eFmr gpCG1ErK8D31sWJdeCVGeOOv9Pm0iEu/4aTIdzcn/MfLsmRx/d8y0YNAS g==; IronPort-SDR: e9d4u7zv3oHUS2eoop+Oj1q5E4wCyhbzf/rOdqXtt+gIu1HOX16m4cEqwl79SUqGu+P4aeX/Y3 Ig4v1EuRL/qTD13+8h1ifoQiqwT3epomF1ABRWZTfUUcuw3QoAC76uEnwH/3nqU/zYfQKKxTW2 eH5Ag1gnhPrxkJaoOl7IqobTaX56Q1yLbOmjmc7Y9lBaS7IxeNp86Sx9sKUWtBEUXGf5ibVhuA rgJPx3Vw49NvI4b9iA28FOzgV7FlLhUMhamZnOZYaK293/AIBnyeKTv+uKarz8ujE6YHkoHQu8 7g0= X-IronPort-AV: E=Sophos;i="5.64,411,1559491200"; d="scan'208";a="216721112" 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; 21 Aug 2019 14:16:11 +0800 IronPort-SDR: vs1wc/yGVRhTjMI4TNZtdpd5ETxwGgMRCQwWpq2H1/NkGh0OtDrlNzLfNykbCpk7EJUwVOHRK+ tB9fbFRSy4tJq/cwOb221AEx/hCgqqkVLpIzjUtDStrKE5VqvOuPh0pP7T0Y0Dv1rDfcchbVvN tYOuotR9TsMgnCFjkSlYIiQ7PPxLZ6eUYtDhFIVbeM0RAulxSyKATlZhW8ZrWVifWhmyck64xG BvyVFLlSRVFRE4t/sIySJ4uhzvaGHK/ScIijF0nXIqx8XRwFM0dr/qBKbVBk1aPb56Iuos4mPt IHDuppRyY/O10fPDIjgiw0+j Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 23:12:46 -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 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 Subject: [Xen-devel] [COMPILE TESTED PATCH V5 9/9] xen/blkback: use helper in vbd_sz() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: damien.lemoal@wdc.com, linux-btrace@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, konrad.wilk@oracle.com, Chaitanya Kulkarni , yuchao0@huawei.com, colyli@suse.de, linux-bcache@vger.kernel.org, jaegeuk@kernel.org, xen-devel@lists.xenproject.org, kent.overstreet@gmail.com, roger.pau@citrix.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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))