From patchwork Wed Mar 22 13:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13184083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D7DDC74A5B for ; Wed, 22 Mar 2023 13:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbjCVNu5 (ORCPT ); Wed, 22 Mar 2023 09:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbjCVNup (ORCPT ); Wed, 22 Mar 2023 09:50:45 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81E8D637E4 for ; Wed, 22 Mar 2023 06:50:22 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230322135017euoutp01ddb1904514623b15c26d7e38065cd98a~OwgBbmoEn1803618036euoutp01H for ; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230322135017euoutp01ddb1904514623b15c26d7e38065cd98a~OwgBbmoEn1803618036euoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1679493017; bh=ayJOnQy0cJGhVp2X4oA4O9yHIEvSlM4NjOeswQrRlbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxLxuMv8Fbh+flqd2wfT4DFjYUWiYF+pAGZG9jq1MkD34NB7EFUWc69IwJhVM8BCY Cije3dHiyaTah0viBkegX6iXobpP9SoDCR/sAOgdWL3qRZkb2osNgxPr76u1Cm7yv5 upYfW+rPBqS1isBzkPhwoeVQo9mPdo3Cv7ETQCjA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230322135016eucas1p25117e603c54a51fa479f59756c985bea~Owf-8x0Je2739227392eucas1p2l; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 7E.84.09503.8970B146; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090~Owf-hW9Mr1936419364eucas1p1R; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230322135015eusmtrp27e8edde4a243950d6e8a8590cf408615~Owf-ghEWR0726007260eusmtrp2D; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-e0-641b0798d498 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 99.6E.09583.7970B146; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230322135015eusmtip26a172e30dde79a8b20bac498b7926a53~Owf-T0JHc1265312653eusmtip2f; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) From: Pankaj Raghav To: senozhatsky@chromium.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, willy@infradead.org, brauner@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, hubcap@omnibond.com, martin@omnibond.com Cc: mcgrof@kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav Subject: [RFC v2 1/5] zram: remove zram_page_end_io function Date: Wed, 22 Mar 2023 14:50:09 +0100 Message-Id: <20230322135013.197076-2-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322135013.197076-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBKsWRmVeSWpSXmKPExsWy7djPc7oz2KVTDCZt57GYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSza7/YxWey9pW2xZ+9JFovLu+awWdxb85/V4uT6/8wWNyY8ZbRY 9vU9u8XnpS3sFrs3LmKzOP/3OKvF7x9z2BwEPWY3XGTx2LxCy+Py2VKPTas62Tw2fZrE7nFi xm8Wj4apt9g8ft2+w+rRt2UVo8fnTXIem568ZQrgjuKySUnNySxLLdK3S+DKOLrzD2vBFq6K P5cMGxjPcHQxcnBICJhITD4u3MXIxSEksIJR4tq9X0wQzhdGic9HrjBCOJ8ZJY6+uMrSxcgJ 1vF30kJmiMRyRokZb59CVb1klFh3fjsryFw2AS2Jxk52kLiIwBlGiSlNMxhBupkF7jNKnN4L NklYwEZi17OJ7CA2i4CqxNb2p2BxXgEriYd/u9ghtslL7D94lhnE5hSwlni0aBobRI2gxMmZ T1ggZspLNG+dzQxRv5pT4vJPNwjbRaKj4zMrhC0s8er4FqiZMhL/d85ngrCrJZ7e+A32jYRA C6NE/871bJCAsZboO5MDYjILaEqs36UPEXWU2LpSB8Lkk7jxVhDiAD6JSdumM0OEeSU62oQg ZitJ7Pz5BGqnhMTlpjlA97ID2R4SnaoTGBVnIXlkFpJHZiEsXcDIvIpRPLW0ODc9tdgwL7Vc rzgxt7g0L10vOT93EyMw8Z3+d/zTDsa5rz7qHWJk4mA8xCjBwawkwuvGLJEixJuSWFmVWpQf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GJg/EQowQHs5IIrxuzRIoQb0pi ZVVqUX58UWlOavEhRlOguycyS4km5wPTRV5JvKGZgamhiZmlgamlmbGSOK9nQUeikEB6Yklq dmpqQWoRTB8TB6dUAxPbn39uX3UDP0/cNsl0f2OOVGjumYzJU78I87p8dtJd/ufstAPqPTP6 WWU948/0THqW+1TZeMeFJW8t7wdELhS+wFOo2m+64ax2lC/HZ+EA9uBpT/bUrfrtaH3rRswP h63i7zZqG2S1il3Zddwtz+XZ9+mH98Y5/Jhx/ZXBlLqorbVxUwtMHoXd1P4VZBsRI3v0pxXL 4xTW+K5F53gCs+Y0BH/4vWDvGRnGukuP+A/s4lplmSEt7S+kEjG1Lfa8+Y2T6SyzOMSEF65d uOBbi+eBmqq5rT5GefqHZ80K79i469bZ+0r/uS/4nr9z4JbH7xSB6z+Tf1lMqr2z38zsK6Pc 81/r9khvuio35/rLAt1LSizFGYmGWsxFxYkAUAi+E18DAAA= X-CMS-MailID: 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090 X-Msg-Generator: CA X-RootMTR: 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090 References: <20230322135013.197076-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org zram_page_end_io function is called when alloc_page is used (for partial IO) to trigger writeback from the user space. The pages used for this operation is never locked or have the writeback set. So, it is safe to remove zram_page_end_io function that unlocks or marks writeback end on the page. Signed-off-by: Pankaj Raghav --- drivers/block/zram/zram_drv.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index b7bb52f8dfbd..2341f4009b0f 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -606,15 +606,6 @@ static void free_block_bdev(struct zram *zram, unsigned long blk_idx) atomic64_dec(&zram->stats.bd_count); } -static void zram_page_end_io(struct bio *bio) -{ - struct page *page = bio_first_page_all(bio); - - page_endio(page, op_is_write(bio_op(bio)), - blk_status_to_errno(bio->bi_status)); - bio_put(bio); -} - /* * Returns 1 if the submission is successful. */ @@ -634,9 +625,7 @@ static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec, return -EIO; } - if (!parent) - bio->bi_end_io = zram_page_end_io; - else + if (parent) bio_chain(bio, parent); submit_bio(bio); From patchwork Wed Mar 22 13:50:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13184082 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F026EC74A5B for ; Wed, 22 Mar 2023 13:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230395AbjCVNux (ORCPT ); Wed, 22 Mar 2023 09:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbjCVNup (ORCPT ); Wed, 22 Mar 2023 09:50:45 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80DA32117 for ; Wed, 22 Mar 2023 06:50:22 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230322135018euoutp021b480a64f8d78cb4c55989c2a537c901~OwgCO9EAu1887418874euoutp02S for ; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230322135018euoutp021b480a64f8d78cb4c55989c2a537c901~OwgCO9EAu1887418874euoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1679493018; bh=B7mV7FXyoTd1l8VtYDL/Y6/ww7FK/3anjYTB9ana5Ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B3kZYXG7gxRoA/syaoUAWSE3836oL/3vMQg6n4Pog4cc/CWBbpD883LaemojNNVtc HmB4uByLwCiVHTVmDNnRliYXqdTAhhy9SSZqwHHar9pHcz+/9/8GsXkR9fZImR9tr2 tOXl7dYx20ooyXimmvn5pEuCWtK4gC8pPRWcawkc= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230322135016eucas1p249e0287ce2648121944ff9859e7ca930~OwgAmbtE_0614806148eucas1p2s; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id CF.84.09503.8970B146; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230322135016eucas1p2ee1b64175f621ee425f7f48cb908dc20~OwgAQ7_-H2731127311eucas1p2h; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230322135016eusmtrp2b58b16b46a6e5ebd71064b4e97c60834~OwgAQS0ON0726007260eusmtrp2H; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-e2-641b07981cc7 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0D.52.08862.8970B146; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230322135016eusmtip2fb1d581c86b27c823127c62671bcf838~OwgACUjVU2536025360eusmtip2t; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) From: Pankaj Raghav To: senozhatsky@chromium.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, willy@infradead.org, brauner@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, hubcap@omnibond.com, martin@omnibond.com Cc: mcgrof@kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav Subject: [RFC v2 2/5] orangefs: use folios in orangefs_readahead Date: Wed, 22 Mar 2023 14:50:10 +0100 Message-Id: <20230322135013.197076-3-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322135013.197076-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SfUwTZxjfe3e9HnUlxynpgyXqGl0iIgy3jINNxzKml21uc9k/28iwsTc+ bIG01M8sqQVhMlddA44B4uKAIX40FEHrIAjM1aZFsoEWKehGyjJ1xNljG59l3K5m/ve8v+f3 9SQvhTMB2Uoqr6CYNxZo9RpSQXT8OHNjY7VcrXvOLrzI1jnOkezZsWMk+6AvhNjutkqMvX3V hbHlYzaM7RrZwHZ2eQh28Eodyd45tyhjPY5FnB0+PoHYpr8eylmhsVTOft96mmQHFtwydm66 jsyI4WotPxFcW3MCN9hv5pwtR0jOGbLLuevVcwRnqRohudnAqIyzXWxBnOBcxTmDk9i7yz5U vKzj9Xl7eGPylp2K3HmLV14UpvZN+KZxCzojr0BRFNAvgO2SF6tACoqhmxEErNeR9JhC0C4c JkQWQwsIbn+7/bHizC1BJuHfIShvXyMJ7iE4WnV1yYqiSDoBDh2Ri/gK2oeg0lqNRAFO30Xg 7frPdDmdAYsNdpnIJ+h1MHIqXoSVdDr0+JsIKWs1dPf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YnbC5sYIWxhiT/Xutggip4zSuw/sxSom4ODTUBLorETbJCI wA1GifZVeiA1zCA1l5/OZgZJCAs4SPxfMokVpJ5FQFXi1nwZkDCvgJXEwevLWCDmy0vsP3gW rJxTwFri0aJpYDcIAdVc3g/SClIvKHFy5hOwemag+uats5knMArMQpKahSS1gJFpFaNIamlx bnpusaFecWJucWleul5yfu4mRmC0bjv2c/MOxnmvPuodYmTiYDzEKMHBrCTC68YskSLEm5JY WZValB9fVJqTWnyI0RTo7InMUqLJ+cB0kVcSb2hmYGpoYmZpYGppZqwkzutZ0JEoJJCeWJKa nZpakFoE08fEwSnVwKQYde9M9jO1DWsZWzs/Ws3uWfpi1/0DW0LWaG5ruswxtWSi3GTXw3lP jIwFmpd8Lm9Z3CSzf8Et5Yp3fpuWdsaUtL/g07z/fe/yMHnhWq2/4ofK1eu+bv6dwx9f3Xri s/zN5slG7ZeW3/vOyqPzoudbS4LrZY9efb4Yt8i/64ykZ/p32EXJd5c+tfl/Y8oB/y6ulqWn n9fnWUZ+Krios3bDxW8lVUvdHWr3ns6+GBf9ufaA7cMZZRrWW+b+qGV8/me+5S6lb2J9xhqR f46Eny0488F+ZuP6ILmyzHnrdKwKrc3drCPW8yzp2ZAuobnfTvKxa1rOY68zFsvWvF+1kuvv on8f5+98uGRvs6bYZ1YlluKMREMt5qLiRAAQHpt+XwMAAA== X-CMS-MailID: 20230322135016eucas1p2ee1b64175f621ee425f7f48cb908dc20 X-Msg-Generator: CA X-RootMTR: 20230322135016eucas1p2ee1b64175f621ee425f7f48cb908dc20 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230322135016eucas1p2ee1b64175f621ee425f7f48cb908dc20 References: <20230322135013.197076-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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. 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 Wed Mar 22 13:50:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13184084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB53BC6FD1C for ; Wed, 22 Mar 2023 13:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbjCVNvV (ORCPT ); Wed, 22 Mar 2023 09:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbjCVNvB (ORCPT ); Wed, 22 Mar 2023 09:51:01 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607D25A6E9 for ; Wed, 22 Mar 2023 06:50:46 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230322135019euoutp0122644ae7ee5a931d794043ff66746b0a~OwgDO1aah2152621526euoutp01L for ; Wed, 22 Mar 2023 13:50:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230322135019euoutp0122644ae7ee5a931d794043ff66746b0a~OwgDO1aah2152621526euoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1679493019; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NsCW33O+y//g7yZSiWUmZFyW1iX5GhKRBk/wos093lNoKU7oN+ONmCmnW6Yfy3C2X w4SFKZ0FUJuYgM2ehVYaW1z8F/NEdAnEOIalrhVrkD8U6hCCLUL7Fayj14BIqgLNZv rHkzlVEMDZRKXe5G0KSZmc0i7oBQOasfkP8+SNDA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230322135017eucas1p2629dcfb1875f78654e25001786cb234f~OwgBPtNpR2731127311eucas1p2j; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 91.38.10014.9970B146; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230322135017eucas1p1350c6e130fa367263432fa35894bdf1e~OwgAwlFQT1542115421eucas1p1C; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230322135017eusmtrp271a5c4fe6e5c76bbc457c0ee9d299624~OwgAvzLhg0726007260eusmtrp2I; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) X-AuditID: cbfec7f5-ba1ff7000000271e-14-641b079936f1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9B.6E.09583.9970B146; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230322135016eusmtip2064511fdb3f41a6d5ea559782138fbae~OwgAjsse92536025360eusmtip2u; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) From: Pankaj Raghav To: senozhatsky@chromium.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, willy@infradead.org, brauner@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, hubcap@omnibond.com, martin@omnibond.com Cc: mcgrof@kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav , Christoph Hellwig Subject: [RFC v2 3/5] mpage: split bi_end_io callback for reads and writes Date: Wed, 22 Mar 2023 14:50:11 +0100 Message-Id: <20230322135013.197076-4-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322135013.197076-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGKsWRmVeSWpSXmKPExsWy7djPc7oz2aVTDBquKFrMWb+GzWL13X42 i9eHPzFa7N88hcni5oGdTBYrVx9lsmi/28dksfeWtsWevSdZLC7vmsNmcW/Nf1aLk+v/M1vc mPCU0WLZ1/fsFp+XtrBb7N64iM3i/N/jrBa/f8xhcxDymN1wkcVj8wotj8tnSz02repk89j0 aRK7x4kZv1k8GqbeYvPYfbOBzePX7TusHn1bVjF6fN4k57HpyVumAJ4oLpuU1JzMstQifbsE roxVG/wL/vFU/F3n28B4jKuLkZNDQsBE4uqnRrYuRi4OIYEVjBJPXj9jgXC+MEp8OPuFHcL5 zCixrPEVG0zL6z2ToVqWM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5iDkMbvhIovH5hVaHpfPlnpsWtXJ5rHp 0yR2jxMzfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRejZF+aUlqQoZ+cUl tkrRhhZGeoaWFnpGJpZ6hsbmsVZGpkr6djYpqTmZZalF+nYJehmrNvgX/OOp+LvOt4HxGFcX IyeHhICJxOs9k9m6GLk4hASWMkp09B1mhkhISNxe2MQIYQtL/LnWBVX0nFFiy6lf7F2MHBxs AloSjZ3sIDUiAjcYJdpX6YHUMAt0Mkmc+DITLCEs4CWxbPoHJhCbRUBV4ujjnWALeAWsJI48 nAi1TF5i/8GzYDangLXEo0XT2EBsIaCay/snsULUC0qcnPmEBcRmBqpv3jqbeQKjwCwkqVlI UgsYmVYxiqSWFuem5xYb6RUn5haX5qXrJefnbmIExu+2Yz+37GBc+eqj3iFGJg7GQ4wSHMxK IrxuzBIpQrwpiZVVqUX58UWlOanFhxhNge6eyCwlmpwPTCB5JfGGZgamhiZmlgamlmbGSuK8 ngUdiUIC6YklqdmpqQWpRTB9TBycUg1M7Yfd/v7W55q/vP501as9vL2nzL9smMe87eXj/TlH E092Ppn8mDPq3cIlj61CVaun8R0yENb9Unfmvv7ve8G8PGUSh4XOu9pELJA+63j3Zp9K3I1e R7vS+06njteVdj4I5zrz+8sHH++r8659C57/RbKsoax2q/QP7SfGL5aevZbAvY/v7PGj/y0X lVtW9rFmc+zx8p3W//jy/G8REn5r1YPu/t2nJWzod0Er5lNmxfT7LN5XpmUExq99sWpBaP+m bSePShycV7y+/vqvTXbX9s/S+Rf78/vjlydOmbC5swWbTJ1rOOuV1o1L6hWvvJfe1ZRofDz5 HPts6fjy//6se7W6788NeFTz2rimMt0nvlGJpTgj0VCLuag4EQD9lYbvaAMAAA== X-CMS-MailID: 20230322135017eucas1p1350c6e130fa367263432fa35894bdf1e X-Msg-Generator: CA X-RootMTR: 20230322135017eucas1p1350c6e130fa367263432fa35894bdf1e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230322135017eucas1p1350c6e130fa367263432fa35894bdf1e References: <20230322135013.197076-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Split the bi_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 | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 22b9de5ddd68..3a545bf0f184 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -43,14 +43,28 @@ * 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), + page_endio(page, REQ_OP_READ, + blk_status_to_errno(bio->bi_status)); + } + + bio_put(bio); +} + +static void mpage_write_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, REQ_OP_WRITE, blk_status_to_errno(bio->bi_status)); } @@ -59,7 +73,11 @@ static void mpage_end_io(struct bio *bio) static struct bio *mpage_bio_submit(struct bio *bio) { - bio->bi_end_io = mpage_end_io; + if (op_is_write(bio_op(bio))) + bio->bi_end_io = mpage_write_end_io; + else + bio->bi_end_io = mpage_read_end_io; + guard_bio_eod(bio); submit_bio(bio); return NULL; From patchwork Wed Mar 22 13:50:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13184085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D526BC761AF for ; Wed, 22 Mar 2023 13:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231230AbjCVNvZ (ORCPT ); Wed, 22 Mar 2023 09:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231164AbjCVNvC (ORCPT ); Wed, 22 Mar 2023 09:51:02 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C28B45AB52 for ; Wed, 22 Mar 2023 06:50:46 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230322135019euoutp01c9f94ee2733d9658b5d0aecbb0efe860~OwgDWdJsM1888918889euoutp01K for ; Wed, 22 Mar 2023 13:50:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230322135019euoutp01c9f94ee2733d9658b5d0aecbb0efe860~OwgDWdJsM1888918889euoutp01K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1679493019; bh=bEycODUs3a19v9Q2MRV2ibzIXf/1C8rKj/6UCd36MJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OE3TuYV5eG6ueLT9Sql/pOs/SAiAfvuG9xGrrLCYnBTCQN1Jetoz8yGgrvjYrBXx2 rIOzqRA7jVp/mT/D6jN4n61A1V2fCkQ6ezxS41zL3/s8KjHZacM9S9muGz0fZyaEke 4+J7lecYRdBLfp6Nwl6izQyYpgRHc8PJUy8MH08M= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230322135018eucas1p12b4ac5ea50ea365ccac025b8b1a287ac~OwgBtgsgg3054630546eucas1p1f; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id C2.38.10014.A970B146; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230322135017eucas1p2d29ffaf8dbbd79761ba56e8198d9c933~OwgBSi9ph0617106171eucas1p26; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230322135017eusmtrp2fde4c0580c077ed043cd9b7695a7b4e2~OwgBR1bDu0670606706eusmtrp2b; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) X-AuditID: cbfec7f5-ba1ff7000000271e-16-641b079a66c5 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 0D.6E.09583.9970B146; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230322135017eusmtip28d89f9c0a2f04dd9e9c07a1b728a61a7~OwgBFYop52536025360eusmtip2v; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) From: Pankaj Raghav To: senozhatsky@chromium.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, willy@infradead.org, brauner@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, hubcap@omnibond.com, martin@omnibond.com Cc: mcgrof@kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav Subject: [RFC v2 4/5] mpage: use folios in bio end_io handler Date: Wed, 22 Mar 2023 14:50:12 +0100 Message-Id: <20230322135013.197076-5-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322135013.197076-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDKsWRmVeSWpSXmKPExsWy7djPc7qz2KVTDK48YbWYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSza7/YxWey9pW2xZ+9JFovLu+awWdxb85/V4uT6/8wWNyY8ZbRY 9vU9u8XnpS3sFrs3LmKzOP/3OKvF7x9z2BwEPWY3XGTx2LxCy+Py2VKPTas62Tw2fZrE7nFi xm8Wj4apt9g8ft2+w+rRt2UVo8fnTXIem568ZQrgjuKySUnNySxLLdK3S+DK+Pn0NHtBC1/F pcaTjA2M67i7GDk4JARMJG78Tu1i5OIQEljBKHFq10dWCOcLo0TntmlQzmdGiTltW1m6GDnB Olq39LBDJJYzSkz+uJcJwnnJKLH20ScmkLlsAloSjZ1gRSICZxglpjTNYATpZha4zyhxei/Y JGEBW4mFF3cygtSzCKhKrLyWDhLmFbCSmDxhMSPEMnmJ/QfPMoPYnALWEo8WTWODqBGUODnz CQvESHmJ5q2zmUF2SQis5pTY3XufDaLZRWIGMDYgbGGJV8e3sEPYMhL/d85ngrCrJZ7e+A3V 3MIo0b9zPRskYKwl+s7kgJjMApoS63fpQ5Q7Shx5sgGqgk/ixltBiBP4JCZtm84MEeaV6GgT gqhWktj58wnUUgmJy01zoEHoIXFk8RT2CYyKs5A8MwvJM7MQ9i5gZF7FKJ5aWpybnlpsnJda rlecmFtcmpeul5yfu4kRmABP/zv+dQfjilcf9Q4xMnEwHmKU4GBWEuF1Y5ZIEeJNSaysSi3K jy8qzUktPsQozcGiJM6rbXsyWUggPbEkNTs1tSC1CCbLxMEp1cBUOmvnyuO/+XtP28QvuPbg /D0dMQ3f7qzXS+8YOIh07ZzFxGb40Kt69223OfPUVi23ZtlkEJOzS/zkn/MzY6P21r3inb9X 8bnXyvrGKW575C4tjVMIMBb8fr46yulxYOLPLakZw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W++69hu8Q2dJdNPLPCYtFj3v4pixLbJL9OenVzLe+ai5L+O4+dd z/tMbv5owLgs3V5I2y2h/nvWrrOiSWYFHV+/X5Y+8saWd2WSZbH9TAtX66d8ai8D54R9vr43 59z+sv1rl3uWX3MPO//Ha+viY0veJd4y3queKvJnzcanLI+WSb5N/eWrWjZLomDDJL6LStxM lj6vWH989PeI+pPjcFtMr/pYxfYPT6e+aD64W25HyoHfU74c6VZXFPqcGrjDcP2S6S8TXWea i4dt93rYulo13EBq2RolluKMREMt5qLiRADBlbKOXwMAAA== X-CMS-MailID: 20230322135017eucas1p2d29ffaf8dbbd79761ba56e8198d9c933 X-Msg-Generator: CA X-RootMTR: 20230322135017eucas1p2d29ffaf8dbbd79761ba56e8198d9c933 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230322135017eucas1p2d29ffaf8dbbd79761ba56e8198d9c933 References: <20230322135013.197076-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 --- fs/mpage.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 3a545bf0f184..103505551896 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -45,13 +45,15 @@ */ 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) { - struct page *page = bv->bv_page; - page_endio(page, REQ_OP_READ, - blk_status_to_errno(bio->bi_status)); + bio_for_each_folio_all(fi, bio) { + struct folio *folio = fi.folio; + + if (!err) + folio_mark_uptodate(folio); + folio_unlock(folio); } bio_put(bio); @@ -59,13 +61,21 @@ static void mpage_read_end_io(struct bio *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) { - struct page *page = bv->bv_page; - page_endio(page, REQ_OP_WRITE, - blk_status_to_errno(bio->bi_status)); + bio_for_each_folio_all(fi, bio) { + struct folio *folio = fi.folio; + + if (err) { + struct address_space *mapping; + + folio_set_error(folio); + mapping = folio_mapping(folio); + if (mapping) + mapping_set_error(mapping, err); + } + folio_end_writeback(folio); } bio_put(bio); From patchwork Wed Mar 22 13:50:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13184086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8155EC6FD1C for ; Wed, 22 Mar 2023 13:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbjCVNvY (ORCPT ); Wed, 22 Mar 2023 09:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbjCVNvC (ORCPT ); Wed, 22 Mar 2023 09:51:02 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C56925CEE7 for ; Wed, 22 Mar 2023 06:50:46 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230322135020euoutp01a24c4154f1d76f5c063f98737bc3a612~OwgEG_EBR2152821528euoutp01N for ; Wed, 22 Mar 2023 13:50:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230322135020euoutp01a24c4154f1d76f5c063f98737bc3a612~OwgEG_EBR2152821528euoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1679493020; bh=Qd/EHq/hNi9U0eDQzSkYHva3vzVuhQ3/uVr2IhrtsQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJmJT4/TDHDQkIqtbVSMoahNTDwVKD1u4vrCHnRXcUm63vWUcZ+RGNJzDFvbLlc0V 6z5abCG9rWAFXS9+BMc1UvhiwMd1V3GY5dCE99DNVCd2MHxpcFaDDuC/Y+xsZsdjBC LOTBVHFCv32cWVZ6WYvSmWiesLszDxGcA9ywsTbI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230322135018eucas1p25c3a3715ad75a1e888ca3a12b22cd7e0~OwgCe8JE70616106161eucas1p2d; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 51.94.09503.A970B146; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230322135018eucas1p2dd82762cf7d2c0c5b5482a1d150ba369~OwgCAskCN0614706147eucas1p21; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230322135018eusmtrp258a3a526308b718ec79346250679f051~OwgB--C8t0726007260eusmtrp2M; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) X-AuditID: cbfec7f2-ea5ff7000000251f-e7-641b079ac88c Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5E.6E.09583.A970B146; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230322135018eusmtip2b06034e3955f717af8c7e270000bacfb~OwgBwcMLu2805428054eusmtip2B; Wed, 22 Mar 2023 13:50:18 +0000 (GMT) From: Pankaj Raghav To: senozhatsky@chromium.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, willy@infradead.org, brauner@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, hubcap@omnibond.com, martin@omnibond.com Cc: mcgrof@kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav Subject: [RFC v2 5/5] filemap: remove page_endio() Date: Wed, 22 Mar 2023 14:50:13 +0100 Message-Id: <20230322135013.197076-6-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322135013.197076-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHKsWRmVeSWpSXmKPExsWy7djPc7qz2KVTDL6/NbeYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSza7/YxWey9pW2xZ+9JFovLu+awWdxb85/V4uT6/8wWNyY8ZbRY 9vU9u8XnpS3sFrs3LmKzOP/3OKvF7x9z2BwEPWY3XGTx2LxCy+Py2VKPTas62Tw2fZrE7nFi xm8Wj4apt9g8ft2+w+rRt2UVo8fnTXIem568ZQrgjuKySUnNySxLLdK3S+DKeNs9i7VgHl/F +vsfGBsYz3J3MXJySAiYSMy/fZW5i5GLQ0hgBaPEnb0TWCGcL4wSfYeuMEI4nxkl9s57xATT smjxH6iq5YwSN+cfYYFwXjJKHD+8mr2LkYODTUBLorGTHSQuInCGUWJK0wxGkG5mgfuMEqf3 soDYwgJGEl0LVoDZLAKqEu+WPGcHsXkFrCSmbwK5A2SbvMT+g2eZQWxOAWuJR4um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2exVowj69i/f0PjA2MZ7m7GDk5JARMJBYt /sPaxcjFISSwlFFi5bvfTBAJCYnbC5sYIWxhiT/XuthAbCGB54wS6/r9uxg5ONgEtCQaO9lB wiICNxgl2lfpgcxhBim5/HQ2M0hCWMBIomvBChYQm0VAVeLdkudgDbwCVhLTN01ghZgvL7H/ 4Fmwek4Ba4lHi6ZB7bKSuLx/EitEvaDEyZlPwOYwA9U3b53NPIFRYBaS1CwkqQWMTKsYRVJL i3PTc4uN9IoTc4tL89L1kvNzNzECo3XbsZ9bdjCufPVR7xAjEwfjIUYJDmYlEV43ZokUId6U xMqq1KL8+KLSnNTiQ4ymQHdPZJYSTc4Hpou8knhDMwNTQxMzSwNTSzNjJXFez4KORCGB9MSS 1OzU1ILUIpg+Jg5OqQamqAs7O4KSZc9I+En2a19JXN/2+fsCjTPheYaHv2xWUWgSVvnxM475 e/Up5SRhl6arN3Mq9k6//Vh1355v6jNV/X6fqC49d2vWhNjVZhXrfnAWvvNMX3WDzfj8FJmU 2+WJi9/0s99eX1ontXpC/5Sv5/afvKp45snlrrgnt+7MS1ukVxNnsvZbjO7OPr6uT56L46bp Wc6UCtrKnBXne/zZjwdu8ZWM4rU65s/m3NVlvv2m8qSVTjb/0otFflXvH9hZ1YRGH9sYe613 yVmHW3OmvLF93rND7clW+/rl5yVjPq/bfdYk7wDP0kIx8xn9YlnelwojX+9LsghMaJZo+G51 u6KUzfdsfiaH2EErXptyJZbijERDLeai4kQAusTwxl8DAAA= X-CMS-MailID: 20230322135018eucas1p2dd82762cf7d2c0c5b5482a1d150ba369 X-Msg-Generator: CA X-RootMTR: 20230322135018eucas1p2dd82762cf7d2c0c5b5482a1d150ba369 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230322135018eucas1p2dd82762cf7d2c0c5b5482a1d150ba369 References: <20230322135013.197076-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org page_endio() is not used anymore. Remove it. Signed-off-by: Pankaj Raghav --- include/linux/pagemap.h | 2 -- mm/filemap.c | 30 ------------------------------ 2 files changed, 32 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index fdcd595d2294..73ee6ead90dd 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1076,8 +1076,6 @@ int filemap_migrate_folio(struct address_space *mapping, struct folio *dst, #else #define filemap_migrate_folio NULL #endif -void page_endio(struct page *page, bool is_write, int err); - void folio_end_private_2(struct folio *folio); void folio_wait_private_2(struct folio *folio); int folio_wait_private_2_killable(struct folio *folio); diff --git a/mm/filemap.c b/mm/filemap.c index 6f3a7e53fccf..a770a207825d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1625,36 +1625,6 @@ void folio_end_writeback(struct folio *folio) } EXPORT_SYMBOL(folio_end_writeback); -/* - * After completing I/O on a page, call this routine to update the page - * flags appropriately - */ -void page_endio(struct page *page, bool is_write, int err) -{ - struct folio *folio = page_folio(page); - - if (!is_write) { - if (!err) { - folio_mark_uptodate(folio); - } else { - folio_clear_uptodate(folio); - folio_set_error(folio); - } - folio_unlock(folio); - } else { - if (err) { - struct address_space *mapping; - - folio_set_error(folio); - mapping = folio_mapping(folio); - if (mapping) - mapping_set_error(mapping, err); - } - folio_end_writeback(folio); - } -} -EXPORT_SYMBOL_GPL(page_endio); - /** * __folio_lock - Get a lock on the folio, assuming we need to sleep to get it. * @folio: The folio to lock