Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9536112rwp; Thu, 20 Jul 2023 06:27:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlH8GMKMdzTfRKNcWwMVmQ81C749fsLUplfgaWkedrki3riMUhuIqqJom9d3iv1lKbmq/kO4 X-Received: by 2002:a05:6a00:22d5:b0:682:a6bd:e952 with SMTP id f21-20020a056a0022d500b00682a6bde952mr22267576pfj.6.1689859636113; Thu, 20 Jul 2023 06:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689859636; cv=none; d=google.com; s=arc-20160816; b=t6hov1mvqYDBstg7e+zV2gIBw4ZXYof1aHQXaMyZyv9VMelmCM/nOHlchISiD8oQ2O 0LixuWE4P/zWtHythADGzdkcdnAy3tHYTje9tffQHsx8pLhVFSAX38x0kP0GwMy+koVg wmh8TjSCfIPTKIQiFGARqnFBPfEJBwVpnD+XPHMNDa7xAZ9sav3XBV941aWGN4q+63oL zLyNs+qdA8aBghM/v3rkmtebBADUfwWUjEw6YWVh3MJ4wwToqr1NqBHJZFvJZrWKHS42 3bLF0rSTh6O5VeYOTZfxEicLldXKPOehdFr4dCqNfAQn3OTLy1QOF+UQzgZ0QF9Zy8hN paig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8Y1QTHugPEXYbpmyf3lw/Ri5X8PoHToRc+NjX/L8NgQ=; fh=q8rOnvZaN5Z50YvgZS1uBArX5ZcEEwPcusRFazgmNUQ=; b=wOwrUOA/vGIhngnk+YJXbHl+3ecLC13UI38oSRS/Q7c4XZmHhEFvJBDOklSuT14yxU 4zNiH/SSCC1PD0pLO4m5IwDOddowDlPYWtiL0IqVrHC8RewK+toj6RerBVQx27fd3Aeh yGuEObEg7gPs96V3/WYoqDVW68y93vBZC0INfrDmmLn3SE2o4aJFUFFI/BbTgARzZjqy jyTb9w6Z9dK0BB7bo5WjdIQZO40dVBz4iGQP6z8GDoicDbOIbdFWXHcD1IL5DoQZIN0A y7E5mnNZWM9rhLbl/9e2Bexw8kJElhE45TIwLNgcGbxWDRsjvBRqP0MAF4iGtM2IfC55 whkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ei35-20020a056a0080e300b0067e5edde6eesi882268pfb.302.2023.07.20.06.27.02; Thu, 20 Jul 2023 06:27:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjGTNCV (ORCPT + 99 others); Thu, 20 Jul 2023 09:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbjGTNCU (ORCPT ); Thu, 20 Jul 2023 09:02:20 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 699C910D2 for ; Thu, 20 Jul 2023 06:02:19 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4R6CT02qTZzLntD; Thu, 20 Jul 2023 20:59:48 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 20 Jul 2023 21:02:16 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v3 03/10] mm/page_io: introduce bio_first_folio_all() Date: Thu, 20 Jul 2023 21:01:40 +0800 Message-ID: <20230720130147.4071649-4-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720130147.4071649-1-zhangpeng362@huawei.com> References: <20230720130147.4071649-1-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: ZhangPeng Introduce bio_first_folio_all() to return a folio, which makes it easier to use. Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: ZhangPeng --- Documentation/block/biovecs.rst | 1 + include/linux/bio.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Documentation/block/biovecs.rst b/Documentation/block/biovecs.rst index ddb867e0185b..b9dc0c9dbee4 100644 --- a/Documentation/block/biovecs.rst +++ b/Documentation/block/biovecs.rst @@ -134,6 +134,7 @@ Usage of helpers: bio_for_each_bvec_all() bio_first_bvec_all() bio_first_page_all() + bio_first_folio_all() bio_last_bvec_all() * The following helpers iterate over single-page segment. The passed 'struct diff --git a/include/linux/bio.h b/include/linux/bio.h index c4f5b5228105..027ff9ab5d12 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -253,6 +253,11 @@ static inline struct page *bio_first_page_all(struct bio *bio) return bio_first_bvec_all(bio)->bv_page; } +static inline struct folio *bio_first_folio_all(struct bio *bio) +{ + return page_folio(bio_first_page_all(bio)); +} + static inline struct bio_vec *bio_last_bvec_all(struct bio *bio) { WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)); -- 2.25.1