From patchwork Tue Apr 11 12:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 81935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2534852vqo; Tue, 11 Apr 2023 05:33:39 -0700 (PDT) X-Google-Smtp-Source: AKy350YKyecJ9ZyQxxVuSNzCcFT9DgbK+IL63qTSv7fXpgXnZ6cS9KxamNgEenAadjT2+ISDHvZT X-Received: by 2002:a17:906:630f:b0:94a:8a80:3f4e with SMTP id sk15-20020a170906630f00b0094a8a803f4emr6078999ejc.22.1681216419181; Tue, 11 Apr 2023 05:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681216419; cv=none; d=google.com; s=arc-20160816; b=UTbBjJUpjU15uAK1/26o2jwMb4KAOiRhCYRfN6JgNMMg8Tium9VSARZeDgr+9n4lYQ aruwHm+PM1wwbPF2sT1LIYSolnencGarqpBHzGSiWWaUt6rkzis3oQjDpeQ+cEOKnonq da7SDWgkll0FnraH00gEYcn51U7FnY4V0jHFFhRE41Ifkx2rMmg3MB9n6q1QmKX2FgDU jR0gZXaboa9CD0VSpUP7hO5MRtLxLHsdIFyHD6nRDtb+W+TNENRax31KiXZwhPe7QwfH hLbFoFuLNmSC1DLNHuiA2ftyboH3Z+HyUTPpLedT00JzXaYWsXwopz9s3vRUZPMLbzxT 5oyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=PIVtaWRdXFvvGvca/utIz/lLXjHseGY076GdVp9CofQ=; b=HhNzCaxnRbwx8fCNhm/JoRHHYsLqQfR84V72bjKl/f8W1OiEERVZYx+aLQ1va/7Qge 93zwfg5mglv1niWyk2MHDATjH8jTSJBQ1ww4qgJAGw/KcPC2cEOcQ1aItxzWZbergszR 9g4LoCUaa2GacOOb0+6FGjZdfcWyNh0khaF8C5DlDAWuHSZm2V7bJkDhG77hCLFxmbSN maBS5nzh3JIkaCeb1rRqzzqfkD4pp0dv1fI8l6JaEWv1/SO10cs551iNGqLsiQYFCahl dgas5bmnzD1zOjDax9fwWP8A1/1D/gZvmMYc+Het67o31zwCSi/qyxAweZP4kauJvVF2 9mYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=s+NcSqyq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lf1-20020a170906ae4100b008b17e6556c3si9934467ejb.587.2023.04.11.05.33.08; Tue, 11 Apr 2023 05:33:39 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=s+NcSqyq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229997AbjDKM3f (ORCPT + 99 others); Tue, 11 Apr 2023 08:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjDKM3b (ORCPT ); Tue, 11 Apr 2023 08:29:31 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 001EA212E for ; Tue, 11 Apr 2023 05:29:26 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230411122925euoutp01bad171b2ed3f4aa9d3ab71e4d4daac44~U4THzgCaj0478604786euoutp01X for ; Tue, 11 Apr 2023 12:29:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230411122925euoutp01bad171b2ed3f4aa9d3ab71e4d4daac44~U4THzgCaj0478604786euoutp01X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1681216165; bh=PIVtaWRdXFvvGvca/utIz/lLXjHseGY076GdVp9CofQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s+NcSqyqbq11RtsrC+miaqtF9/zatU92pOylTRwd7fqlJapAX0PouHP1PgEAx/uXx DyeEETwwsyKbo+sFwMBF1sju9QKbpPx1/GJyuzdssfrueHqz7EcEhAZP0KLactXS2B wP3ZGLEpiAXdItnsQ4DEPTcKYoI50y18gs5kxSuc= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230411122923eucas1p2f756a287f9f45b8c76bdbd7f81d949db~U4TF8Df2y3228532285eucas1p2t; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B8.9A.10014.3A255346; Tue, 11 Apr 2023 13:29:23 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230411122923eucas1p27e097fa66db8e166d14658bc7c6f180b~U4TFlFxcc3003730037eucas1p27; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230411122923eusmtrp1f4a4812316778b3dcb34ac05a45a01dd~U4TFkUivq0646206462eusmtrp1S; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) X-AuditID: cbfec7f5-b8bff7000000271e-03-643552a3acbc Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B7.FB.34412.2A255346; Tue, 11 Apr 2023 13:29:23 +0100 (BST) Received: from localhost (unknown [106.210.248.243]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230411122922eusmtip22c05afaf469dd0ad10bc0ac238306b53~U4TFSq8M32761927619eusmtip2k; Tue, 11 Apr 2023 12:29:22 +0000 (GMT) From: Pankaj Raghav To: hubcap@omnibond.com, brauner@kernel.org, martin@omnibond.com, willy@infradead.org, hch@lst.de, minchan@kernel.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, akpm@linux-foundation.org, senozhatsky@chromium.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, Pankaj Raghav Subject: [PATCH v3 1/3] orangefs: use folios in orangefs_readahead Date: Tue, 11 Apr 2023 14:29:18 +0200 Message-Id: <20230411122920.30134-2-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411122920.30134-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGKsWRmVeSWpSXmKPExsWy7djP87qLg0xTDJqvyVnMWb+GzWL13X42 i9eHPzFa7N88hcni5oGdTBYrVx9lsmi/28dksfeWtsWevSdZLC7vmsNmcW/Nf1aLk+v/M1vc mPCU0WLZ1/fsFp+XtrBb7N64iM3i/N/jrBa/f8xhcxDymN1wkcVj8wotj8tnSz02repk89j0 aRK7x4kZv1k8GqbeYvPYfbOBzePX7TusHn1bVj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MS-MailID: 20230411122923eucas1p27e097fa66db8e166d14658bc7c6f180b X-Msg-Generator: CA X-RootMTR: 20230411122923eucas1p27e097fa66db8e166d14658bc7c6f180b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230411122923eucas1p27e097fa66db8e166d14658bc7c6f180b References: <20230411122920.30134-1-p.raghav@samsung.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762883187591908823?= X-GMAIL-MSGID: =?utf-8?q?1762883187591908823?= Convert orangefs_readahead() from using struct page to struct folio. This conversion removes the call to page_endio() which is soon to be removed, and simplifies the final page handling. The page error flags is not required to be set in the error case as orangefs doesn't depend on them. Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Tested-by: Mike Marshall Signed-off-by: Pankaj Raghav --- fs/orangefs/inode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index aefdf1d3be7c..9014bbcc8031 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -244,7 +244,7 @@ static void orangefs_readahead(struct readahead_control *rac) struct iov_iter iter; struct inode *inode = rac->mapping->host; struct xarray *i_pages; - struct page *page; + struct folio *folio; loff_t new_start = readahead_pos(rac); int ret; size_t new_len = 0; @@ -275,9 +275,10 @@ static void orangefs_readahead(struct readahead_control *rac) ret = 0; /* clean up. */ - while ((page = readahead_page(rac))) { - page_endio(page, false, ret); - put_page(page); + while ((folio = readahead_folio(rac))) { + if (!ret) + folio_mark_uptodate(folio); + folio_unlock(folio); } } From patchwork Tue Apr 11 12:29:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 81940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2546389vqo; Tue, 11 Apr 2023 05:55:24 -0700 (PDT) X-Google-Smtp-Source: AKy350ZzZnzjXZrV6EoMAM80biKf+G5vyPT9+vvCCPSrqrZU7DczSdaVQ70Pb3rg1cCdS8ziDVFv X-Received: by 2002:a17:906:6bce:b0:94a:4fc5:4c2e with SMTP id t14-20020a1709066bce00b0094a4fc54c2emr9497081ejs.49.1681217724039; Tue, 11 Apr 2023 05:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681217724; cv=none; d=google.com; s=arc-20160816; b=L6pmft+nUESdzq3E4FNT61/CXi87kAHjLEqkqA95r9lQKxlDZS1zmfDSP2+S5uwpCn Rtqa03dsp81p9YunTgD+R+YfG0RGa5wxVI0hq1VypkJ3M6F4AZJW9XPpySkWxjzD5HoA YjVNt1wrE38H6L/gsnS7+zV2mdf/cmyujbtIaU8WWaTpcdFqc1TUjtWgZ9unul+EGXxi G3e+Ix2BGsfpPwjd/+Q24GDsPZsVWHhrpt0BR8r8LJPAayuRfjOlqVbdxZmlnJ2X93Vy +hASUlmSK8MMVgVDFudntCtGQLuSC72TVpe8NLROOxg1Nr6B4KwORO/bcoWLkvEvB2N5 ZEXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=l7peqDnGhiOjw0ljVfPNDYGwu5jQ8i9/ouCQ6iiHQ5Y=; b=j+PPutjROGdF/LIC+l06hBA0C0qDjeKbBZdgKb2Wn9ShPq2wvTwKLl3CyMdwPmapOK z4XL3PBaqXyxSg3+ftop1OxOK/ZFT7FhvGnEEuukeY9V1eUcPbSmM6rmZVHE+/72snlc xjhIST0ScQjO2qK+CCFRl1xlV5xuWLVuhrujRgtFD6ddg8sff3vU6mCbevX+McI9g1KM G0iDpk0CWVcFCMIuOqQIdcg17rjUB1SQ+rkdBN9YeiXH4+qSIsFgyZY134FgL0m6sQBU DUKWGXBjVlbCGAuSvbYItpqyyEHO12sP5XttE3jIkVQn/RyYGs4v5SAWeSURmLo7/odW oehg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BeGheTcd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a1709062cd400b00922d833a2dbsi2328045ejr.508.2023.04.11.05.54.59; Tue, 11 Apr 2023 05:55:24 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BeGheTcd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjDKM3l (ORCPT + 99 others); Tue, 11 Apr 2023 08:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbjDKM3c (ORCPT ); Tue, 11 Apr 2023 08:29:32 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 103133584 for ; Tue, 11 Apr 2023 05:29:27 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230411122925euoutp027b1c61d0113d2b22e7cf71c46efe5260~U4TIJUOOL0165901659euoutp02T for ; Tue, 11 Apr 2023 12:29:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230411122925euoutp027b1c61d0113d2b22e7cf71c46efe5260~U4TIJUOOL0165901659euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1681216165; bh=l7peqDnGhiOjw0ljVfPNDYGwu5jQ8i9/ouCQ6iiHQ5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BeGheTcdFlFG0Wy/rnM5V3J1/7UuTP2b7hrT0YCLH3mEZsS66F/accCZV0rybI1ZW T6lLMoTjtYTrD8djfrYre+eYhpCFlyPe1R5X7SI9wc4DU7C8vyn7cN8trYygUKURw8 Wu/0T/zi8O9pfVHfeeQV7kiZfKILmuM+4jXtTnts= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230411122924eucas1p23bed121ab289f68a56408d8d79c0df63~U4TGdJ_6P3227632276eucas1p2o; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5A.9A.10014.3A255346; Tue, 11 Apr 2023 13:29:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230411122923eucas1p1dfc182a2c785eeb362b9d670dfe3ba2f~U4TGDwBJQ1913619136eucas1p1q; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230411122923eusmtrp21cfb01c80494ecf51988510dd7078da0~U4TGCeyKw0100601006eusmtrp2n; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) X-AuditID: cbfec7f5-b8bff7000000271e-07-643552a3af96 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7B.58.22108.3A255346; Tue, 11 Apr 2023 13:29:23 +0100 (BST) Received: from localhost (unknown [106.210.248.243]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230411122923eusmtip2e2017259e26006e17d70d3dee3efbbc0~U4TF2Bbap1393113931eusmtip22; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) From: Pankaj Raghav To: hubcap@omnibond.com, brauner@kernel.org, martin@omnibond.com, willy@infradead.org, hch@lst.de, minchan@kernel.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, akpm@linux-foundation.org, senozhatsky@chromium.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, Pankaj Raghav Subject: [PATCH v3 2/3] mpage: split submit_bio and bio end_io handler for reads and writes Date: Tue, 11 Apr 2023 14:29:19 +0200 Message-Id: <20230411122920.30134-3-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411122920.30134-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sf0wTZxjmu7veHZ11Z2HxC9Nt1qARMxxxNZ863C+SXcKSGcElIxrs6A3N 2opXkLpmplOyrUD4tYECna3Oza6YIFXRAg3ya6xIIVpxUKBIVtyA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kh83L4Z0fg7Nrrit2ua6 5UXzI1aDvxfYs8MtLYMV3ly/dFj+6VR/V8ZEvlt/WTqqFPh/dal6R7jXrd+WX5Aes/OhXeyH v5tWz3lpY5B0U+Dr4snzM/pqzh2Z2hI5s1aJpTgj0VCLuag4EQBqd7ZaagMAAA== X-CMS-MailID: 20230411122923eucas1p1dfc182a2c785eeb362b9d670dfe3ba2f X-Msg-Generator: CA X-RootMTR: 20230411122923eucas1p1dfc182a2c785eeb362b9d670dfe3ba2f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230411122923eucas1p1dfc182a2c785eeb362b9d670dfe3ba2f References: <20230411122920.30134-1-p.raghav@samsung.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762883530032353446?= X-GMAIL-MSGID: =?utf-8?q?1762884556553957832?= Split the submit_bio() and bio end_io handler for reads and writes similar to other aops. This is a prep patch before we convert end_io handlers to use folios. Suggested-by: Christoph Hellwig Signed-off-by: Pankaj Raghav --- fs/mpage.c | 54 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 22b9de5ddd68..d9540c1b7427 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -43,23 +43,41 @@ * status of that page is hard. See end_buffer_async_read() for the details. * There is no point in duplicating all that complexity. */ -static void mpage_end_io(struct bio *bio) +static void mpage_read_end_io(struct bio *bio) { struct bio_vec *bv; struct bvec_iter_all iter_all; - bio_for_each_segment_all(bv, bio, iter_all) { - struct page *page = bv->bv_page; - page_endio(page, bio_op(bio), + bio_for_each_segment_all(bv, bio, iter_all) + page_endio(bv->bv_page, REQ_OP_READ, blk_status_to_errno(bio->bi_status)); - } bio_put(bio); } -static struct bio *mpage_bio_submit(struct bio *bio) +static void mpage_write_end_io(struct bio *bio) { - bio->bi_end_io = mpage_end_io; + struct bio_vec *bv; + struct bvec_iter_all iter_all; + + bio_for_each_segment_all(bv, bio, iter_all) + page_endio(bv->bv_page, REQ_OP_WRITE, + blk_status_to_errno(bio->bi_status)); + + bio_put(bio); +} + +static struct bio *mpage_bio_submit_read(struct bio *bio) +{ + bio->bi_end_io = mpage_read_end_io; + guard_bio_eod(bio); + submit_bio(bio); + return NULL; +} + +static struct bio *mpage_bio_submit_write(struct bio *bio) +{ + bio->bi_end_io = mpage_write_end_io; guard_bio_eod(bio); submit_bio(bio); return NULL; @@ -265,7 +283,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) * This folio will go to BIO. Do we need to send this BIO off first? */ if (args->bio && (args->last_block_in_bio != blocks[0] - 1)) - args->bio = mpage_bio_submit(args->bio); + args->bio = mpage_bio_submit_read(args->bio); alloc_new: if (args->bio == NULL) { @@ -278,7 +296,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) length = first_hole << blkbits; if (!bio_add_folio(args->bio, folio, length, 0)) { - args->bio = mpage_bio_submit(args->bio); + args->bio = mpage_bio_submit_read(args->bio); goto alloc_new; } @@ -286,7 +304,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) nblocks = map_bh->b_size >> blkbits; if ((buffer_boundary(map_bh) && relative_block == nblocks) || (first_hole != blocks_per_page)) - args->bio = mpage_bio_submit(args->bio); + args->bio = mpage_bio_submit_read(args->bio); else args->last_block_in_bio = blocks[blocks_per_page - 1]; out: @@ -294,7 +312,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) confused: if (args->bio) - args->bio = mpage_bio_submit(args->bio); + args->bio = mpage_bio_submit_read(args->bio); if (!folio_test_uptodate(folio)) block_read_full_folio(folio, args->get_block); else @@ -356,7 +374,7 @@ void mpage_readahead(struct readahead_control *rac, get_block_t get_block) args.bio = do_mpage_readpage(&args); } if (args.bio) - mpage_bio_submit(args.bio); + mpage_bio_submit_read(args.bio); } EXPORT_SYMBOL(mpage_readahead); @@ -373,7 +391,7 @@ int mpage_read_folio(struct folio *folio, get_block_t get_block) args.bio = do_mpage_readpage(&args); if (args.bio) - mpage_bio_submit(args.bio); + mpage_bio_submit_read(args.bio); return 0; } EXPORT_SYMBOL(mpage_read_folio); @@ -577,7 +595,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc, * This page will go to BIO. Do we need to send this BIO off first? */ if (bio && mpd->last_block_in_bio != blocks[0] - 1) - bio = mpage_bio_submit(bio); + bio = mpage_bio_submit_write(bio); alloc_new: if (bio == NULL) { @@ -596,7 +614,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc, wbc_account_cgroup_owner(wbc, &folio->page, folio_size(folio)); length = first_unmapped << blkbits; if (!bio_add_folio(bio, folio, length, 0)) { - bio = mpage_bio_submit(bio); + bio = mpage_bio_submit_write(bio); goto alloc_new; } @@ -606,7 +624,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc, folio_start_writeback(folio); folio_unlock(folio); if (boundary || (first_unmapped != blocks_per_page)) { - bio = mpage_bio_submit(bio); + bio = mpage_bio_submit_write(bio); if (boundary_block) { write_boundary_block(boundary_bdev, boundary_block, 1 << blkbits); @@ -618,7 +636,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc, confused: if (bio) - bio = mpage_bio_submit(bio); + bio = mpage_bio_submit_write(bio); /* * The caller has a ref on the inode, so *mapping is stable @@ -652,7 +670,7 @@ mpage_writepages(struct address_space *mapping, blk_start_plug(&plug); ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd); if (mpd.bio) - mpage_bio_submit(mpd.bio); + mpage_bio_submit_write(mpd.bio); blk_finish_plug(&plug); return ret; } From patchwork Tue Apr 11 12:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 81936 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2535236vqo; Tue, 11 Apr 2023 05:34:23 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvvT9uWxP0aSfElVjO1PyP5Y9kKp9PCJtQeuW93/PIG9PADdDWApZ0zGA8J400EzXgIwTG X-Received: by 2002:a17:906:768a:b0:932:4255:5902 with SMTP id o10-20020a170906768a00b0093242555902mr7594852ejm.76.1681216463607; Tue, 11 Apr 2023 05:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681216463; cv=none; d=google.com; s=arc-20160816; b=n2gAdEVXLx5xG4vC+v99WQli6sMCfGVbcH9lcNv/ASu0zJxcUQyy0cOPKqcifPD/W1 CXNWsGu0ev2iOa5/xRIsQRHnpKFmemBqe9xnu3/+lsIPNvSvB9XGeBQzPgnSlbbXmdYw fhYAEfowHnV0FpbNlAp/rYDfQaYbYLXqiE9yLsBw7mmJK94Jwrk2Et4HlUG5vv4K8mf6 mpM7I9iLnXJKR3/kRTjJzgC63LxQB1kHleDQAgMKscBxQHwA6UQmF0FZFZxz7E8WQ/Hr pP/oiWt/5u/dHYjsmEkfClTH443y3UJj/OAqrm159mZcgutlyrl7MBhuBw9ZODKV6OP4 dy0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=1qC6zHvAgcTgYm8ljFpJs+7FVJXDek+LLyQQCiQNxfg=; b=GOCxl53AZ2Rli/jYawjW4xT0DzlpWTsWGFo/O+yCWEaa1KvplEFTbzzascxkJt9kQ2 p5uijWOvwX3dzqIvlNsi66v4GueWMPDzUMhQ84y3/TwwpNx/bnFvy3yl447cMqGpvt10 5mYAH0jrele+lcadAJxOZ1AuwVIrXGLootrTyVbfi7BOcB97AThDPk4iumH8Dhww/MLI VaJ/C2K625fCwRVEFRCpjzcUHKQO48n4h1uF4O5dE9CcpooXVIr4+Vz3BLVAIDpDwfTA u5yA8mpILTSlLkZNUOu1EBGaL5FiNhpWQHD15p9qQlm14E6A2r6//UZKbDyMzbochlDx TtZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=k6k7bPGM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 30-20020a17090600de00b0094e111c8786si2277728eji.808.2023.04.11.05.33.59; Tue, 11 Apr 2023 05:34:23 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=k6k7bPGM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbjDKM3i (ORCPT + 99 others); Tue, 11 Apr 2023 08:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbjDKM3c (ORCPT ); Tue, 11 Apr 2023 08:29:32 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC8463C0D for ; Tue, 11 Apr 2023 05:29:27 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230411122926euoutp02092f927e6445f19c569c57cf70217528~U4TInhIKC0164001640euoutp02U for ; Tue, 11 Apr 2023 12:29:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230411122926euoutp02092f927e6445f19c569c57cf70217528~U4TInhIKC0164001640euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1681216166; bh=1qC6zHvAgcTgYm8ljFpJs+7FVJXDek+LLyQQCiQNxfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k6k7bPGMEm2WHoEuC8ctkZLXXHIOTQHQqoV82xAuO9/lme4BfzpuXcLwM22tTO2wG L3UTTJPx6bmJ5ObCRUWkgAaYB1PogBSfjKjSwToyDIL80kxUwhaOZn2anIaaf4esh3 /HVXMrUTHDMOG6Y1maEiN1Ktyk/5rrfuuZnaq0Po= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230411122924eucas1p2a842969709d6b49b03f7c346bb6d7103~U4THBHNHL3227732277eucas1p2w; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 8E.9A.10014.4A255346; Tue, 11 Apr 2023 13:29:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d~U4TGnGH0t0202002020eucas1p1Q; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230411122924eusmtrp241d6a59a92a6a323b6b491c16e7e34ca~U4TGmSAGr0100601006eusmtrp2p; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) X-AuditID: cbfec7f5-ba1ff7000000271e-0a-643552a43e97 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1D.58.22108.4A255346; Tue, 11 Apr 2023 13:29:24 +0100 (BST) Received: from localhost (unknown [106.210.248.243]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230411122924eusmtip2237fca85463f83e9b9eeb88cf4b5bc78~U4TGX3VXf1077210772eusmtip2d; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) From: Pankaj Raghav To: hubcap@omnibond.com, brauner@kernel.org, martin@omnibond.com, willy@infradead.org, hch@lst.de, minchan@kernel.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, akpm@linux-foundation.org, senozhatsky@chromium.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, Pankaj Raghav Subject: [PATCH v3 3/3] mpage: use folios in bio end_io handler Date: Tue, 11 Apr 2023 14:29:20 +0200 Message-Id: <20230411122920.30134-4-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411122920.30134-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJKsWRmVeSWpSXmKPExsWy7djP87pLgkxTDG4vUrOYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8W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I5pPOIz9n/bPVRW7t/c+bYZ5s9WLCa89wnNw6v/YJ+zEVT Jy7eNI+l7/VSw4/fLmy9vGnpD/lbzHfNtymxFGckGmoxFxUnAgCIKuLiagMAAA== X-CMS-MailID: 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d X-Msg-Generator: CA X-RootMTR: 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d References: <20230411122920.30134-1-p.raghav@samsung.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762883234807906833?= X-GMAIL-MSGID: =?utf-8?q?1762883234807906833?= Use folios in the bio end_io handler. This conversion does the appropriate handling on the folios in the respective end_io callback and removes the call to page_endio(), which is soon to be removed. Signed-off-by: Pankaj Raghav Reviewed-by: Christoph Hellwig --- fs/mpage.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index d9540c1b7427..242e213ee064 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -45,24 +45,32 @@ */ static void mpage_read_end_io(struct bio *bio) { - struct bio_vec *bv; - struct bvec_iter_all iter_all; + struct folio_iter fi; + int err = blk_status_to_errno(bio->bi_status); - bio_for_each_segment_all(bv, bio, iter_all) - page_endio(bv->bv_page, REQ_OP_READ, - blk_status_to_errno(bio->bi_status)); + bio_for_each_folio_all(fi, bio) { + if (err) + folio_set_error(fi.folio); + else + folio_mark_uptodate(fi.folio); + folio_unlock(fi.folio); + } bio_put(bio); } static void mpage_write_end_io(struct bio *bio) { - struct bio_vec *bv; - struct bvec_iter_all iter_all; + struct folio_iter fi; + int err = blk_status_to_errno(bio->bi_status); - bio_for_each_segment_all(bv, bio, iter_all) - page_endio(bv->bv_page, REQ_OP_WRITE, - blk_status_to_errno(bio->bi_status)); + bio_for_each_folio_all(fi, bio) { + if (err) { + folio_set_error(fi.folio); + mapping_set_error(fi.folio->mapping, err); + } + folio_end_writeback(fi.folio); + } bio_put(bio); }