Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6671984imm; Wed, 27 Jun 2018 11:15:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdg/L3x7aAl9P/oR59jxQm5V7N27uAqm+aCVOnnIij5GEnoYXhIWqqcAkRNlDaHV60eL6Ww X-Received: by 2002:a62:930c:: with SMTP id b12-v6mr6901046pfe.193.1530123311566; Wed, 27 Jun 2018 11:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530123311; cv=none; d=google.com; s=arc-20160816; b=UAnX3GUpHNMT26ftDNsWKCmcbpH+X//qqS/S6fJMKUTFMRh4SQRhGmWj5KOyOm81JB S1rAmtL8mIM9flIuFO0oh4ZNJ1pBXEXFRakBKmCNhif63o6DqJ2r+H+ylIBeQHp7p+eW u9LZFXihN4s924PFshNBiewN0uT6+zASk75RrlR6pUQelAntTn5bxUte3jG7By0KB83y 7qd7Vd3mXT+UgxFs1f5URP5I1QXANDSV3J7eFRHNubmTqGilZLt+l4XoR+ieJzw+aTTa p15YPugBY32llqwn+9EfqXMTSA12nx/K7bCLPtKdJT8gjJmT8javAQbsLfIvmbqOzGBs AZ5Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=DBl1T1oPZWEt0yUR/Al7AEJfWm+DmJ+hXGN+h+pSnXM=; b=IoNkNyhIurnQYSw8DyzYshsCBLT6iw8jXbLE0UdZelLYe1PgOHu6+EelvXL2Kzfzjw YJ9jZQ30TiiYcuWNMTzdGMlNM7H3WHBe8DpDAKFLAu5fBOHx7o08o0srPBMLUoFgY7uw gHq9WsPDaSp1y0xVK7aFLcrUAvigSEpqrV0QDkxOx9jRtUqhIcX/hy8DkU7uV3+My8ho lkV3VtdNMDyFZG8sYlJ+tk8RCM7Sg2BL/FIaeao+slmC/Vlgq3LFw54UO+xkvXkd4Dgm DDfJxFemfa0p0ap/t/jy8sTBNUN1ehtG0m91KtbnbiZKLhdQrJ9lOvGhTvr2QGQGzWap koew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rGwqEDUH; 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 m3-v6si4698659plt.71.2018.06.27.11.14.57; Wed, 27 Jun 2018 11:15:11 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rGwqEDUH; 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 S965749AbeF0SOA (ORCPT + 99 others); Wed, 27 Jun 2018 14:14:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49884 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965539AbeF0SN6 (ORCPT ); Wed, 27 Jun 2018 14:13:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DBl1T1oPZWEt0yUR/Al7AEJfWm+DmJ+hXGN+h+pSnXM=; b=rGwqEDUHSOeR7SFg1kH6R8FAM PHGaHPOYmen1SDnm0a0cW5O6RWcpciqgU5+CtnvRmZr7vNgd8aEYaItiY0/LgjHiwNSB0aGGUWv/F plshzDfyHS4KC1sECFKeUKUspKk2iQ5jwE0+RX2ygr2rQU3SqikCwtJeXUl7CJqYUOKFCDDda3hvF spueZKryt/QJsz0/YDyW7mp6T0QiA/wjcX4S/ETUlETn2d5pSQh4IIoxCWYJMO/2SS4sDBchk1rzH Y/M6smhubRHaxkswbtpnU7sJQX6Xv6qTmyHoGUxkTvj6Ap06Rvf93j2W15MvS2mqNTYYxXYQqXgjI LRWhiqWZQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYEwu-00007W-GW; Wed, 27 Jun 2018 18:13:48 +0000 Subject: Re: [PATCH V7 24/24] block: document usage of bio iterator helpers To: Ming Lei , Jens Axboe , Christoph Hellwig , Kent Overstreet Cc: David Sterba , Huang Ying , Mike Snitzer , 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 References: <20180627124548.3456-1-ming.lei@redhat.com> <20180627124548.3456-25-ming.lei@redhat.com> From: Randy Dunlap Message-ID: <98d6ba9d-ec7a-b05b-94bb-e798ad0e0ea7@infradead.org> Date: Wed, 27 Jun 2018 11:13:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180627124548.3456-25-ming.lei@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/27/2018 05:45 AM, 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 | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovecs.txt > index 25689584e6e0..f63af564ae89 100644 > --- a/Documentation/block/biovecs.txt > +++ b/Documentation/block/biovecs.txt > @@ -117,3 +117,30 @@ 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: > +================= > + > +* The following helpers which name has suffix of "_all" can only be used on helpers whose names have the suffix of "_all" can only be used on > +non-BIO_CLONED bio, and ususally they are used by filesystem code, and driver usually > +shouldn't use them becasue bio may have been splitted before they got to the because split > +driver: > + > + bio_for_each_segment_all() > + bio_first_bvec_all() > + bio_first_page_all() > + bio_last_bvec_all() > + > +* The following helpers iterate over singlepage bvec, and the local preferably: single-page > +variable of 'struct bio_vec' or the reference records single page io IO or I/O > +vector during the itearation: > + > + bio_for_each_segment() > + bio_for_each_segment_all() > + > +* The following helper iterates over multipage bvec, and each bvec may preferably: multi-page > +include multiple physically contiguous pages, and the local variable of > +'struct bio_vec' or the reference records multi page io vector during the multi-page IO or I/O > +itearation: > + > + bio_for_each_bvec() > -- ~Randy