Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp755963imm; Wed, 13 Jun 2018 07:50:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJW+k1Qbq7CuPgVAMShh5dPGauRSNd2jN23sKU7/7RLkEDLrdwlzMRlCjqEPfM8uyCOhw+ X-Received: by 2002:a17:902:5a87:: with SMTP id r7-v6mr5447106pli.78.1528901429778; Wed, 13 Jun 2018 07:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528901429; cv=none; d=google.com; s=arc-20160816; b=ubBD1VhXGake56yhnVY9UYPoVy586nA5OMbcLMqDVTRVpisLCrttkmKtAje/RVVHj3 SK59wT0JnMFAzz19Iq3J5fvbEx+652OhslP71j5klA5YTPTmBsJdJylvzIQwhEOTNmLJ prQBmPWQpUbtEJP+iIEIl6cU6cJDI/54Gji1/ZjKX4buLv/FmLWRpbJ6wmoQLGo5TYmy xA3HEYCMv5r3upsr1HcUghxplgrKOeMsgo05jMXvEU8sdLNLkwHAzUVvsGf4iFGnslmZ mRgFQJsFHzC/oheV9LJoPlj+Ltz5EkXF8Em8Da29wIK0i1dCW9EkWOEg30Z38X52xG+W 4HrQ== 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:arc-authentication-results; bh=Juow3VUOypXj8FAiGiCTH1sCFjZDqmbGAQNBXIfktf0=; b=dWxDUrDmAHuSIdPo+M4cRjwHl1szpi2oGn9+o48CkduG/kyRVtNCOje5FAymMWNw+A f7YXXFeWgvr3qa5AGCF5YXl9Nc1UG6wOAxwENAkn0btsWDR/EhDYTRXg3vbCNv6WvVZm fhCWXoweeYG8dMdM9rensq03knfQXB2jSKiBU9VplYaHfuIh69hJq90sKW3b4LDCFAqW AoreyyyatR2tqZrOfwvzntzGww96CzOIHH14oTbLxfrN62Ly2yxUzg/9cUw+z5kRipH9 OrOGp9OElzSMuZmXMayvra1sd3PrUaLQzIB3ebpeZo4AY1n5vCmawGUB8zr+gLSeNR1R QSEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ihgQY+Ba; 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 e8-v6si3055009pls.28.2018.06.13.07.50.15; Wed, 13 Jun 2018 07:50:29 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ihgQY+Ba; 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 S935923AbeFMOse (ORCPT + 99 others); Wed, 13 Jun 2018 10:48:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47496 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935691AbeFMOsc (ORCPT ); Wed, 13 Jun 2018 10:48:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Juow3VUOypXj8FAiGiCTH1sCFjZDqmbGAQNBXIfktf0=; b=ihgQY+BaIYO6FmZ0xuY6/NCrl rbIi6IEKtTMtNNM+XGuALTMz7Eq6gOjQzJIuklAG4EmMom8/ruoX7gccRIW0AZRwlMLCzflBiHSqN cg7CSb8W2luzEKOAIcpm89gQKuMh7hIFps8dvdEPJi6S/HNehkbhBCAYR4OGGjI0cp1yoJDUNrg7p ArjFZ9bRU6TSjmn9/o2SSm1GsmWdVI0gRwyjpUkMFKQHawpaHrSPYCeW9CJ2WAOBZO5B9BJo9kwkC m/yzwjvJscjlHe0dzWOehkx+nZ5pYKUu1ovVncZAoOqHudGw8gjPNzhCqp0SZV5zCxwO1dbJlQ8np jb3tVH4kw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fT74M-000482-DU; Wed, 13 Jun 2018 14:48:18 +0000 Date: Wed, 13 Jun 2018 07:48:18 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , Christoph Hellwig , Alexander Viro , Kent Overstreet , David Sterba , Huang Ying , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , "Darrick J . Wong" , Coly Li , Filipe Manana , Randy Dunlap Subject: Re: [PATCH V6 13/30] block: introduce rq_for_each_chunk() Message-ID: <20180613144818.GD4693@infradead.org> References: <20180609123014.8861-1-ming.lei@redhat.com> <20180609123014.8861-14-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609123014.8861-14-ming.lei@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 09, 2018 at 08:29:57PM +0800, Ming Lei wrote: > There are still cases in which rq_for_each_chunk() is required, for > example, loop. > > Signed-off-by: Ming Lei > --- > include/linux/blkdev.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index bca3a92eb55f..4eaba73c784a 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -941,6 +941,10 @@ struct req_iterator { > __rq_for_each_bio(_iter.bio, _rq) \ > bio_for_each_segment(bvl, _iter.bio, _iter.iter) > > +#define rq_for_each_chunk(bvl, _rq, _iter) \ > + __rq_for_each_bio(_iter.bio, _rq) \ > + bio_for_each_chunk(bvl, _iter.bio, _iter.iter) We have a single users of this in the loop driver. I'd rather see the obvious loop open coded.