From patchwork Fri May 25 03:46:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10426071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E174E602D6 for ; Fri, 25 May 2018 03:49:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D06072959E for ; Fri, 25 May 2018 03:49:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2017295A4; Fri, 25 May 2018 03:49:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5798A2959E for ; Fri, 25 May 2018 03:49:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 56EC66B02A4; Thu, 24 May 2018 23:49:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 51D7C6B02A6; Thu, 24 May 2018 23:49:23 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 436CC6B02A7; Thu, 24 May 2018 23:49:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id 1C4226B02A4 for ; Thu, 24 May 2018 23:49:23 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id x30-v6so2901109qtm.20 for ; Thu, 24 May 2018 20:49:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=AaiAmPuCZGmADJhgNKxBO0OEf8+m/cSkGLwy2ZgbWoI=; b=pWjxo+KMseRcZH/dVjP+sfv8u/DBwjijzS/UQuZTxUEYN7N8kL1HTIUjLHzBGSEnZk BCXvtypjtevJA2q6DIPOA6PN0XiHEV9gG5ByQ7KwTUYt9fwwpVohJA0GAC9/T6K8io8z A3UqF3An3GWb0oRZehxtxudoIyQmc73mWfvgA1HemGxrKSppwEGsjXPdgCtI72QZTduw z2MzB+7kIdIdk0Nv4VUWxS6FvTYh+PdQKv/dOQH+LVma5dK1sXGpASmyaOETk7IXLK46 GzO09sabn5sqci2q8O2KzJ2YvLtZGvUiUwjQup6fVQfObTdPVO9X/Vnqd/b+qcmS4xc7 vvPA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ALKqPwcy7RXXo2mawTSu0bl8ItmuGTElJHzIN0FFtgxHojH1ds81gYYc ZHWDS/cw7XGLQrvhGVg8bv3tX2sPMKDlmmYp3nrFnaXVd+U4vSApevwznWly3Eb4K5wzWKBb3zd 4jf3YT5wV3xozIoJWGjFqs7TQ/thAL7/U+RNbRC0XdjrzMWHAbt6nNg845yFhUKetbg== X-Received: by 2002:ac8:2ec7:: with SMTP id i7-v6mr570931qta.157.1527220162927; Thu, 24 May 2018 20:49:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ1W0B9gagbh/U6zNxYMUDWoESdR/fvz75ZMhasEDjLLGHpN9HKwQ+DsDfolQYFLIisrjqp X-Received: by 2002:ac8:2ec7:: with SMTP id i7-v6mr570918qta.157.1527220162450; Thu, 24 May 2018 20:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527220162; cv=none; d=google.com; s=arc-20160816; b=M0Pnk9hh4smprKGpLyj0hM+bYCZYjEtNL4CrU0yIDds7QHunKRzGIVcyI32s1/1FI6 Az/AdRW6LEwgi5ljhNKFL7E11ANfq9SlXXOXjZR+AkbUvmlSqC+b7+9BlBKObrzichR2 uT9MoFWRot7UokFtxNVhahut9K28zzVtWIKJ2eF9rVzkjzAyeSyNBxCd0sDF04w10HyR SZKJf0th+siXQqaqCQn7uwi7/bzHLIPqBJtNWL3svthNF7j8eJkm3/uRFgjal8Iqhz/l dM6vG/p59blZvsBq3BCpNMqNyD0Zo2q9m766S3fuz/ZhuVXm8T13gyxF3TVvvYh+mUAy T/xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AaiAmPuCZGmADJhgNKxBO0OEf8+m/cSkGLwy2ZgbWoI=; b=LcLG1iqMU4jLBa1PTx3rzaLHHP98QnH9+fsTtvBQKz+6eZVQE/n72UDr9z/6/MFbHm PxkNa7CWSUrbwqFiVwVDo+/HiJeovvQDOQUHJbA9CtYhbV46iok4cASrmoc42SwsZujn IkABypl66wokfcInQr6u4rkirWnEe6IhB6jMBXXaWFXvCr7vLjAZi9DSy4I2h8FhZaq0 7poOvMDBXAi2J146iH6+d7fOH9Am38X+Hf+xBqex3c14qUljFD70J9cDrM9+GsRCsRE0 wzEPtunui9v4R7+u3NiH9de+KjdBcVGqJqvGi5z0Anr2kTyQJoOSVyPsDO8lUqfiyCes gehg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id l205-v6si282399qke.170.2018.05.24.20.49.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 20:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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:'' X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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))