Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1362395imm; Wed, 13 Jun 2018 18:53:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJuOYMJ//9VrrA6OqfRFhbDLLG3Hh4yUnQV7fEydBepufhS2etBQzyWGBmjZoe3snJAL3W8 X-Received: by 2002:a17:902:e093:: with SMTP id cb19-v6mr666400plb.189.1528941204554; Wed, 13 Jun 2018 18:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528941204; cv=none; d=google.com; s=arc-20160816; b=VeSkBVivWe95O/BZftAf18zli+/Sw463SYD0gsPfd3qNPmS2OT+nuUD0o85z1rvJ8P 0D4QQfhc/yyWNOUmYx1dyhaopCo8a3oPCCg9Z9oK5J196pYw4x46qt7oxQC+fduzA9xm 3lTfp2mQhZbTi2VyoL5OodA5E3QDMN4NONtboNmWwEn168j+tnDzxlr6oA1OGQeFvgUg gD5T4Nh9DypXjZtUShjPp0kWa1oYXfk8yEeU9/RepbbH6moBOzK1yprFnjph8aTDm6zm BbRxe2iJxhSWj34B2VtZIJzYhdspS84xtoT/rKW13GLOvBRXRf5OHKmZnARzvXq+d0Wm 7+BA== 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:arc-authentication-results; bh=3XW8NgAjCsck4jPP2iArLZAHZau1NR02am0e+dyvcCw=; b=sslk/27eeY86ttj9HL+JuWAcylalyswnEAVZZD68brFmZ+Nly6feqdzgMCDUEpMtO0 5tDEPQx7WN38v0ZywrtkFIAheSnZC8xv6ymHNrd+SEA+ryHIffVDI3DU3bOR8PSjh+l3 QLyQMZ7vS24J5afx+bW+Av9aXB+7YoVTbXbJk0ZQ22IZnzpJgHzlz+394C5XPMmD06bU TwW2It/nCfxiK2skxo1+MTHEWSHMF62BAQYOpTxcGEbXzsE+eCwUd7bhfk4u/vkytusO UISuXTjvQJYz1QjB9rKYfqqd1hcXoGOu7kmWoiGk5Jaxt//yrI/KlL1PnXI4hQLWKb8/ Tcig== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c27-v6si3544518pgn.320.2018.06.13.18.53.09; Wed, 13 Jun 2018 18:53:24 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935910AbeFNBwp (ORCPT + 99 others); Wed, 13 Jun 2018 21:52:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754536AbeFNBwn (ORCPT ); Wed, 13 Jun 2018 21:52:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CF3287AC7; Thu, 14 Jun 2018 01:52:42 +0000 (UTC) Received: from ming.t460p (ovpn-12-71.pek2.redhat.com [10.72.12.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC8FD111DD0A; Thu, 14 Jun 2018 01:52:27 +0000 (UTC) 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> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 14 Jun 2018 01:52:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 14 Jun 2018 01:52:42 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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