From patchwork Mon Jul 8 18:47:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035651 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 638D3112C for ; Mon, 8 Jul 2019 18:49:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51786285C7 for ; Mon, 8 Jul 2019 18:49:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4408328658; Mon, 8 Jul 2019 18:49:29 +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 EDF09285C7 for ; Mon, 8 Jul 2019 18:49:28 +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 1hkYfd-00053t-55; Mon, 08 Jul 2019 18:47:25 +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 1hkYfb-00053o-Sh for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:47:23 +0000 X-Inumbo-ID: d1ded1b8-a1b0-11e9-88ff-97e218bd4d55 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d1ded1b8-a1b0-11e9-88ff-97e218bd4d55; Mon, 08 Jul 2019 18:47:22 +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=1562611658; x=1594147658; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ynS3SVE1xBuxWEb/5le/J5u09MnENI/7CT28vcHZjn8=; b=dgROoCEx8szqPlDFJAXg/gzCWyyaELw4nZ/gmWFwoCHcc17Ae2Fbhyq0 RJmwhpIDbveOF9EizS9yvMDWoFMnL/mGn1UXamGDa0BXs5eOz58+tkUY7 NhL3kK7KiYjGqZrPWIwNxhQlhUstpdidYgKAu7doPtzhFruJbSxlKRQuz ANerYOoyv31NxdvhFiHGerIVtvIozNdg87dvs5K/b4GEHnUPr9HiArFDi iCV8BmJwaMSePtEgXMOGd4yGjK97tEnqqy4kvIsX9qU5uiDq4EEzL/1BG TIH+LazYUPJ++gPBwhy/FuJQ88BjgQSBTCPZdrYl309AcbdgQu6xuMPu3 Q==; IronPort-SDR: fm6ACR9UpYEWEsBTDAm7kKsL/g89sja6WpY5G5pXQpAoXqcODzhp7797orqCz6+z7hod5CBMnx XuEkGpz5xjR0cLsnpWKO/yjwdAQiQQF4Wh07IJOrPGA4lno4zMiSq9NGjxMXJC0cPIUoKpYcnr O7BD1Qda3I6BjJ8zeYu70JNKUKjAsOPcFHzE0pDRTs86jEtsKaQU6ZjL4DbYJnlgCm9gv8U4Y+ pvuPrZqazORuCs1QqJEFmEO82A8h4lWMf301JeBH6XorldSfGHlWxLKWJcGVPRPEedxagLikJu aFg= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="212364697" 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:38 +0800 IronPort-SDR: 4OAezxRywqaHiBAjJNVkwnNNZ9/MUN+98Nme5GlkgXgqUyulmzemJinaVWi+enewDYY+rH4EZa sd4Fdug2x5XDlrOhIqlmankqmHEdTCQwoWnicw1hsp02zX0itu1Zc4lX2rNtbCNGyl7APRDm3q +mQ8OAAglQ3wE44NO2fmnlnkigQUz62JyCi/Z0z/CClXAKQbloid8V16Xkl8p8XPDqKzv5mM3T oXGNWrHpDUSr63OCxcyZIjCh0JOa9A1ePASHs8MMMufb8NN8wVag9/+nLdbE9ALyAQXw2J5LPa TLGGD6FjWgOuTNRzv4bnVrV1 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:09 -0700 IronPort-SDR: XdrWNX/tHtwcbFCNAB6UtpjebhDmq2dIv5jQgtYneGZQJU5abS18Xxpst5IKOao5xF9DCI0hfE xaNjjXfl7Gy+wJkpahPgBFEUFq0XxSkv0wuJyr5ATn74oeIFo5FlSPmRmUkSaDm6J4qhHKgvbj fCx5bhYCef4cpXOOhHrym3RKYWASi8n2UtTD0M6qXFVWYaJt0b3P0NNZ/V/Th9cTV6+fg3R8cP bGRKiR96Ui7ZbwZSEA4GoKxvYPky8Mm2Rk9rD/6gna+OoY7JIG6rdt9GtjZ7CveE6MEpnuLfkT GXg= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:21 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:03 -0700 Message-Id: <20190708184711.2984-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces helper function to read the number of sectors from struct block_device->bd_part member. For more details Please refer to the comment in the include/linux/genhd.h for part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen --- include/linux/blkdev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0c482371c8b3..578383712093 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1464,6 +1464,11 @@ static inline void put_dev_sector(Sector p) put_page(p.v); } +static inline sector_t bdev_nr_sects(struct block_device *bdev) +{ + return part_nr_sects_read(bdev->bd_part); +} + int kblockd_schedule_work(struct work_struct *work); int kblockd_schedule_work_on(int cpu, struct work_struct *work); int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay); From patchwork Mon Jul 8 18:47:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 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); From patchwork Mon Jul 8 18:47:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035653 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 5312D112C for ; Mon, 8 Jul 2019 18:49:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C35285B3 for ; Mon, 8 Jul 2019 18:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 395D728628; Mon, 8 Jul 2019 18:49:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 ED8CB285B3 for ; Mon, 8 Jul 2019 18:49:28 +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 1hkYfn-00054q-OO; Mon, 08 Jul 2019 18:47:35 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hkYfm-00054b-Km for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:47:34 +0000 X-Inumbo-ID: d8d4e5aa-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 d8d4e5aa-a1b0-11e9-8980-bc764e045a96; Mon, 08 Jul 2019 18:47:33 +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=1562611654; x=1594147654; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=/pc9L2crAxHB7hq+ujlWtvkrNrky6qYpFgcsaAJbQKc=; b=Bqm87qlCyL2Ehz0kxOAWgxgFp2pN7X76BVbm70RgdYEQXfRiiByEi8xQ ZR1hiyubKVEkghaC/diTJw83/f/UTdZBu4d9S5zSUWynjbWZeCrYOqw+D WRGQt63z/Qks0DwGqpHnEaGFkGelpLliDi8BTqI46+TGVfBtyCTSxHOTO yVNrsQ9N/Tz4ZGL6LbWEAErO7z/UFVj5F7138wPa9TeDTprTRX5DxVOne JhPb3joJeR++B4KqQekodM2wB6MLZlEZXS1f88zmRN1eNpeGkL2t8uycg dZA4TSgbS8Dra8xY/JQ5Hgh4cFJDc+8Nf2WQo+/2oR+hcUkqRIdZQO9nv A==; IronPort-SDR: M4YTdtCeevV5EVQ8JSFk1BW41CnfqZISY6utxO+ACiGTQKZB6MPGGkSt611NuDqC5tz7z7+Htn HZ91SNhGW/Q78W3etUMt5B6+eokUl7osufYY3n51iJOGapGyO+JEuxG2Q+rOFFt0+LcGUcBNde s+rITEIgHpdC9lIUdHntChbMQBMF6p8UdgvPAJdVyF1UXJfnpFUkt1gzI7+FRhGWR6OO1xvhqZ cHQdCpWfEOhCoosrQjiuOAyTANpn9XTLK+z73mF+lWB6fxNBxqZFgg+YT0dQyS0mNRKzxeMxZH tCk= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="117296113" 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:34 +0800 IronPort-SDR: 6ETWBfH2N5AsdrFNNzy7z623JrLbMaV2O8ZnTu+em5k76Dfv9v50IRHdiw2SLA77ZRMWBZwYGA Rm45wBvpf80uiBbQKDMroSa4AuSlNQvZUwRnHjs3vgu9CsKrI3edzVZMXt/L1f1bc7yUAyQP72 SLo7CIs1H2uPrRGH3f0Ez3byjKo2FYKSOtL2ur9jvxdiIrA8XW6Jtlc1QCF7TXg60dVqWcsXD3 MeeCMFp+HQ9XxGwJVZAg2rNhrZP5dgc1ORD9fosJQtKlAlV05fmmEJAhh7kJRtdb+zC90XnZPK TfQ0B+MiBXTZx316XhRjtK3O Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:21 -0700 IronPort-SDR: jWdfh5Z5t7pjUC0B9fFgAyqOLuJnVq8Y8Vuwuw3p7a+MWysaGbZwoaQwzshB2rHxKcfqUwLipY XVsaf4oWX0EjvpBNWkaZZfPekQOryyganAT5TONr5hleW1fklSNaogTOGJf93qqApcdI8fz9mz KfZHtl2vopgSzLQ1sb5TTaY8qXUFTJ18FRvM4b3y9NCSYdEddF3MpV9glHcmCofAwi4dZkmIVC gaihu23gkcHfYLTnJNU0ZelUPMn6wHyW13Dx7Ze2Ij6N6zfOw7fSaRbNf+nH3JXFZwBS4Rrg8p HLQ= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:33 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:05 -0700 Message-Id: <20190708184711.2984-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_report_zone(s)() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- block/blk-zoned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 5051db35c3fd..9faf4488339d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -106,7 +106,7 @@ static bool blkdev_report_zone(struct block_device *bdev, struct blk_zone *rep) return false; rep->start -= offset; - if (rep->start + rep->len > bdev->bd_part->nr_sects) + if (rep->start + rep->len > bdev_nr_sects(bdev)) return false; if (rep->type == BLK_ZONE_TYPE_CONVENTIONAL) @@ -176,13 +176,13 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector, if (WARN_ON_ONCE(!bdev->bd_disk->fops->report_zones)) return -EOPNOTSUPP; - if (!*nr_zones || sector >= bdev->bd_part->nr_sects) { + if (!*nr_zones || sector >= bdev_nr_sects(bdev)) { *nr_zones = 0; return 0; } nrz = min(*nr_zones, - __blkdev_nr_zones(q, bdev->bd_part->nr_sects - sector)); + __blkdev_nr_zones(q, bdev_nr_sects(bdev) - sector)); ret = blk_report_zones(bdev->bd_disk, get_start_sect(bdev) + sector, zones, &nrz, gfp_mask); if (ret) From patchwork Mon Jul 8 18:47:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035641 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 B6E8B14F6 for ; Mon, 8 Jul 2019 18:48:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7D26285B3 for ; Mon, 8 Jul 2019 18:48:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9881828628; Mon, 8 Jul 2019 18:48:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 3EA1D285C7 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 1hkYfv-00057h-1D; Mon, 08 Jul 2019 18:47:43 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hkYft-00056n-19 for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:47:41 +0000 X-Inumbo-ID: dc6df01b-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 dc6df01b-a1b0-11e9-8980-bc764e045a96; Mon, 08 Jul 2019 18:47:39 +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=1562611660; x=1594147660; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TRJ5mIHEpUFUMoE20YZUADV3tKY+JE58H4HrPBkkQ1M=; b=RRemQHUudUe9qclr4zzg/Lb7ptwYbqk5TfKSYFkWEs55hkaPDPZpL7lS 26krxYahP7DQKKEij8rfG2AQzRDZX+vAG6hJgcSDg4JYIWSEbrE7XdTmX l1K3hukRf66zf0HxA35EnA0CpWSIKiv3pQExJwiy2wd7Q/X85FOUPR8ju czuTlLHWcBaNmi/peJhCEmCgvR9E5R6JvNlAIH/wUuAe1J3dwK/kHYklz prwwJVloT1ek3K9eEqD+6E/5ZwUBsHw9lkhFpzVQSHgnWfI1HEjO0d68I pCLz08nHw8etjMEcxmCJdMEcuwNt+aT94pWIN6Y8xUA5B36+0M6b6figD A==; IronPort-SDR: CbdudkSwxJA8k/ST1T/kuCKTasUlMSaZ0W74scRtFUjAIjT6mFX6jJX02IGEOEHWkoK6jraOke coZxJKxpJs5222ImR5/ihhroR/uTPRCx1L5ltgx1iobIpocwWr2XGRsCcBGOJVoLblwhGovhwq rVvEusmKmLAjw6+64573aY1PFZb3YwHJxCXiDOUPG1XWfpjqJTiUo+/LlpXWQ1N7bGkJZdMLDg Z0nfJLvQvcMtzGbDtaQDTUsM17d+QWaHO0ub4F9zhh3oKN3VqXJpcWxqwT27HdXtuLH87PsfIc Gng= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="117296118" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:47:40 +0800 IronPort-SDR: XY0WglFWpV3/4cUYIQPdy3gAEJ1U7hNu/ZTMEPFc5d/tspiKCmICqDtJl6woC8v1V4ESqRz9ea fObvbAADRwUIsRZZHTZY3FIedLrwK+tQVvjf4XsaKFVZRnK+DVx9VyO5sUkfRVkoA8kRnmsMRo 867YXe48p8YCoQJZcEZABolp07mxoMyqXf0yoIdrWHlO6Z1f1XxrI/n9OjDGimCiYTK87cS9DP i+819Bp48BCkWsjAM3JeqPXuXzTZkWhWSmQA1MhEl3d2xtgsZ0TVbACOUQXdkbtWrEYVEhwq88 EHQCMzYgcY4J3NDWEvCMxtsZ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:28 -0700 IronPort-SDR: e+wnXG2Mz3gtPkzW6JVqDomjkR+WsCClgTYVA68ZPRVD1/JbzvZKAnfiawuajy721alH/4cYAz 83R6mt/izAcA3wYqxabLbqAjyVd0jNtKCxpgAgTCPzpasYEs7lbnvuC3N4aFMecDj6sBrnSifF 82Ij40bI/YXlgLYOhl/4Oh93z3ngwfXd/OnW7O5HcGk/NS0jd+rAtkLqTzWO6jaL9i1E18+AqJ 7S99xr7IczGeGB6g7ryoF5o2/SFFru90R9W1IEnAhWc+kyfKs7iZ6KzcqN/cZ5rpgMFzYrCS1q EiI= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:39 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:06 -0700 Message-Id: <20190708184711.2984-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blkdev_reset_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- block/blk-zoned.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 9faf4488339d..e7f2874b5d37 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -229,7 +229,7 @@ int blkdev_reset_zones(struct block_device *bdev, if (bdev_read_only(bdev)) return -EPERM; - if (!nr_sectors || end_sector > bdev->bd_part->nr_sects) + if (!nr_sectors || end_sector > bdev_nr_sects(bdev)) /* Out of range */ return -EINVAL; @@ -239,7 +239,7 @@ int blkdev_reset_zones(struct block_device *bdev, return -EINVAL; if ((nr_sectors & (zone_sectors - 1)) && - end_sector != bdev->bd_part->nr_sects) + end_sector != bdev_nr_sects(bdev)) return -EINVAL; blk_start_plug(&plug); From patchwork Mon Jul 8 18:47:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035655 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 5020414E5 for ; Mon, 8 Jul 2019 18:49:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41BAB285B3 for ; Mon, 8 Jul 2019 18:49:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3588A28628; Mon, 8 Jul 2019 18:49:32 +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 2935A285E2 for ; Mon, 8 Jul 2019 18:49:31 +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 1hkYg0-0005AC-HL; Mon, 08 Jul 2019 18:47:48 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hkYfy-00059Z-Uu for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:47:46 +0000 X-Inumbo-ID: dfe17113-a1b0-11e9-8980-bc764e045a96 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id dfe17113-a1b0-11e9-8980-bc764e045a96; Mon, 08 Jul 2019 18:47:45 +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=1562611665; x=1594147665; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=fBeS4/ZwqvDjhy1b8MtLdfBATaR+YEkh8G8mPyvIJT0=; b=H4yH1nR1e4FzfyMqUhn9gSo/grI2RcPhhLtoTLWkMhowaMtG/Xksx8K0 5IgBuvKCOKWn4sgYdkYzexAzy+CRov5uAXi0q1GkzElzFSUhLnfnJNQWT 8x9Hos0ylDN1Oxq9k+M53PkfbcnEzdBz6O7/JmmTPqGmy0RvnQEwpwA/Y idg408KqoTjbijb9dTY7CMvNNby/0NaPTYQ6LTvtg1P+mIRrbdVSkNklz dDFu+kgJ85ybazBYM3pYn7Nvhf/sooq4y9HhXoB+1IpCks3MF72EKnmPv 2wMqauqxVlNehhM8wDSyvgHqoQjKuJHgDSvj0ukKfT/ApL57wXfS3LyKN g==; IronPort-SDR: wneg7Bk451byGpWEZbMg3ObYJTGxk9OTNwnto/dC3xiuxGdpKt4sX7cHUdGYvj9uY1tbUyOTm/ TkTXEdn31Ar5Wa02s2c/Xv2fMvVQllr7J/3lMZPtIIBQpCcToMEciiUl5Idq6gmfQmUok+mkiE 24RXc+Gsbbfq/42YImMfh71YSPactg4P5PZ0PrSTQQ4AuOmMovK91feddWW4CS5HYb1NDeSlOI WC9b8/7wEe55rec12HxMxufjWlMBVwClfuPmknG6zYRVL50Dpgqa4rMOUxZE8s0UlTmCM4f9kV xDM= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="113649385" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:47:45 +0800 IronPort-SDR: ee3NC6WIyp0G6cd8lL6QJLGpRFQW6WF6UUXG7jzzqsIBOdlh/hTJaOsULj3rsnChun1X/34Z1G UrG4O3YY726D9zEjnvs1p8DgSOl5vUjjGKp5wUXdCgt50+IuNp51gbkcCW+NJAYeJasX85/SFL 1tLN9yRBr6eonxG+Yxi1cUcpDuIa9mSho0Qg38ofDc8VG0c1roQnjOXxmJt9pFdlF0CIWPyUBP jFbaejYtNepih/RyC8Q9lNBMp7dx+R5dJZmO1+RpOGFlAKQOXts3JilydBls6FKi5mbLfCbyNR 41/jL4X3CUj5wyex3gO2aqZM Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:33 -0700 IronPort-SDR: mSzQo+wfNgERgCVFud7JBTp2NieFcrt7EnGnb+zRa7q9bK08hCzDg+CJfwLIldFz0pOGFDaOKS V6OLvb+6LzgoSZ8fb06fYk117r61T/uhgntkoprDYN+CpfYFFy8Z4K5aL8MlfWEEC7slAkAebQ RzEUF6LpJ2Fl9VRSOL/l7pBDwfnAJvdasZYCjnUsGlYv9bAJsIIK6krklHTnNtryjtwKwmHIup TcdxBUboya/h4ldKo3V5LNG4gKVzAq1Ws/lBSg2Eets7EHoT7i8XMvEDqQtXp9sqLszOkgy8Ka Yhc= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:44 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:07 -0700 Message-Id: <20190708184711.2984-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP In the bcache when initializing the cached device we don't actually use any sort of locking when reading the number of sectors from the part. This patch updates the cached_dev_init() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Acked-by: Coly Li Signed-off-by: Chaitanya Kulkarni --- drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 26e374fbf57c..024c52d11b0f 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1302,7 +1302,7 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size) q->limits.raid_partial_stripes_expensive; ret = bcache_device_init(&dc->disk, block_size, - dc->bdev->bd_part->nr_sects - dc->sb.data_offset); + bdev_nr_sects(dc->bdev) - dc->sb.data_offset); if (ret) return ret; From patchwork Mon Jul 8 18:47:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035647 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 7F6A714E5 for ; Mon, 8 Jul 2019 18:49:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 710D5285B3 for ; Mon, 8 Jul 2019 18:49:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64BE7285E2; Mon, 8 Jul 2019 18:49:10 +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 12492285B3 for ; Mon, 8 Jul 2019 18:49:10 +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 1hkYg8-0005Dd-Qt; Mon, 08 Jul 2019 18:47:56 +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 1hkYg7-0005D0-AF for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:47:55 +0000 X-Inumbo-ID: e3bea818-a1b0-11e9-97c6-dbe974784ae7 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e3bea818-a1b0-11e9-97c6-dbe974784ae7; Mon, 08 Jul 2019 18:47:52 +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=1562611704; x=1594147704; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ZoXNFKbL1AElJNl2xVVOKPlcS+hzkE1sUFGwmoc7aEE=; b=aA2F8Gnw9G7nhLS8KsCjtw/FhQUFG8HHDMWIkSsEYBIkjqqDf6zABx5E VyPx5Bk0UpFALrr7843oCRdCXgPS4ZvdiQMn+9o8WQzEra13nGqKmRmWg DRNunsGBI39tklEnihWWMjwdLqOuj5f5ALbRo4waJ8iDSgWRbnpa/RfEj Jg2BfqC4XaHlBANN9Bj0gzwnxDcuYh2mzGzXuAF/LHOBrzhJSzaYSKjFN BevS2ZvPFUNoCqhtOOw25d/QeiyObIhZd6h1zvOLqQkao/HR6aMWhYHTJ 0cNEYn7VlL/q+6jkPOfty9caTo0b7/Uiv1ZpP5T+byfd2yeQuZaDt0SJV w==; IronPort-SDR: zza823IYodbth4Zo4zqOMd8Mr7lqhYcH7BPFSHcsKWTO2+J8kUI2eIqh74Wg/3DMXKzKNZB+kz FSWWd5IjUlxF55YXU6dUpWHUjuGkEDVFc0lBa3UcVuxy+BRzIe1XS87adP6YbfRgQp95KE81Dk mEHA+THbEPhLBn5fVS33ht6bGIgMNijAmtr1qEmii1JnHuYk9Zrw/1BK0T8sdG+h/BK+9mKgHH 9Oy46tKYomfYnnObRkfR1q7t6G5l1od9Il1P6NOVzmgJvXNlP3tbYfs4u/VI2nxiiTiRkIfL92 Rlc= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="212364746" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:48:23 +0800 IronPort-SDR: 22m1an4HIx4t8fV7U5cHtCGCoMIcdkKpr5VLEJCWA6OypPRBr2lSd8lthwNDjp9BK5Y0FGB5s2 hJ93Wt602TEzrZgCiYoEub1bmZ/oopK6xC7kSyyVTuagydh2m83cug59NM1o1t+zdBN9YncR54 4S/cw9EEv2mmoKkq5vKYIClnQVAk/kmhOid9t70hkwhC1WeVR50AjJnVcqIUdIvGCV6d8qeU1p K5yGtRCYQ6RYgkE4BTIVdyN8lsbhpve3mPmJAB1eo2/tefGHko3TsrRS3ckBfKX6eW++LiDg9N ypLmQtFDyy9yJpaSGgS/nICG Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jul 2019 11:46:40 -0700 IronPort-SDR: kecyraaTh4dfkJYr6JIVW0Suuw0udo/w+uOixco2i06qP7L/SWcmvqt/OPQcFYibEwQdrOi0nK enRpRX7ANej55ctxwPbFJYb7fqRPzb9iUsQ+X5ZNEUrTgNq9FFFFtCk8Uw0GOXwADBWlxronSY Svt1NhhCrvFTzjTb0NAJyLkYX8DO4fah1yOc1ieVyunDXipVwQlvdQUxQXLaXQ7YfMQ8I6zuux LMBm49s+scu5jetOVTy2vWOk4WWISLi0ojSm1PhlAA0xRc/M8yQejIviSzITpm3H1FBND+zGZZ tNo= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:51 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:08 -0700 Message-Id: <20190708184711.2984-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the init_blkz_info() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6b959bbb336a..24e2848afcf5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2798,7 +2798,7 @@ static int init_percpu_info(struct f2fs_sb_info *sbi) static int init_blkz_info(struct f2fs_sb_info *sbi, int devi) { struct block_device *bdev = FDEV(devi).bdev; - sector_t nr_sectors = bdev->bd_part->nr_sects; + sector_t nr_sectors = bdev_nr_sects(bdev); sector_t sector = 0; struct blk_zone *zones; unsigned int i, nr_zones; From patchwork Mon Jul 8 18:47:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035657 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 5E9D414E5 for ; Mon, 8 Jul 2019 18:49:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ED97285B3 for ; Mon, 8 Jul 2019 18:49:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4175728628; Mon, 8 Jul 2019 18:49:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 DF386285B3 for ; Mon, 8 Jul 2019 18:49:34 +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 1hkYgG-0005GT-58; Mon, 08 Jul 2019 18:48:04 +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 1hkYgE-0005Fp-Hn for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:48:02 +0000 X-Inumbo-ID: e7a0dd84-a1b0-11e9-91f4-3f1952ca1c11 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e7a0dd84-a1b0-11e9-91f4-3f1952ca1c11; Mon, 08 Jul 2019 18:47:58 +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=1562611678; x=1594147678; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=z034C0lu3K9Pmhpbgqrk0VEPLsTVbThXKUwaZzmZN9k=; b=ntZqPbqf5yQyYKuT73EMffoJ728XDecBRWkzz9lH8qLcWf2xMVh4DtWh whr9DA6gEbTQV/dBqXFqCY5BUpyBe7LiLgEW3Fg5VJP8kmp8IEM791VQK wufXTu5q2XUXF+euptvV6xBLshopGeXvaZ4kKUvSfut/fzomsDPpgLjm7 ILLwxv+UitONEBWfH7y544h+pQLxi2ONAi1SYfdGOF3n+aim4dFKtUeiw tyLzPDrVgpMJY4xveqC9Q0rxGaCt5TYMBFnjIkadnou7QjztcmJeM5q/A kxWg1oNchHpbTrnV7+ROUz28LbpWnfrrBW7pr/mYB9Ux4iNmMgFxQfnzm g==; IronPort-SDR: GPOI4FGeiHYVLU2GTywxO4tPZt/4Rw0taNSit2n+tLuHxKxHWCMPZFwENP/RWw75B6wURP5IhP nYVvWArCCVIv+4Ai6Vey6Q0bTWBa/BJIFExF0xLtdqHZoT/biWSBZQM+d7Wvjs1m7oNVkrpAAv 2waG9/YlkYMeHS/P726prkpJv+piR1Ek01Xfc+UMntTMt5i63sBBfB29wnweK2SbRpTHPJR05u s49+q/MLGbcmwwvgBi2Yluja7SsvMcN9YZjTwm/NUEMVy6gUFnGkLwci7oojaYk9qNLQEo9SQC i6w= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="218874433" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:47:58 +0800 IronPort-SDR: pgapf2a9tSDKjkhuBN6mEbnjnd9i9Z52utoNLhBZn4Re79512AVypCxEnpOP3i5gOhWiAMWnFp Xrfw2XWCVngko9+LEDULkN94GLwsL+hZWWjMOKew86LFKzNDnX8SRqn2n12neKTWxOIGaPj38Y Ii1XTCBOwrqYYtfxHs+dhz305p/r77L9429xUt/TawS37g2bSDj2tbLHqz5szLM5gRy5w90zEH 6x9nojv1Xc83gVR5jH8k9MaGQAksoVFCBjBFjoA/vwn8qj5LFFbBw3qnqN++Z5vqkYRb+GArOV XFjP8KDJO8STl7uQl9P+S/El Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:46 -0700 IronPort-SDR: /lvUb5Q0myDa5zcgSkRV5mq0xWp1dDUOhPS4Wf9cFbmpG/IvRSSGEJ9lGM8k7Pjd6GkWTfDTv+ avvWzfyzdR+eOgrKUapLjgHI2vMsorvgoJy9+HYsgkE8YYl214niu7w2HnG8nciCH6ySy43zmH ohwVHaTLIjzccyfIkUQ95mnACdoPRdlSU5MIKSY0Z7xcK7GgXG7jb4ypPBfDeBz7hFQfKTcB1z axureZOqr+I/9iazjQ5dwfRkKdkMZP03pkSPzM+08pOLf2ElGq3Di+24xjBJ7cTOHtOLO4EHwy eec= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:47:57 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:09 -0700 Message-Id: <20190708184711.2984-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the blk_trace_setup_lba() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- kernel/trace/blktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index e1c6d79fb4cc..35ff49503b85 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -461,7 +461,7 @@ static void blk_trace_setup_lba(struct blk_trace *bt, if (part) { bt->start_lba = part->start_sect; - bt->end_lba = part->start_sect + part->nr_sects; + bt->end_lba = part->start_sect + bdev_nr_sects(bdev); } else { bt->start_lba = 0; bt->end_lba = -1ULL; From patchwork Mon Jul 8 18:47:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035649 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 CF92014E5 for ; Mon, 8 Jul 2019 18:49:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF02D285B3 for ; Mon, 8 Jul 2019 18:49:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0698285E2; Mon, 8 Jul 2019 18:49:19 +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 62258285B3 for ; Mon, 8 Jul 2019 18:49:19 +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 1hkYgJ-0005IK-GL; Mon, 08 Jul 2019 18:48:07 +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 1hkYgI-0005Ho-Pb for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:48:06 +0000 X-Inumbo-ID: ea53c820-a1b0-11e9-a29c-f76cf8b67431 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ea53c820-a1b0-11e9-a29c-f76cf8b67431; Mon, 08 Jul 2019 18:48:03 +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=1562611683; x=1594147683; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9HCTUA025JIZSm64FGSGpZxpfChbQ94lvGtg+dmKvTo=; b=DK2EioRQ9/WEfpCU2JZ1MUa9aEfst7J7UpNOaY0ygb5XP2MDQgK6IoCK BhqNfs1+rdQN0XeNcnsNBHlAUog043hezMIE3e9JeGO1iUOkLd2+nRQsm kKwdc3oCFZNkmBIw1HfPlXcHCG9Y01ZboOb2vzgMOBilcWvUHSAgQrueb 9CEKB/v7t7LN2bbHcStqSBSDo6ahqXAJTNiahkgBhv0Xj9OukLAaSHcpe paWfKjZGINo5JEiVxtGXKL/37NWHtrcpt7TxFMCc8b+xlxQ548gt6Cekk ot3EzwmkINpV4bqJtDYbHq6RUmy+OBYubHxNTYEu9nMVXlBGIWNO7FBxK g==; IronPort-SDR: GjJURN+IAbSDrU/URckutHVGzUgZBYJmRMXBymDr43cGG+c1si/VH2U5Axt1VbHWNGI5XyWGRX RgpZzHx5+wqTTzKavNd+pU9USr/5b4E4LWWZ2heTIPv6wPpBZFpMfhedZ8He2mmQfgMsANG4Z5 nztPUspEaF259SARvRIcaPWSwxzPPikj6IDJlDQR5limexpWFR3Bed4+wYWS/Sbism39i1jmHW mj7Nlcfncb58ea7IvBmESvNZ0eE4R16+/SNeiJ67yxQzx40MxbJXQqHspJzndvtn6JuPDvyfcr nLA= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="218874437" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:48:02 +0800 IronPort-SDR: ai80TSm8aqVpjcyCOnf7Khn3zSC0gG4ONWuuU/ys1eLuBX9JB6KRTdDhorzSQLnnE4fMOCuM3O s4kwwHOtOUL5W+I/SRWGNrDWQpV/RQoSqY62xJsTYE2ckSFqBMwYDFInYCzI+IcM8WUbfTRgiw 7MokmE6vg1zcObZlfDIdkAmzoN8mFGb8IHUZFqtjLmRswg60E8j8p9ygjKwVAj/L9clUnvMKOk P57gnu64tqAqCxpdvQjmu6CGpKxvun5cYTqec8bc1+MbzCzJhEKXWfodWmaXo6gFAjLD5p18IT HXFbYfem0OlrS5WWftXgFxsB Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:51 -0700 IronPort-SDR: IANeuyJ1+oRIdNc63u5j8ED18tDaGyZU+gvHhHZl87+2ajQm6m/jQpodcxPNu6UDb5asJbFKCF 6kz3QDjj06c+UBwngWRsx/wVxzGhe9RxGj9M6n8nOLjRppziguHG7Au4OsvD9KbRnMH5je9sId HZ4Az4HgCGj+Ik8pP5ZOAxIWgro9VZXW9hO0HsvtN/hE2ky3WsAJ8tq8rmu1xhjScNYGWeQANg CM/zAZ7im7Ix2Wx+pAYuDpo1aK5GRVnwAfHYBnzr+C01DF6NPe1R8G3EOZVTfz4MlWW3FOijlF U58= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:48:02 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:10 -0700 Message-Id: <20190708184711.2984-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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" X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the pscsi_get_blocks() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni --- drivers/target/target_core_pscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index c9d92b3e777d..da481edab2de 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -1030,7 +1030,7 @@ static sector_t pscsi_get_blocks(struct se_device *dev) struct pscsi_dev_virt *pdv = PSCSI_DEV(dev); if (pdv->pdv_bd && pdv->pdv_bd->bd_part) - return pdv->pdv_bd->bd_part->nr_sects; + return bdev_nr_sects(pdv->pdv_bd); return 0; } From patchwork Mon Jul 8 18:47:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11035659 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 6AB09112C for ; Mon, 8 Jul 2019 18:49:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B8B2285E2 for ; Mon, 8 Jul 2019 18:49:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FDAA28658; Mon, 8 Jul 2019 18:49: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=-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 06E87285E2 for ; Mon, 8 Jul 2019 18:49:47 +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 1hkYgN-0005Kk-QL; Mon, 08 Jul 2019 18:48:11 +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 1hkYgM-0005KM-UF for xen-devel@lists.xenproject.org; Mon, 08 Jul 2019 18:48:10 +0000 X-Inumbo-ID: edbbe65a-a1b0-11e9-914c-93fab66bc129 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id edbbe65a-a1b0-11e9-914c-93fab66bc129; Mon, 08 Jul 2019 18:48:09 +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=1562611690; x=1594147690; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=PIKkEzI8jjM5eH2i58/XfLrTPoIAapkGFdyFIcgq7l0=; b=hVeMfYoQwOh87fxW/1POHqjfrCuT/gE4UgWpLkck4poS9TsRRW08jqQ1 eoBQ2WCgqkbr3BN3BXElG0xb64azU2vWgr9NpbqHSxyDYDpqzRkr0db62 nhqFllmySPYJJKM61QgXUm49V1fI0h0O+NdL+2zxBtxATgC1EqT1rAqrr iI0pAOSHLOVUXNpUL2MqOR9ZGk4pdcibyheMsmRbjb0SoDE0KL9SIJCLe +Cweoni3EUgk2aoIlL+MRPatOXXfo9/aWKqlCE4FmhWGjbI0y+O+YhL+u KaxKjiM4zsyjnBRjZthn7khJ8uTGcwDQbN2i7PInZN1wBNE7grkDMclVx Q==; IronPort-SDR: F0idmnkdb/Uqc+L+EDumMXodl8HeXZKv2i1lWyg0/J75hTb+W1oPbB6GehUYU7zNb9P14EmvHc Ns2D1nViU7nl9N1wh2dsJKZEMtid+556OQ1F1wRYqZ5gHdH1ghX5H4QNZd2zKpVlWVhAeHp9oG Fo8cnRUaBizsf4MnRJIp+yH6xZPVYGIsCbTi18yRHAVt2fmsjVOJE4krrpU6H2fxsBPFFMIvik dyEjRb9r/lu0t9X6hAjqtUIFLd5qjw2dxhpmTyQI/4GUY6IpUt2lzeWDbRir41Fdr/nWPP1lSE gHM= X-IronPort-AV: E=Sophos;i="5.63,466,1557158400"; d="scan'208";a="117296149" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 02:48:09 +0800 IronPort-SDR: k5CLCTRIXL8NVfF+90wz1N+uhMuumeYYOfOd2K881zxPInqq5vVRyno0KD218RaQh+eJdnbHIr 60/lkVb93N7VDQpYbkDB/1BawxNwQetZsSj4Glhk5kjzLeEAObIKRLxmfDRDRJ8UuoS5CfzF+I 7wPQerGsaAaobT6lPsLY0/v+M7fCXOqCjSjnhSCIqTQBD4A0abyQpGXabrMYk4BDts+x+zOSWP ZMNvN67qm1LjShUdyrZgGml5SM1ohrYqOc69fY6NoeYP/fdUoN3Dsz6qEIyDAJ+1/vUpfXsCyn 6aJcgsEHAKTlJ+fr5vLU4rVe Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 11:46:57 -0700 IronPort-SDR: 26GGS3luZiL/5ckkNXHpZvmNp3T9hhLG9lVgKoii3ZrNjTfbn7JDDAdDbg3EYAFCavGLZwgseq bZ492xPRRMIg5a4Q/mNnufyTTDO/6t+CSUsrr62FgCwL4fDxOvEe5/ShBeTSWY/Bvhpct7909Q fLEbyMa16Zyu2TnBE7i5FRyyZVF0XAyIGTClGLHEislCugo9rwiVPBoIuTe8R03DFt4VG2cZH/ zk0t7Rms1al8fiv4wzxJ/f7DZivEmKC0K+mbDMQKseLJ16+Ye4oALigBMwGdWxAp4zWEJdV9tr 7V0= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jul 2019 11:48:08 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Date: Mon, 8 Jul 2019 11:47:11 -0700 Message-Id: <20190708184711.2984-10-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> References: <20190708184711.2984-1-chaitanya.kulkarni@wdc.com> Subject: [Xen-devel] [PATCH V4 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 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 vbd_sz() macro with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni Acked-by: Roger Pau Monné --- drivers/block/xen-blkback/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 1d3002d773f7..f96cb8d1cb99 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -359,7 +359,7 @@ struct pending_req { #define vbd_sz(_v) ((_v)->bdev->bd_part ? \ - (_v)->bdev->bd_part->nr_sects : \ + bdev_nr_sects((_v)->bdev) : \ get_capacity((_v)->bdev->bd_disk)) #define xen_blkif_get(_b) (atomic_inc(&(_b)->refcnt))