From patchwork Tue Dec 27 15:56:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9489407 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 7EECC62AB6 for ; Tue, 27 Dec 2016 16:01:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71A0C25F3E for ; Tue, 27 Dec 2016 16:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65BD02621F; Tue, 27 Dec 2016 16:01:42 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F37CB223B2 for ; Tue, 27 Dec 2016 16:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755771AbcL0QBc (ORCPT ); Tue, 27 Dec 2016 11:01:32 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36446 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755672AbcL0QB3 (ORCPT ); Tue, 27 Dec 2016 11:01:29 -0500 Received: by mail-pg0-f66.google.com with SMTP id n5so12796616pgh.3; Tue, 27 Dec 2016 08:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WKdg69GOfhlkMQOT45vZLKKjxukZtx8K8X3a3hxd32Y=; b=ZJnokJJuwea8FjMzNUowALnUvVGI68VSpaQgtM1hXtR6wGjNC01VTAXf7u0Lb5VJ5F lo1zzO2OcYFKxX/ogZBGe1qxmIg7lygmIGZaf9BQIzVIF/YHQ4+0s9fBNcGYd06PpQ/x 0kOSY18DxB2CoL/CKte+XGp42vfg3/4R1rrPVIOIrRz2+JHIomDbMIVnhAPxG8qb7EZC xx1BnRmYDgClmBHweIrANtmFvAcEYxd1uzjkuqLjWBR1sZ2oWOyp5x46ndV2g/lahi+J xy72OPoxprYIncJnXR2NUKTHBqn0JbTPe2/yT7R+cmUwJkJxNs90eCdFSwc4dooR3k+j LnjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WKdg69GOfhlkMQOT45vZLKKjxukZtx8K8X3a3hxd32Y=; b=W1qW44qMs86VJhzmL5Qma6bQA5O71QtuXTZ01UKyz4R/saRHfyaJejbnbpJue76flt Fw9DmkBNhhzQv7mfUNmCTg2Nv26rNiDkTUExMBW6Pzad1hpZRDfrCIzpbEg9I0u5Pj0L UMklkf5Be4CUxjWbLtSPQwv9TWa3QZZu62EIhDyXSpB8VuWpSi0EZYh/qygxOBEMD4HH uQwbgBnKDaIF/R3mwzIovvzQgqEm8ykRw+PBFHMG6mgQYIOBJq7+DIOv+IDEwh+i9Vhj CXYRRIYkz+TSxK2+/p4zxOTMXV3E2VlnuKoCcEO2yk7LzoE8UoIvsaBOr91GCpUyyXQR ZxMw== X-Gm-Message-State: AIkVDXJz0xWVpCFJQnmRRXWaPRSUj5FqLSS2mH6uC1apxSNzOib0+xv67qdWxzpnVKa35A== X-Received: by 10.98.155.221 with SMTP id e90mr21401907pfk.2.1482854434010; Tue, 27 Dec 2016 08:00:34 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id c22sm91408955pgn.12.2016.12.27.08.00.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 08:00:32 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Johannes Berg Subject: [PATCH v1 18/54] bvec_iter: introduce BVEC_ITER_ALL_INIT Date: Tue, 27 Dec 2016 23:56:07 +0800 Message-Id: <1482854250-13481-19-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482854250-13481-1-git-send-email-tom.leiming@gmail.com> References: <1482854250-13481-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce BVEC_ITER_ALL_INIT for iterating one bio from start to end. Signed-off-by: Ming Lei --- include/linux/bvec.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index f8a8b293cd32..5c51c58fe202 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -183,4 +183,13 @@ static inline void bvec_iter_advance_mp(const struct bio_vec *bv, ((bvl = bvec_iter_bvec((bio_vec), (iter))), 1); \ bvec_iter_advance((bio_vec), &(iter), (bvl).bv_len)) +/* for iterating one bio from start to end */ +#define BVEC_ITER_ALL_INIT (struct bvec_iter) \ +{ \ + .bi_sector = 0, \ + .bi_size = UINT_MAX, \ + .bi_idx = 0, \ + .bi_bvec_done = 0, \ +} + #endif /* __LINUX_BVEC_ITER_H */