From patchwork Thu May 14 17:00:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 48531 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D98221411 for ; Thu, 14 May 2015 17:03:00 +0000 (UTC) Received: by laat2 with SMTP id t2sf22182542laa.2 for ; Thu, 14 May 2015 10:02:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-length:cc:subject:precedence :list-id:list-unsubscribe:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive; bh=ecXqKOTx8m1X5pmvEA2G3f4iuo+EWs6RlbYiACdX7rc=; b=E4BLwHEU/ZNmXW5yUCRA+yfBk0yr9ugdcF7uLEowVS+/mSIUV6nZ8YeujKPS/iVX+k sfv5Pj2cZXsS6RyO+JzYY3sBhCMs5VA5kM1mBX4NOlXM0cC3ZdmNp5oLdcyyo6HVq1QZ dhrohssB9fY6HxbdZBCR8XoNHwwULe5kKcVyh9P0PCEsbhynQVwSj7lt4RWkTzN1QyhP YYZF8B4jNdWANRZqp8zVLWqOGOM7GPZhK+7BbVnV5ZhK1JGlM7CkkTe0/zduNceUmgz0 HGltFdxqBWAe/qaL3aLiRZz9KoeoYk2zx3YZMAadI6UOdg8Q88tcOJ0oZ9sXT+n/Mtu5 VX5A== X-Gm-Message-State: ALoCoQltlbp95Wh0Vj8oi3Hsvtg4KmnEL0HkHdQ/kmZM2mNsi6eE4bgod9nIxQtKcw5zXwC4NIjZ X-Received: by 10.152.203.233 with SMTP id kt9mr3679556lac.7.1431622978752; Thu, 14 May 2015 10:02:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.114 with SMTP id q18ls447964laa.8.gmail; Thu, 14 May 2015 10:02:58 -0700 (PDT) X-Received: by 10.152.164.233 with SMTP id yt9mr4054500lab.58.1431622978643; Thu, 14 May 2015 10:02:58 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id pd4si14936959lbc.40.2015.05.14.10.02.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 10:02:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagv1 with SMTP id v1so76859927lag.3 for ; Thu, 14 May 2015 10:02:58 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr3858566lbb.112.1431622978532; Thu, 14 May 2015 10:02:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1404690lbb; Thu, 14 May 2015 10:02:57 -0700 (PDT) X-Received: by 10.140.23.133 with SMTP id 5mr6707355qgp.84.1431622976705; Thu, 14 May 2015 10:02:56 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id h6si3350829qcs.11.2015.05.14.10.02.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 14 May 2015 10:02:56 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YswW3-0000Zk-FF; Thu, 14 May 2015 17:01:47 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YswW1-0000Yv-7G for xen-devel@lists.xenproject.org; Thu, 14 May 2015 17:01:45 +0000 Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id 4D/6A-02507-8F4D4555; Thu, 14 May 2015 17:01:44 +0000 X-Env-Sender: julien.grall@citrix.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1431622900!11526192!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.13.14; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10397 invoked from network); 14 May 2015 17:01:43 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 14 May 2015 17:01:43 -0000 X-IronPort-AV: E=Sophos;i="5.13,430,1427760000"; d="scan'208";a="262765045" From: Julien Grall To: Date: Thu, 14 May 2015 18:00:46 +0100 Message-ID: <1431622863-28575-7-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431622863-28575-1-git-send-email-julien.grall@citrix.com> References: <1431622863-28575-1-git-send-email-julien.grall@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, Julien Grall , tim@xen.org, linux-kernel@vger.kernel.org, Julien Grall , linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [RFC 06/23] block/xen-blkback: s/nr_pages/nr_segs/ X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Julien Grall Make the code less confusing to read now that Linux may not have the same page size as Xen. Signed-off-by: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Roger Pau Monné --- drivers/block/xen-blkback/blkback.c | 10 +++++----- drivers/block/xen-blkback/common.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 713fc9f..7049528 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -729,7 +729,7 @@ static void xen_blkbk_unmap_and_respond(struct pending_req *req) struct grant_page **pages = req->segments; unsigned int invcount; - invcount = xen_blkbk_unmap_prepare(blkif, pages, req->nr_pages, + invcount = xen_blkbk_unmap_prepare(blkif, pages, req->nr_segs, req->unmap, req->unmap_pages); work->data = req; @@ -915,7 +915,7 @@ static int xen_blkbk_map_seg(struct pending_req *pending_req) int rc; rc = xen_blkbk_map(pending_req->blkif, pending_req->segments, - pending_req->nr_pages, + pending_req->nr_segs, (pending_req->operation != BLKIF_OP_READ)); return rc; @@ -931,7 +931,7 @@ static int xen_blkbk_parse_indirect(struct blkif_request *req, int indirect_grefs, rc, n, nseg, i; struct blkif_request_segment *segments = NULL; - nseg = pending_req->nr_pages; + nseg = pending_req->nr_segs; indirect_grefs = INDIRECT_PAGES(nseg); BUG_ON(indirect_grefs > BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST); @@ -1251,7 +1251,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, pending_req->id = req->u.rw.id; pending_req->operation = req_operation; pending_req->status = BLKIF_RSP_OKAY; - pending_req->nr_pages = nseg; + pending_req->nr_segs = nseg; if (req->operation != BLKIF_OP_INDIRECT) { preq.dev = req->u.rw.handle; @@ -1372,7 +1372,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, fail_flush: xen_blkbk_unmap(blkif, pending_req->segments, - pending_req->nr_pages); + pending_req->nr_segs); fail_response: /* Haven't submitted any bio's yet. */ make_response(blkif, req->u.rw.id, req_operation, BLKIF_RSP_ERROR); diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index f620b5d..7a03e07 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -343,7 +343,7 @@ struct grant_page { struct pending_req { struct xen_blkif *blkif; u64 id; - int nr_pages; + int nr_segs; atomic_t pendcnt; unsigned short operation; int status;