Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5487022imu; Tue, 13 Nov 2018 07:19:23 -0800 (PST) X-Google-Smtp-Source: AJdET5fAXLZM4wSTGzGL/jYbhbuKonSEzUbiDrWfgjO1GK6zeMOpR0wY3rTH6pk/vBKlJn6xkBlt X-Received: by 2002:a17:902:6b82:: with SMTP id p2-v6mr5559431plk.50.1542122363736; Tue, 13 Nov 2018 07:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542122363; cv=none; d=google.com; s=arc-20160816; b=skv+FvRepsSREEhpj95eETPqzW9Gx2qh1sBrHkTVxIDdXLt22lgMX2A+2xrICY2MxO ta+0XCet0U6NHtPQ6FwA+ZsnWSr/dvO/dcQRGuooPKtj/QwyRGPz6LOQ4PMvN2EpYXW4 BkdjXIObagU/oSZbNhKflevgLCXzp1X7itv0NLVPd4ZTIcK6L3jD4MOqE2wWIcJnRcPQ ozpPh99vMNmuSpGGmtpgDGbqm1Wt0Uub3fuYGpAUC5Cuf8Q/nrR7qVLLoG5Bb/yGQqQx VTEijEujnKsE24LwzQSZ+46yhgE0K71sJekaFjzZLURBRVsTYXzxuKmFjos+lTvhB/bq 8Ysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=DLECSiEEoM/EWklmo9pKAYJC8tnzEOCvJzjobn8fpak=; b=nXSTV5MzmnZC5cLYyo3vhet6PUzn/Ep4D5DB1eVIZWLP3kjMlQIl/nXQCXi98+Wz0G b9P3p0NzFPbweODTSGUZ8Xwze9aF3KySFgHEf/86BML5Cv4nxSZdTybf7/27NDd8PNqi PbugR+Xy47gh7QSsYQOBtCkUQ33L2D5F93GFt+lmnDh2TLH0P2UJDrPgdU7tgKLSC2S8 Dob7SJ7zp1+1ZC8ly+AeA4nMA+RfaFabFlCDPBgFBteikPCes/Tx2+ZXheTjFi5747o1 cVQ4zQICpkMHYdwdOFNT6scENi69Yuncfx/vbGtiZK84BE32SHPK5BAqLmMcpylYJvw8 9yhw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186-v6si22665087pfc.95.2018.11.13.07.19.08; Tue, 13 Nov 2018 07:19:23 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388255AbeKNBPW (ORCPT + 99 others); Tue, 13 Nov 2018 20:15:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51662 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388204AbeKNBPV (ORCPT ); Tue, 13 Nov 2018 20:15:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47BED30020C7; Tue, 13 Nov 2018 15:16:47 +0000 (UTC) Received: from localhost (ovpn-8-23.pek2.redhat.com [10.72.8.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 732D9605C6; Tue, 13 Nov 2018 15:16:46 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei , Christoph Hellwig Subject: [PATCH V9 16/19] block: document usage of bio iterator helpers Date: Tue, 13 Nov 2018 23:15:02 +0800 Message-Id: <20181113151505.15498-17-ming.lei@redhat.com> In-Reply-To: <20181113151505.15498-1-ming.lei@redhat.com> References: <20181113151505.15498-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 13 Nov 2018 15:16:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now multi-page bvec is supported, some helpers may return page by page, meantime some may return segment by segment, this patch documents the usage. Cc: Christoph Hellwig Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovecs.txt index 25689584e6e0..bfafb70d0d9e 100644 --- a/Documentation/block/biovecs.txt +++ b/Documentation/block/biovecs.txt @@ -117,3 +117,29 @@ 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 whose names have the suffix of "_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 they got to the driver: + + bio_for_each_segment_all() + bio_first_bvec_all() + bio_first_page_all() + bio_last_bvec_all() + +* The following helpers iterate over single-page bvec, and the local +variable of 'struct bio_vec' or the reference records single-page IO +vector during the itearation: + + bio_for_each_segment() + bio_for_each_segment_all() + +* The following helper iterates over multi-page bvec, and each bvec may +include multiple physically contiguous pages, and the local variable of +'struct bio_vec' or the reference records multi-page IO vector during the +itearation: + + bio_for_each_bvec() -- 2.9.5