Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8724627imu; Thu, 15 Nov 2018 16:45:18 -0800 (PST) X-Google-Smtp-Source: AJdET5fvX5hV38R1Q0KmI/ubdGnlY7pIqMGRCLHB/7dma/NEAYIpqpJtmlUE4nfoLPzPzoIzjmlD X-Received: by 2002:a63:160d:: with SMTP id w13mr8057579pgl.43.1542329118888; Thu, 15 Nov 2018 16:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542329118; cv=none; d=google.com; s=arc-20160816; b=YZ+pNjZ+EWNL+WwNz4Cj/rTwBqmTrlShVwTYymAQzTQ9Z+gdwFkKdnoxMsBHLiQVrx oAxoSbPE00BbFKydclMSLEXNezLU3APwTTQX/EtkWj/dbtTYrJNOF/m+o1qNMRjtewXF J6KtECwzUGDXj4eiKqPeMNPKb+UUKwHAzioeNd/1YtYrbD0VBKzS6hhbiGsUnWNEQvQp 40pIxXvUc57zEGWprRiBeobX+pfgKRsSFSZwXyuBjbDICmZE4EwMTM8VqwQHJK3lPDrH hOaLN8jylzdOuWbzGwLY8p8483vjESkidIzOPcJ3jcdPD+EQ5Xg8SRyOKKX6XtcClRLq x/EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+4PlImHWTIopLh40jUPUR/X/dOBCqUomOuDhTOWVU5A=; b=X4wupp8UoYrcTKk0HqM8g0QspqmNa/Uo+VhKwikmhpaNItzdjCqKqLnCR5Yx8FhNRe FXQJ1jslx54KyaefbduJdPnIIagdzBZ/67mgAyeA1agHOPH1+hCxfeyQ7smXT8Q+Bcy3 dMPCePkLFox4+4JZa00q/aHwd6qIuLndzxeoMI5242m+xWmsTsh1ieBJFIrCKDQaTo7K dLUNo3wgPdLlXvJ7kf4ylBXEH7+UORlH+LoRmvX4ivb6hxRFkINAx857AFPGUx0JhIJc FUb6+kBj4AR6gDyeTbDbPDg/hiZERGG7Mh/q4985yT1xYyrjHlXqBI7nzjUhwth6Kibz GNXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b=szzjtx0c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd3si7176366plb.286.2018.11.15.16.45.04; Thu, 15 Nov 2018 16:45:18 -0800 (PST) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b=szzjtx0c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389129AbeKPKyR (ORCPT + 99 others); Fri, 16 Nov 2018 05:54:17 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42006 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726407AbeKPKyQ (ORCPT ); Fri, 16 Nov 2018 05:54:16 -0500 Received: by mail-pf1-f193.google.com with SMTP id 64so6043429pfr.9 for ; Thu, 15 Nov 2018 16:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+4PlImHWTIopLh40jUPUR/X/dOBCqUomOuDhTOWVU5A=; b=szzjtx0coI1VFYZYY2U92PJOzJj1aTkkmaHrnRRF4VS929UUh8CHYxr4pUFD2QTn2B UHRNefdT/zyiKYYwhWgtngAyGSjF4iG1oGJ9DThEoa+0UU3V+DGtpQj1nBc9CyOMuTBF GpB5O8qFNtQ66M7VnSJqqpBlTiXX0vtOAaArJVcYRECh8/Nh3MS5s8vRfZjvjTp74FdJ yp6vnPsqwqc4PWBYK94JIEJ3d1Eofbk7KWZ1r1zYfl+AORPe2atwNtBy6Yb4ioF9SQsy Z/V/WiJN3J8UcSeRO0AujWYus+Bu9C9mL4OdPZiqMzvle8a0Z8aakautOAThniYuL7Bk ytbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+4PlImHWTIopLh40jUPUR/X/dOBCqUomOuDhTOWVU5A=; b=So1grsxeE01ZIwEsFaGyNpbNlKzesgiPUEao3w7B/zvxPsr9me/Ok0pv0bGn+8s1pE d+7aw/DUmeMjqTjVnm7eF48+KXBFeljkjEDepq+O88js2ihum48FaE923xr8KHdTViJr ApUzAaC7jPEnhkr/1mvJVlChkusLgonZXeS29Bz1lexFMQQX8zOhf5CzY9uVtknex/DU q5T886bgO4UVAEdlV1UMlTsDxrpznqiKZJ51eFvTUh6NJ+UXW3O2xcAt173qg4rKsYej /5gVKVTv5wxQgdZuIleaOp0HXwBeY8C3i0KjuO3jwTCqamPuJfsdzlt7CP/hXA8IBHd5 CYHA== X-Gm-Message-State: AGRZ1gJaM7KmSFPKoo1D67klaS3jShOKeeFHXRFyhKL5T664K3YeJLGB k8a5lxGN6w5xqjpzmi/yoDAaow== X-Received: by 2002:a62:113:: with SMTP id 19mr8664453pfb.176.1542329044297; Thu, 15 Nov 2018 16:44:04 -0800 (PST) Received: from vader ([64.114.255.97]) by smtp.gmail.com with ESMTPSA id p9-v6sm25334070pfa.22.2018.11.15.16.44.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Nov 2018 16:44:03 -0800 (PST) Date: Thu, 15 Nov 2018 16:44:02 -0800 From: Omar Sandoval To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, linux-erofs@lists.ozlabs.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Christoph Hellwig , Theodore Ts'o , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com Subject: Re: [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages() Message-ID: <20181116004402.GF23828@vader> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-12-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115085306.9910-12-ming.lei@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 04:52:58PM +0800, Ming Lei wrote: > bch_bio_alloc_pages() is always called on one new bio, so it is safe > to access the bvec table directly. Given it is the only kind of this > case, open code the bvec table access since bio_for_each_segment_all() > will be changed to support for iterating over multipage bvec. > > Cc: Dave Chinner > Cc: Kent Overstreet > Acked-by: Coly Li > Cc: Mike Snitzer > Cc: dm-devel@redhat.com > Cc: Alexander Viro > Cc: linux-fsdevel@vger.kernel.org > Cc: Shaohua Li > Cc: linux-raid@vger.kernel.org > Cc: linux-erofs@lists.ozlabs.org > Cc: David Sterba > Cc: linux-btrfs@vger.kernel.org > Cc: Darrick J. Wong > Cc: linux-xfs@vger.kernel.org > Cc: Gao Xiang > Cc: Christoph Hellwig > Cc: Theodore Ts'o > Cc: linux-ext4@vger.kernel.org > Cc: Coly Li > Cc: linux-bcache@vger.kernel.org > Cc: Boaz Harrosh > Cc: Bob Peterson > Cc: cluster-devel@redhat.com > Signed-off-by: Ming Lei > --- > drivers/md/bcache/util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c > index 20eddeac1531..8517aebcda2d 100644 > --- a/drivers/md/bcache/util.c > +++ b/drivers/md/bcache/util.c > @@ -270,7 +270,7 @@ int bch_bio_alloc_pages(struct bio *bio, gfp_t gfp_mask) > int i; > struct bio_vec *bv; > > - bio_for_each_segment_all(bv, bio, i) { > + for (i = 0, bv = bio->bi_io_vec; i < bio->bi_vcnt; bv++) { This is missing an i++.