From patchwork Wed Jun 17 14:28:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 49980 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2B27C228CC for ; Wed, 17 Jun 2015 14:29:20 +0000 (UTC) Received: by laka10 with SMTP id a10sf13887812lak.2 for ; Wed, 17 Jun 2015 07:29:18 -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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=+9rYKq3DvsMaKLIC1GRIiPtuZb3iitJTS33EV3Ot19Y=; b=lmOgCsgPVgjfwTgHLNGBQjeZ0oRVr93fjMdKIbcNzYF9QPbHCPe5pg6SGOJvSe9P1a lbZ2MAy+DZt3qzrd4NYWJ4V4Fz/Sf9tx9ZesmO7bf+EJXQF5ACOo5ejQjH2KaCA3QJOr DyKaapyWIupY5hK9vgjc6OMIFraU9lcsKFsINIOwT6I35TEhL5CwafoqM2X+1zj2cAUp UlH5imPNtsWmXzHjFtj+pK7c8+Rwap8pp+ZTWOlh0uS/npZYcTFPwII1GQvhUC4JUViu ij9pd0AT6HOqOX3Zzyshe+a3MFZwKjsreMrfktqQSzPNb0KIsyUG7A/6EpodniPG81x2 ydrA== X-Gm-Message-State: ALoCoQkWo/M/ommK+fUj/Smb4cN7wL99Awi3Mc/Y6KGN6l6IotYCEgJm2X2fFRt51T4gLb3oC5jf X-Received: by 10.112.118.162 with SMTP id kn2mr5850728lbb.22.1434551358685; Wed, 17 Jun 2015 07:29:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.2 with SMTP id wm2ls15939lac.38.gmail; Wed, 17 Jun 2015 07:29:18 -0700 (PDT) X-Received: by 10.112.90.194 with SMTP id by2mr8334223lbb.62.1434551358540; Wed, 17 Jun 2015 07:29:18 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id z11si3755930lbn.83.2015.06.17.07.29.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 07:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lblr1 with SMTP id r1so33033223lbl.0 for ; Wed, 17 Jun 2015 07:29:18 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr8318496laa.106.1434551358427; Wed, 17 Jun 2015 07:29:18 -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 hn6csp509151lbb; Wed, 17 Jun 2015 07:29:17 -0700 (PDT) X-Received: by 10.70.127.231 with SMTP id nj7mr11468244pdb.63.1434551356544; Wed, 17 Jun 2015 07:29:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az5si6568529pbb.57.2015.06.17.07.29.13; Wed, 17 Jun 2015 07:29:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932371AbbFQO3D (ORCPT + 30 others); Wed, 17 Jun 2015 10:29:03 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:39719 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755327AbbFQO2r (ORCPT ); Wed, 17 Jun 2015 10:28:47 -0400 X-IronPort-AV: E=Sophos;i="5.13,633,1427760000"; d="scan'208";a="275764416" From: Julien Grall To: CC: , , Julien Grall , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Konrad Rzeszutek Wilk Subject: [PATCH v2 7/7] block/xen-blkback: s/nr_pages/nr_segs/ Date: Wed, 17 Jun 2015 15:28:08 +0100 Message-ID: <1434551288-14113-8-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434551288-14113-1-git-send-email-julien.grall@citrix.com> References: <1434551288-14113-1-git-send-email-julien.grall@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.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.217.175 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-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Acked-by: Roger Pau Monné Cc: Konrad Rzeszutek Wilk --- Changes in v2: - Add Roger's Acked-by --- 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;