From patchwork Wed Nov 21 03:23:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10691805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5864716B1 for ; Wed, 21 Nov 2018 03:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40DA42B4D2 for ; Wed, 21 Nov 2018 03:29:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3484B2B4A0; Wed, 21 Nov 2018 03:29:02 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4B8E2B4A2 for ; Wed, 21 Nov 2018 03:29:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 010B26B23B5; Tue, 20 Nov 2018 22:29:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F03536B23B7; Tue, 20 Nov 2018 22:28:59 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF3626B23B8; Tue, 20 Nov 2018 22:28:59 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by kanga.kvack.org (Postfix) with ESMTP id B491E6B23B5 for ; Tue, 20 Nov 2018 22:28:59 -0500 (EST) Received: by mail-qk1-f200.google.com with SMTP id h68so5547006qke.3 for ; Tue, 20 Nov 2018 19:28:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=TATK8tkd/TMB74rZQtUJZl4+I31LsZJ6ZI6wyMCyWVY=; b=p1gKrAto/hqAo/FZLeQVMpiyUW/JJZV5E4cIlhCcBpZKeH2QuKXC5bD7QrTd2bI5Lv hTiu3NtQC6qPsFzksbCAnSkalkscKYz3Knn3W1fKzM7wBdhTT1gyCA8r7zOiewdw3RBF kjtH7l1p5zZLKd8rxbWpYKJHO0iV0DchX/yGqCO40hgyYghG6N2pZ2/awJxpqJCezyOs PjCzdayOa/XRw5lbX0KCs5ygEIpNSa8zwgPqR1IyzgIZ6MPwGAqLcGjvUbHNoCbuqLF9 jP2uHZhN35Uhmmcgdh8iS5eUg6JI82bdTMOvri0Y5sQzxulbNZikxtA0jBlvzKNU2oNu fs6Q== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AA+aEWbphRcu5ESvS2hfDLTB8CyDzRqMBmGUwldzIVzMnVWYx0Ws+y+r Oyj60aR0eSkF3i+BmDAaGRpiNcD9EJpFfE7WeBdsrZVH13Rz6vjE71/Bh99Lb9gUc6M9elIuVir kUZ3I13RPelh9H0oy+xDmFHcWyXZcxJ++SbGxQBEoE0IwQdnDOb7OrFwDCgJ2cY2WLQ== X-Received: by 2002:ac8:2276:: with SMTP id p51mr4464252qtp.200.1542770939509; Tue, 20 Nov 2018 19:28:59 -0800 (PST) X-Google-Smtp-Source: AJdET5e0CkAVuahKA1+nQ0QJyxY7jWqb/ImiO4Ikc2/br0WtkLSMJUn/lfYKDQlhp8UjJlafgA/O X-Received: by 2002:ac8:2276:: with SMTP id p51mr4464231qtp.200.1542770939006; Tue, 20 Nov 2018 19:28:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542770938; cv=none; d=google.com; s=arc-20160816; b=VVDL4QIstfTSTZzlBlSQiv4K70TQVq5HH0OeSCxIcup9Ew+oiUdxaQq7BXnkgySIBK x0Vyrj3NgUMdMfvri5IS1wHDp/xKdlkCV3Hp4r7WiEJMC3xozc9b7jXAuSVgBk7Rngci 8kQpFdTzxPjOovLnxrpwbdK0wVn1+TfadNPlN2UQT3+QO9rttSo19sRWvhm/PU5Xil30 ulKSHSNsTCFcC2nd4owtWatIYTDU4S0ZJY3gNrt5UuO41sPwIWPlJ+ucjrG+QtlcVOlt husshUx69SjusvBPjO5PtRGgGPa2kRXNMF8g9ghfsfK9AdtPWvMz7q3kRZ12gKqNeYVG ZfpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=TATK8tkd/TMB74rZQtUJZl4+I31LsZJ6ZI6wyMCyWVY=; b=OpClw5FHkVbcfKXV7mMxL1kAU63VaEfRD4i+01qi3pYSHFr9ZZVm0kvg/yphTYDiBw I1dISuIWCnTewwgCkIsJvENgMkjjbdpIBlpR/rnCh2eV9ZOzlkUf0/nLhCp9R6xmoc6K Kazyaf4DBB91uwavgSU2EUOveIGfuHE3a2JM87Wk9NmrardRvabYilRaFaSRXPG8hFjs XYIRyj9a6+xdSsi0N9jjvE6Gm+Ap+uyD+Hw8PsLmpYQYy9WEnWXikzPmpX031Azu33yZ xW3Ffls4Do3DuS7rRH5c1vCrX2V0lDfd+MeYAikswZDB8uHnNbKqu+0vYuCfMt70uOWp +2HA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id z33si18511272qtz.6.2018.11.20.19.28.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 19:28:58 -0800 (PST) Received-SPF: pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13802356D3; Wed, 21 Nov 2018 03:28:58 +0000 (UTC) Received: from localhost (ovpn-8-21.pek2.redhat.com [10.72.8.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36DC810021B6; Wed, 21 Nov 2018 03:28:48 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , Omar Sandoval , Sagi Grimberg , Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Christoph Hellwig , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com, Ming Lei Subject: [PATCH V11 17/19] block: document usage of bio iterator helpers Date: Wed, 21 Nov 2018 11:23:25 +0800 Message-Id: <20181121032327.8434-18-ming.lei@redhat.com> In-Reply-To: <20181121032327.8434-1-ming.lei@redhat.com> References: <20181121032327.8434-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 03:28:58 +0000 (UTC) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovecs.txt index 25689584e6e0..bb008f7afb05 100644 --- a/Documentation/block/biovecs.txt +++ b/Documentation/block/biovecs.txt @@ -117,3 +117,27 @@ 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. They are usually used by filesystem code. Drivers +shouldn't use them because the bio may have been split before it reached 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 bvecs. The passed 'struct +bio_vec' will contain a single-page IO vector during the iteration + + bio_for_each_segment() + bio_for_each_segment_all() + +* The following helpers iterate over single-page bvecs. The passed 'struct +bio_vec' will contain a single-page IO vector during the iteration + + bio_for_each_bvec()