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))