From patchwork Sat Oct 29 08:08:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9403353 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 1E7E760587 for ; Sat, 29 Oct 2016 08:24:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B4662A13D for ; Sat, 29 Oct 2016 08:24:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F31392A60D; Sat, 29 Oct 2016 08:24:51 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 B427C2A13D for ; Sat, 29 Oct 2016 08:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942253AbcJ2IYf (ORCPT ); Sat, 29 Oct 2016 04:24:35 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33792 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034087AbcJ2IOo (ORCPT ); Sat, 29 Oct 2016 04:14:44 -0400 Received: by mail-pf0-f193.google.com with SMTP id u84so3380405pfj.1; Sat, 29 Oct 2016 01:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iYtOvWklwu/uviKmAEqg2jQtEbspwLUajQXbD8L5688=; b=0cx/fVZfbCYBaFosCv1g5scKve1lxfD/7iOAguJizH9vBjeJ+/0gYFgiG8jdBfxXyD x1VSHtJMK6t/M1fhDk7czrx/XVWfySHKBvwPU5Pa2ERaMm9sYLUEl2lo841/L99PibrJ Tm+yKTSNgqrL+d1a/K9aHMP1LLNxxZwIpCp+Lmgr7SZLNyvMeqvlDqSUWVM0RP4CICEd 8qJ1Lw6ANklRA53cZRQ1Afv5da8aWjfKp45xRbLDMk5NVl0NQLdS2XS14mvVzDjMsA7W ccCJVo+e6M4H+6S2q5CiOLsf9CnxSX6I5sukgUlULxqmugoc8CuQw/UXBD/dxa/7SyKP +K2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iYtOvWklwu/uviKmAEqg2jQtEbspwLUajQXbD8L5688=; b=P0uPHCW8vZvCyJjV9FOt/U56xTQI/sWzkqpD1sWHWLAeBA/TsZqC1ILq2mWN1Egf+I u4Ubc6lfXg7kAjSYCF7HvsrUy2Xjxy93+LEESRuMyRv7ukF8/bcUatcxzWQjLdf7F4/k 1uknsgBMjlxM+FK1rgLrDvALGwiTBa8cWdWlR0L55q0U4DrfeUncStBlTZCo2/HEtlsl lHTqsHNhZKdIiG6wqhq8MrDHleHEmz2NDSmdj7Efy4XhWBA5/H3aWpOUEibXSrY3h9oD YRiJvXDN9dGqjgPO9WG44P3k+fUZucjMgbj4ACwfea8lN9ajnwc0K8RVgZIaZJ0HDs4V Al+A== X-Gm-Message-State: ABUngvecevUlQVtN5t229EtMz+y3xlJbY1aJO01eW25UJfZzeg9tSsRRq9mB3BnKeUhIow== X-Received: by 10.99.112.72 with SMTP id a8mr26358391pgn.43.1477728883965; Sat, 29 Oct 2016 01:14:43 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id h8sm23597109pab.9.2016.10.29.01.14.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:14:43 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Kirill A . Shutemov" , Ming Lei , Johannes Berg Subject: [PATCH 35/60] bvec_iter: introduce BVEC_ITER_ALL_INIT Date: Sat, 29 Oct 2016 16:08:34 +0800 Message-Id: <1477728600-12938-36-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> References: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 9df9e582bd3f..e12ce6bd63d7 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -183,4 +183,12 @@ 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)) +#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 */