Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2999100imm; Thu, 24 May 2018 20:51:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZquD61khTFShNVL61lWayu22B1zrM9zVyEsBINqNTnanK/Gvu81+cUzXwnb0q+/VAOPrtut X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr638154pgp.126.1527220296170; Thu, 24 May 2018 20:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527220296; cv=none; d=google.com; s=arc-20160816; b=XYF5pQPRJvNrptHwT3MPwS/Tr7D+p8++QUT2tzk2xsA+ljy2pw9ixY0PpvcptZ32Na rbBkJWqgX0O3Ecbn77wT6wPDaQ8mRI/RpKWW05MUv9JyUGofkTmXV/3agwbYBxEmgVAP 3XhcUvRDsRB/z4joe75AJ876DowZ+PJqpj64PFRfPa3Cpq6EnI4JTZIGZDRM5lJbFNJd alreYj2+WjGHc/rm8H54V1+/2jbPkiuY0KDhYo+tYjPANF7sx6py6aChiDWxyNSc2ZDs +snzqxcgdz7QD2PI7MaNmZoqxxMNOJ7YwG0d+qkEyR7wrou8iht0N0zmdMVV6W2Kv7Ul rKWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=AaiAmPuCZGmADJhgNKxBO0OEf8+m/cSkGLwy2ZgbWoI=; b=LK6muImhhJtQwX/k/CV5uuYWMKUVLwTRigJxure6tg4NpSK9P23uc1PmNDREtM0k1w eqNZ405xMQijcYjWbOJWE/ujg/EMGT3tC+5LJIIsPasWjzIjrjOdFdw3+Nuu4QQfhUzz s8m9XXCZdbj2fxBsObp1j4wfKVX3EkyNcmJegoM15hXJl2CIEd+3Yj4/M7/WgW+i1MvO BxfkJb6dOyAFvDUfB8Ocizga/Jk2RbZy5YS6o2dm09Ofr8JcXW/AVYAGwcA/V1LMkROL PWLMnF7in1ax5uhUboqo6Th3cgHXEw2rUUqRoVIrx3PPC1Of52fJG13KzX3BYh++R3we sPWQ== 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 f19-v6si22933944plj.89.2018.05.24.20.51.21; Thu, 24 May 2018 20:51:36 -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 S935168AbeEYDtY (ORCPT + 99 others); Thu, 24 May 2018 23:49:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37994 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934623AbeEYDtW (ORCPT ); Thu, 24 May 2018 23:49:22 -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 197C84023155; Fri, 25 May 2018 03:49:22 +0000 (UTC) Received: from localhost (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4F9F1006ED9; Fri, 25 May 2018 03:49:11 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , Alexander Viro , Kent Overstreet Cc: 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 , Ming Lei Subject: [RESEND PATCH V5 13/33] block: introduce rq_for_each_segment() Date: Fri, 25 May 2018 11:46:01 +0800 Message-Id: <20180525034621.31147-14-ming.lei@redhat.com> In-Reply-To: <20180525034621.31147-1-ming.lei@redhat.com> References: <20180525034621.31147-1-ming.lei@redhat.com> 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.6]); Fri, 25 May 2018 03:49:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 25 May 2018 03:49:22 +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 There are still cases in which rq_for_each_segment() 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 1e8e9b430008..0b15bc625bd7 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -953,6 +953,10 @@ struct req_iterator { __rq_for_each_bio(_iter.bio, _rq) \ bio_for_each_page(bvl, _iter.bio, _iter.iter) +#define rq_for_each_segment(bvl, _rq, _iter) \ + __rq_for_each_bio(_iter.bio, _rq) \ + bio_for_each_segment(bvl, _iter.bio, _iter.iter) + #define rq_iter_last(bvec, _iter) \ (_iter.bio->bi_next == NULL && \ bio_iter_last(bvec, _iter.iter)) -- 2.9.5