Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp948412imm; Fri, 15 Jun 2018 08:44:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKd4Ry+UQ0BzzPSU9XIVFmBNB2uGx5aKdMZq1QDXQivIjKNPHDJwB5NShthzkECRpg4ZCuJ X-Received: by 2002:a62:be0a:: with SMTP id l10-v6mr2498176pff.180.1529077479674; Fri, 15 Jun 2018 08:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529077479; cv=none; d=google.com; s=arc-20160816; b=FRgevgj8Yoi657o1UqVlX0ETk/H6Zg1VyrAK7vkPCvcmIUmyUVh+Sv/NOKNlHllkqU I3BwC+Z7mLpcVM7YYZIFGER2wk52ZZ9GdKljlUkPBQrUKXv3mtWnWMQmkbeX+T1KlfOP zhAnNRWaJ6i7agcfBN5+Z15IEHkvNdu3vt0RCwzxAHJCAmSyCPCOC9TdL8rpBELgL57B 96Cr+CAgfNHWrqzBG1aFNF01m01UTQWlEUAN1YpB2dEV7WGz39aGwo7niY3KYedxtKwb Et+oTAZNHYZbsH49MA7FuNg93meX2xrRpiLlpvlNnr0DYB/4x5FFWOYl7IOd7kk8uZjZ ZcXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=GQOFAutXBWiG9B4xuWV7EbrHAbBfE5+ZBzsNGbC/ATw=; b=eigZYTCpAxBgo+LIymnGn0W5hSflmYwy1DYm9yuF5fiANXvhV3ynjpdeNfRd9zHQYp zp2BlQNB5CHuIK24dpYa9ODqE1BISEP6MAzwl3XRxtuvJKyU4VWfXjX80/yljp1imwd6 nd5LrqmU1WqPPZlqmu0gYiCYZhqNu8b5NoAs06eAMt5L5OzhMsc9owTsHFa5auC08EGz 6YXA/VxD6NJgZHzKBrO/zVqqIJWfJOZufMRWZLHIYgY6U3yuRvTQb8o/iDz5jc9uFZZp LczwM3aZpRq0WErJV45lnuTyvN3SFOxMQTYoRtYtIbdiDKHW0pvXrBiexV0N3cC/BZJT VAnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@profitbricks-com.20150623.gappssmtp.com header.s=20150623 header.b=vKUOoby1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10-v6si6739982pgo.643.2018.06.15.08.44.25; Fri, 15 Jun 2018 08:44:39 -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; dkim=pass header.i=@profitbricks-com.20150623.gappssmtp.com header.s=20150623 header.b=vKUOoby1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965923AbeFOPoB (ORCPT + 99 others); Fri, 15 Jun 2018 11:44:01 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38996 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965684AbeFOPn7 (ORCPT ); Fri, 15 Jun 2018 11:43:59 -0400 Received: by mail-wm0-f65.google.com with SMTP id p11-v6so4649744wmc.4 for ; Fri, 15 Jun 2018 08:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GQOFAutXBWiG9B4xuWV7EbrHAbBfE5+ZBzsNGbC/ATw=; b=vKUOoby1Hj+F5hrfRj6q5Xpd+JaWj+oudczYTf5xPjonKpm6/tACX5q6AYdwb5JI78 NYbwUFjYdourX93ro9DTimDlMp9C16kIpCxmNUnPAc8dEQLjgVbWy6bU3On4PjijNEGl Z+oo62xhiV34WcQVK5x6BpRrmdNXtbw0pK4aoGHqsIBRSUpFOqNMDk8hwhKsVIgXWXqP wbzeeVvXBcDEJiX9byfV2cUJU88ml7qEdc+y3s8Euy01y9o1KAsZ+Ai4M+z7MA4R3sqd 8Y89+LBgcS2fzy6jjhqL+wuNzMjWk1NR9QARMcEKERijFhAGtlUUM3JYboPTL/uzujw7 ZNig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GQOFAutXBWiG9B4xuWV7EbrHAbBfE5+ZBzsNGbC/ATw=; b=BEtgLztgB3yjPCjfDbDZ2GWddp0fi1nl1h5w94xM/FPd07xIcRCjSX+AdGwXuZJFiv dYm2JvcJJyAcz2sL9TeysC4azVZKBxCEmW8+mos/Ww8qFYg9rO0MazzTeXGbasal6Gf9 ROiE3H8AVU6cB6OlkXrfG7Zm+4KvnqGpmDtb2M8QZ4MDZshNoj97+CKbZrNqfaIrTNws uX5K0iSm3D0+QsMHX4UCGlZtjtYMRFg5kt9b5NqYexX2c3eMvEBFpK1DBgCbJ7C7054p 6+1AxxTOEOJFJr9L+5Z4R5tDGgJ2GQ0ebjWQ83Fjf6ebTINpb6xjKOP2WdBhH3VSB/Bo BrEw== X-Gm-Message-State: APt69E2fBnxyPNUa1QoZRsHyRxOP4MY/T/iE1hMhz+V9jDpDhHrNVRDC bbIfRUjcGYHvQj+Jyd229lPcqIgut6HL3+rEF8Z1og== X-Received: by 2002:aa7:c756:: with SMTP id c22-v6mr2355057eds.144.1529077437994; Fri, 15 Jun 2018 08:43:57 -0700 (PDT) MIME-Version: 1.0 References: <20180609123014.8861-1-ming.lei@redhat.com> <20180609123014.8861-31-ming.lei@redhat.com> In-Reply-To: <20180609123014.8861-31-ming.lei@redhat.com> From: Gi-Oh Kim Date: Fri, 15 Jun 2018 17:43:22 +0200 Message-ID: Subject: Re: [PATCH V6 30/30] block: document usage of bio iterator helpers To: ming.lei@redhat.com Cc: Jens Axboe , hch@infradead.org, Al Viro , kent.overstreet@gmail.com, dsterba@suse.cz, ying.huang@intel.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, tytso@mit.edu, darrick.wong@oracle.com, colyli@suse.de, fdmanana@gmail.com, rdunlap@infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 9, 2018 at 2:36 PM Ming Lei wrote: > > Now multipage bvec is supported, and some helpers may return page by > page, and some may return segment by segment, this patch documents the > usage for helping us use them correctly. > > Signed-off-by: Ming Lei > --- > Documentation/block/biovecs.txt | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovec= s.txt > index 25689584e6e0..3ab72566141f 100644 > --- a/Documentation/block/biovecs.txt > +++ b/Documentation/block/biovecs.txt > @@ -117,3 +117,33 @@ Other implications: > size limitations and the limitations of the underlying devices. Thus > there's no need to define ->merge_bvec_fn() callbacks for individual = block > drivers. > + > +Usage of helpers: > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +* The following helpers, whose names have the suffix "_all", can only be > +used on non-BIO_CLONED bio, and usually they are used by filesystem code= , > +and driver shouldn't use them because bio may have been split before the= y > +got to the driver: > + > + bio_for_each_chunk_segment_all() > + bio_for_each_chunk_all() > + bio_pages_all() > + bio_first_bvec_all() > + bio_first_page_all() > + bio_last_bvec_all() > + > +* The following helpers iterate bio page by page, and the local variable= of > +'struct bio_vec' or the reference records single page io vector during t= he > +iteration: > + > + bio_for_each_segment() > + bio_for_each_segment_all() bio_for_each_segment_all() is removed, isn't it? > + > +* The following helpers iterate bio chunk by chunk, and each chunk may > +include multiple physically contiguous pages, and the local variable of > +'struct bio_vec' or the reference records multi page io vector during th= e > +iteration: > + > + bio_for_each_chunk() > + bio_for_each_chunk_all() > -- > 2.9.5 > --=20 GIOH KIM Linux Kernel Entwickler ProfitBricks GmbH Greifswalder Str. 207 D - 10405 Berlin Tel: +49 176 2697 8962 Fax: +49 30 577 008 299 Email: gi-oh.kim@profitbricks.com URL: https://www.profitbricks.de Sitz der Gesellschaft: Berlin Registergericht: Amtsgericht Charlottenburg, HRB 125506 B Gesch=C3=A4ftsf=C3=BChrer: Achim Weiss, Matthias Steinberg, Christoph Steff= ens