From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 14 Jun 2018 09:52:22 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , 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: <20180614015221.GD19828@ming.t460p> References: <20180609123014.8861-1-ming.lei@redhat.com> <20180609123014.8861-14-ming.lei@redhat.com> <20180613144818.GD4693@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180613144818.GD4693@infradead.org> Sender: owner-linux-mm@kvack.org List-ID: On Wed, Jun 13, 2018 at 07:48:18AM -0700, Christoph Hellwig wrote: > 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. OK. Thanks, Ming