From patchwork Mon Jul 8 18:47:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035645 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 67C47112C for ; Mon, 8 Jul 2019 18:49:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57A56285B3 for ; Mon, 8 Jul 2019 18:49:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B7BE285E2; Mon, 8 Jul 2019 18:49:00 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F3A6F285B3 for ; Mon, 8 Jul 2019 18:48:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hkYfj-00054J-EV; Mon, 08 Jul 2019 18:47:31 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hkYfh-000547-Ss for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:47:29 +0000 X-Inumbo-ID: d5683547-a1b0-11e9-8980-bc764e045a96 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d5683547-a1b0-11e9-8980-bc764e045a96; Mon, 08 Jul 2019 18:47:28 +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=1562611649; x=1594147649; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=BLEYyqiHt/Wv6nLWVBfIZztbC5fI1sQcHli3j0z2Rjw=; b=YkUj3vHkOxdElo3CNL+0sVQhliho6FdwVBetYUkcvGRAqfp+OcZA5Xvw q25fGIa4YuP+31R3OtEbOA+INcLEe/iOMUnx1/J7BHGdAoe61YoC6OGOr ahAwMp2nFE0h6rlWnrvDpnXQwoMgAZadLBqhriUR+9fLGKURENzeS6Klg tY3efO3kap5ndTL+j5zx8wIbJdMTZ0LhSG2l0qYivTViS8MRNpSK3uirz VLH7wJrL5/Ru0GG6OanZz6WNlrWgXT+nhmd3jODDvovPV/874UH7bffjo 92GTExEHfj+n9abX3I333ZQuTCiyRB8Z9rytMXgDVhobals1HeqJX1ON4 Q==; IronPort-SDR: Ddfa461mcMslhxLUCvjkQtkjRFgubLF0XEXTILOhlUlZxjmwDi+XVyfQk2kqLPva4Z+bbCfjDj cEZTr/HZHuI4MvNm6yES37FeYxFev2wBeFO+FnQLUEaQhaOkCHHMq+trJyZ9OWf3di1pTzNsG5 bg51cS0c+k2tQvR1Xk81iUGQLtSINKpeho/EhiszzdKRJrL0cQK6EzmOQPYgLRXEVVkO6m1emm 1bYODjGHVI+gNj4jvVmcdUm4Z2hf6AIKx1zesenyeq/y728mjczG3QnY8EJQnvMWy99oFNILfe 5yo= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="117296110" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:47:28 +0800 IronPort-SDR: SkSYt/4HUgsPXVgZN4jf7guI3pPDn1HAiNIJYXEJ/xttXqc4t547Iwzjgjh93F8ihyXKVxXw63 BlRM4aojYbUc84xlfcH69BVW/RC2zsS23y6GlyZy+VWCuPw+GSltbBEpOt3XwZv4k6EEyQ6mLd OAtvN7aLTMnjI99pBsvO3MIMZDDvugRFQkdKjhnhohByZn1ZOMyZeXnOx7GdUTcUkJFIV9UdSN a0SMFg41skrl++X654jcltHz88rq0OW+kVbiKFmVM4JjDZ/MQmgaPIi8BO8h2ll6tUaP2U8nSJ J6oAKGqlkosaeYtkyVWT6DiZ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:15 -0700 IronPort-SDR: YRRx/EURyyId2rAn63ItMGwUJucXOYj/rfVXRkkyVSj/PtgC9c92Thdp63KOL6fYEaXTRbz/kU 1mfBfPgUOnEpRMI0FiaKN+4XSPY3ldYWJMZobspJSp2ODImnKlumR4tmOV5PAQQ9SRk3E9POWF VPn16WelTwmPiXdpUSqS8jeH0LDODQfnndrN7Ms33RFBa41zXzdS74G4tpcHX6MAZ8OgbHv1yL vhfCazKm6xZfVAQUDl0uXtbCaC0Nxr3Nufc6fjTg69fyi/C5Z3rd6iqUXjZe0g0eJdugYt0WSc KC0= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:26 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:04 -0700 Message-Id: <20190708184711.2984-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_nr_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- block/blk-zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index ae7e91bd0618..5051db35c3fd 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -90,7 +90,7 @@ unsigned int blkdev_nr_zones(struct block_device *bdev) if (!blk_queue_is_zoned(q)) return 0; - return __blkdev_nr_zones(q, bdev->bd_part->nr_sects); + return __blkdev_nr_zones(q, bdev_nr_sects(bdev)); } EXPORT_SYMBOL_GPL(blkdev_nr_zones);