From patchwork Mon Nov 26 02:17:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10697467 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 52B1417FE for ; Mon, 26 Nov 2018 02:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 416AA29A8A for ; Mon, 26 Nov 2018 02:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3500429A9B; Mon, 26 Nov 2018 02:21:19 +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 CAB2129AA1 for ; Mon, 26 Nov 2018 02:21:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2D3A6B3F8A; Sun, 25 Nov 2018 21:21:17 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C030E6B3F8C; Sun, 25 Nov 2018 21:21:17 -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 AF3196B3F8D; Sun, 25 Nov 2018 21:21:17 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by kanga.kvack.org (Postfix) with ESMTP id 8464D6B3F8A for ; Sun, 25 Nov 2018 21:21:17 -0500 (EST) Received: by mail-qt1-f198.google.com with SMTP id h17so15415726qto.4 for ; Sun, 25 Nov 2018 18:21:17 -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=yYLS3f8bnPqwUYt8Xj5ITdNjPiFcqq/9bs4atK52tz8=; b=p6y8jcd5IIaQOmoqCddSNbR4DgfQFVmK720cx4556AnUC8VHujVhRGhRsdQ6NWvX5G Y57d0GUU/2jPqVGW/auXnj1vd90y6f8DFQRG3ClA3QXO2bdOwNyhy/G4DqjPoeTRygBV pNj9HUuPTXbllFrws4fj9vxzdVUv9e139yD0miS2jxOlFCDHdV1KdRRDrhQ3LCu6iuOY Th6LZbYyu75+qo6W9abYQ61oFCLPXjyTRfvJaFEV+hfHGH5+TKe6wqr/g6Wdc6/8EZTX fvHH0XTR7C6fwln0Wum18C5BE3R1najH1OO6c8Ln+pELSwXW099AYAHOzKK/YOAxNQ2S z6oQ== 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+aEWb6G1doz3RP9ivHtNVuUdt7XWTkcY2s+cuW+/0lgqVniVDlZbR3 3XDuAQazMlB8TuApqpIhZm8X6XOwEEu+D4tOaJfTxymW/bFL15Gd5kUhDhTr8cdidWt0zpVj5xh vgEU6XoL234eCYGRVwh9OsPOm+w9YqdV2Pal/1jsf/3LIHo/dtOxXb1nOiP+gU1mPAA== X-Received: by 2002:ae9:dd42:: with SMTP id r63mr22380423qkf.264.1543198877305; Sun, 25 Nov 2018 18:21:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/WZczoHigoNPV28q8GJSqewJxXatCLL8+zCkLctP2Dm46kUkLeFWyOUNgPa4bgMvA+2ETCd X-Received: by 2002:ae9:dd42:: with SMTP id r63mr22380402qkf.264.1543198876714; Sun, 25 Nov 2018 18:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543198876; cv=none; d=google.com; s=arc-20160816; b=zLjXuZKMCw0XSnZFaV+ONe4i2yyYXKQD6+/eZ7caq+M/pypxQp8f3VeDfZ5u+DTUd6 qTpG6Vvww+aYTIsmquJu6hlLU96/sGrXJ8e50cdkatUf9Qgu+Wv5u06wpjJPsNuXBv5V Iv565hLT2oH2z5TYQaSJ4A0XPOJylEDcvBj+9d1AJG0CnhN/rdqU45QS0jwoAkGY6GW3 VjruJ7P4A3OsbwPbv77HqAtdRFWTSA023ixbMrKgpWUXhWoXYoOF8djsZ0Qa79yiXzQ4 oSyvp6Sq/++WFMB1uTjwx/sG56XKdVy8e9jV4cxQX5yYI7Wqj0MyJ9tubyp3A6hOeC4e kC1A== 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=yYLS3f8bnPqwUYt8Xj5ITdNjPiFcqq/9bs4atK52tz8=; b=dpbdUnfAGxud8GZgmncZgVBCbpX/ODAOA26PmYCQr2WKCGeii6K9RM8MV5N1suL2+P kCD6SU4r8M9Vz+5xJjOboV7J+YqRnVTDVycXIRg82nkHqneUxAODvTpenaR2scwlR9B3 k2p5bY9Iwmf2jMdJrVwuTNaCxdM2Mfxuf11gTf44tV9a2XWxRt+bh3SfWfRB7u5M97Ra 6On6V9tGUEcmHa6Q3IJpUugb456pPBCu0fTEaKNwH1ClD1ZOvkQ2uIfORTDzZQHaNNXB wDL0JYM0tAJN7b13tAJyL3BE4MxG0PeyO+7sJaAcftfjxXYKW/OFPF5RO5TTOYGUmiKI t59w== 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 25si728655qkz.65.2018.11.25.18.21.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Nov 2018 18:21:16 -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-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84CADC049D7A; Mon, 26 Nov 2018 02:21:15 +0000 (UTC) Received: from localhost (ovpn-8-19.pek2.redhat.com [10.72.8.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E58419744; Mon, 26 Nov 2018 02:21:06 +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 V12 18/20] block: document usage of bio iterator helpers Date: Mon, 26 Nov 2018 10:17:18 +0800 Message-Id: <20181126021720.19471-19-ming.lei@redhat.com> In-Reply-To: <20181126021720.19471-1-ming.lei@redhat.com> References: <20181126021720.19471-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 26 Nov 2018 02:21:16 +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 Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval --- Documentation/block/biovecs.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovecs.txt index 25689584e6e0..ce6eccaf5df7 100644 --- a/Documentation/block/biovecs.txt +++ b/Documentation/block/biovecs.txt @@ -117,3 +117,28 @@ 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 segment. 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 multi-page bvec. The passed 'struct +bio_vec' will contain a multi-page IO vector during the iteration + + bio_for_each_bvec() + rq_for_each_bvec()