From patchwork Mon Apr 3 13:22:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13198159 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 0C5DEC77B60 for ; Mon, 3 Apr 2023 13:22:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232460AbjDCNWb (ORCPT ); Mon, 3 Apr 2023 09:22:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231245AbjDCNWa (ORCPT ); Mon, 3 Apr 2023 09:22:30 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 225C455BC for ; Mon, 3 Apr 2023 06:22:27 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132225euoutp02cc4b61be594d53f234d8027e9e78743d~Sb3HpNHWk1374213742euoutp02l for ; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230403132225euoutp02cc4b61be594d53f234d8027e9e78743d~Sb3HpNHWk1374213742euoutp02l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528146; bh=r3yJCwvgy++or0tEjkGksO6JgkEF47Bw1cuUMKfgKoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWltD6KkZIQiLs6rw7FKqP0kHRAAW0lYwBmUNzefo4Vc5oXK4N7RNkDQibfTOfl7Z I/0o0jF3ciGeBau/sXEVvO9q6x1elNyuG0Iaer1trBR7e4ZITxAThf1z4eDtnOkLRn 8miNtIU3MXpzqC/SC9TgDLLQvc94kF8B/bkHURvA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230403132224eucas1p27eef4cb0f80d1f84327e722cb3e4bc85~Sb3GIBA7H2688526885eucas1p2U; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id CA.F2.09966.013DA246; Mon, 3 Apr 2023 14:22:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230403132223eucas1p2a27e8239b8bda4fc16b675a9473fd61f~Sb3FmBsJj2689126891eucas1p2k; Mon, 3 Apr 2023 13:22:23 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230403132223eusmtrp210c81c0bd1e7b9dfa5cc043be99aaf05~Sb3FlI5ir0199801998eusmtrp2f; Mon, 3 Apr 2023 13:22:23 +0000 (GMT) X-AuditID: cbfec7f4-d4fff700000026ee-44-642ad3104b1c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AC.16.08862.F03DA246; Mon, 3 Apr 2023 14:22:23 +0100 (BST) Received: from localhost (unknown [106.210.248.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230403132223eusmtip1f594e7a855855fa3ec15e1be498a2f26~Sb3FXqusJ2519425194eusmtip1C; Mon, 3 Apr 2023 13:22:23 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, minchan@kernel.org, martin@omnibond.com, hubcap@omnibond.com, brauner@kernel.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, akpm@linux-foundation.org, willy@infradead.org, hch@lst.de Cc: devel@lists.orangefs.org, mcgrof@kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-fsdevel@vger.kernel.org, Pankaj Raghav Subject: [PATCH v2 1/5] zram: always chain bio to the parent in read_from_bdev_async Date: Mon, 3 Apr 2023 15:22:17 +0200 Message-Id: <20230403132221.94921-2-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403132221.94921-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGKsWRmVeSWpSXmKPExsWy7djP87oCl7VSDJa8FrKYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8Wyr+/ZLT4vbWG32L1xEZvF+b/HWS1+/5jD5iDkMbvhIovH5hVaHpfPlnpsWtXJ5rHp 0yR2jxMzfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRXDYpqTmZZalF+nYJ XBmTXn5kKdjNWzGzZQtrA+Mk7i5GTg4JAROJ3guTGEFsIYEVjBJff9d2MXIB2V8YJc7N+MwI 4XxmlJj9YzMrTMfXKUuYIRLLGSVeHf7OBuG8YJTYtekTkMPBwSagJdHYyQ4SFxG4xSjxpmc2 E4jDLHCfUWLe7r1MIKOEBcIk9hzdzgJiswioSqzcc5AZpJlXwFLi7Q1TiG3yEvsPnmUGsTkF rCQap88Fu5VXQFDi5MwnYK3MQDXNW2eDXSQhsJ9TovncZWaIZheJ7+fWMkHYwhKvjm9hh7Bl JP7vnA8Vr5Z4euM3VHMLo0T/zvVgH0gIWEv0nckBMZkFNCXW79KHiDpKrNxuAWHySdx4Kwhx AZ/EpG3TmSHCvBIdbUIQs5Ukdv58ArVTQuJy0xwWCNtDYueqHuYJjIqzkPwyC8kvsxDWLmBk XsUonlpanJueWmyUl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GVfL14ixXE5hUQlDg58wkLiM0MVN+8dTbzBEaB WUhSs5CkFjAyrWIUSS0tzk3PLTbUK07MLS7NS9dLzs/dxAiM4W3Hfm7ewTjv1Ue9Q4xMHIyH GCU4mJVEeFW7tFKEeFMSK6tSi/Lji0pzUosPMZoCnT2RWUo0OR+YRPJK4g3NDEwNTcwsDUwt zYyVxHk9CzoShQTSE0tSs1NTC1KLYPqYODilGpj6bNMVbC+WRxj7Lbgs83CpTrNKVGXel5uu m59kHZrMHs71ecXPc+GXpe83vX7z/Y2a9WTu9Qbb+rcx7nM7K/3H5FlOz5E11yelSnw3War1 57KmHPPBJ8ozez9tePon5KPl4tUSN2pKNfM7f367kdMcMXGflfCCndtzVF/EaUlY3963IWdr Ne+TP4LeYrt/8qlcFOWa1s6bvTXqeo5wvdSjTU86tfYI7q7qV53NeDmE58B+MdspfD6Jt2ds fPopP2/5+SW3p3CIWzyRvvpE/NnV2Mb7l6KOb2pbc5DD1GeJ38qXb4280hesCtvzKtNPm+ma mFZJs0pm4d39L3dXz363NH3/4R0ywe7ZPHoPfTl+KrEUZyQaajEXFScCAJm7B9lqAwAA X-CMS-MailID: 20230403132223eucas1p2a27e8239b8bda4fc16b675a9473fd61f X-Msg-Generator: CA X-RootMTR: 20230403132223eucas1p2a27e8239b8bda4fc16b675a9473fd61f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230403132223eucas1p2a27e8239b8bda4fc16b675a9473fd61f References: <20230403132221.94921-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org zram_bvec_read() is called with the bio set to NULL only in writeback_store() function. When a writeback is triggered, zram_bvec_read() is called only if ZRAM_WB flag is not set. That will result only calling zram_read_from_zspool() in __zram_bvec_read(). rw_page callback used to call read_from_bdev_async with a NULL parent bio but that has been removed since commit 3222d8c2a7f8 ("block: remove ->rw_page"). We can now safely always call bio_chain() as read_from_bdev_async() will be called with a parent bio set. A WARN_ON_ONCE is added if this function is called with parent set to NULL. Signed-off-by: Pankaj Raghav Acked-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 3feadfb96114..d16d0630b178 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,11 +625,10 @@ 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 - bio_chain(bio, parent); + if (WARN_ON_ONCE(!parent)) + return -EINVAL; + bio_chain(bio, parent); submit_bio(bio); return 1; } From patchwork Mon Apr 3 13:22: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: 13198160 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 32AE1C77B6F for ; Mon, 3 Apr 2023 13:22:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232493AbjDCNWd (ORCPT ); Mon, 3 Apr 2023 09:22:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232386AbjDCNWb (ORCPT ); Mon, 3 Apr 2023 09:22:31 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6F8911646 for ; Mon, 3 Apr 2023 06:22:28 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132226euoutp0152f31b2ebbaaef44516decbe4f0d0252~Sb3IHoZmj1624316243euoutp011 for ; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230403132226euoutp0152f31b2ebbaaef44516decbe4f0d0252~Sb3IHoZmj1624316243euoutp011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528146; bh=cv+Hj0FwPtC3HT2R3DDLLPaYMWixtk1Tvm8cFC27+6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B39O5prHjZY0V7xuyRpKWUkJhlL0o/dYBrAbqOAY8Wj+XGSawtVbwCkB8ZooCJsVK sjQbZYJgRELCcwxoaywLcVa6kbH5RSuTWfojHZ9KvOLyiRXK0u/fhvXXZLIa8Ws2iB R4O4ttoX5iWGfhcl5DnEgDqA/34PsVWAMkCn8fLw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230403132224eucas1p1dd063339ab3dd7e50f716c30dfa6c3d7~Sb3Gm84Sm0205602056eucas1p1F; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F9.F9.10014.013DA246; Mon, 3 Apr 2023 14:22:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230403132224eucas1p28f82802bc40d4feb5a30bb59c6536ab3~Sb3GIDjiU1827918279eucas1p2r; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230403132224eusmtrp2743cb3eb410ee96b9ce1aef1859b792d~Sb3GHEWDm0200802008eusmtrp2K; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) X-AuditID: cbfec7f5-b8bff7000000271e-c8-642ad310e985 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 35.ED.09583.013DA246; Mon, 3 Apr 2023 14:22:24 +0100 (BST) Received: from localhost (unknown [106.210.248.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230403132224eusmtip1acb8b48c14dc2c7e83cb18c349594e39~Sb3F5SUdL2319123191eusmtip1F; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, minchan@kernel.org, martin@omnibond.com, hubcap@omnibond.com, brauner@kernel.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, akpm@linux-foundation.org, willy@infradead.org, hch@lst.de Cc: devel@lists.orangefs.org, mcgrof@kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-fsdevel@vger.kernel.org, Pankaj Raghav Subject: [PATCH v2 2/5] orangefs: use folios in orangefs_readahead Date: Mon, 3 Apr 2023 15:22:18 +0200 Message-Id: <20230403132221.94921-3-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403132221.94921-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUxbVRjGc+5tb28LbS6FjBdsmHQhxo5P0eSg6EBJvENJ/GPLUGegGTes o+WjBb+2aJFFXJ2MTCcTqizMCYNqpYyNFnATNhHHx7Y6B0yYwWImH+2EEgsE6srt4v77vec8 z/ucJzk0Kf9bGE1riss5fbFaq6QkgvM/rYwmME5VQXKLNxmbrRYKt00eo/B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R1cab/4OdnRZ MuWqGFOz2CzjeynHKpymrpu4b8m61GAlluKMREMt5qLiRADatwx8awMAAA== X-CMS-MailID: 20230403132224eucas1p28f82802bc40d4feb5a30bb59c6536ab3 X-Msg-Generator: CA X-RootMTR: 20230403132224eucas1p28f82802bc40d4feb5a30bb59c6536ab3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230403132224eucas1p28f82802bc40d4feb5a30bb59c6536ab3 References: <20230403132221.94921-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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. 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) Tested-by: Mike Marshall Signed-off-by: Pankaj Raghav Reviewed-by: Christoph Hellwig --- 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 Mon Apr 3 13:22: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: 13198163 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 41FE5C77B6F for ; Mon, 3 Apr 2023 13:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232459AbjDCNWi (ORCPT ); Mon, 3 Apr 2023 09:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbjDCNWc (ORCPT ); Mon, 3 Apr 2023 09:22:32 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87D7B11664 for ; Mon, 3 Apr 2023 06:22:30 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132226euoutp028884535c7c43ccfdf90369c071189911~Sb3Id4z9O1375413754euoutp02l for ; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230403132226euoutp028884535c7c43ccfdf90369c071189911~Sb3Id4z9O1375413754euoutp02l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528146; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r++2oaFN0N0+G2S72qO8e7Cw6GtX3TD1d5DuTTMDG1WzMvdZZCbjPPf5CdK/g82XQ 0i0Ws6YK2Ki8ER/EpnURSfsgnkLG91B92CBR6PYPIK182Btxcn7MN6l0oov3BfAmk7 IcYiJhbCpv60tSR/+MHwNvetQdvPDop0fg+0ibg4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230403132225eucas1p2eeb69651b019e4e779166e8b360a7342~Sb3HE0Gyc2688526885eucas1p2X; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2B.F4.09503.113DA246; Mon, 3 Apr 2023 14:22:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169~Sb3Gsa2HH2688526885eucas1p2W; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230403132224eusmtrp2025b29c3cb119969b17b4113d6677db0~Sb3GrwLJb0200802008eusmtrp2L; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-b4-642ad311da86 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7E.16.08862.013DA246; Mon, 3 Apr 2023 14:22:24 +0100 (BST) Received: from localhost (unknown [106.210.248.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230403132224eusmtip14497bed1922f57dfc44ffe4d39a2dff3~Sb3Ge5UWK2612826128eusmtip1B; Mon, 3 Apr 2023 13:22:24 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, minchan@kernel.org, martin@omnibond.com, hubcap@omnibond.com, brauner@kernel.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, akpm@linux-foundation.org, willy@infradead.org, hch@lst.de Cc: devel@lists.orangefs.org, mcgrof@kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-fsdevel@vger.kernel.org, Pankaj Raghav Subject: [PATCH v2 3/5] mpage: split bi_end_io callback for reads and writes Date: Mon, 3 Apr 2023 15:22:19 +0200 Message-Id: <20230403132221.94921-4-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403132221.94921-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7djP87qCl7VSDDY8F7aYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8Wyr+/ZLT4vbWG32L1xEZvF+b/HWS1+/5jD5iDkMbvhIovH5hVaHpfPlnpsWtXJ5rHp 0yR2jxMzfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRXDYpqTmZZalF+nYJ XBmrNvgX/OOp+LvOt4HxGFcXIyeHhICJxPobP9i7GLk4hARWMEo8vvKeCcL5wijx7MoDNgjn M6PE1Ksb2GFaph04AZVYzijRv+kJC4TzglHi36W1QP0cHGwCWhKNnWBzRQRuMUq86ZkNNpdZ 4D6jxLzde8GKhAV8JP5szQKZyiKgKtHd+RhsA6+ApcTDh0+htslL7D94lhnE5hSwkmicPpcR okZQ4uRMkMWcQDPlJZq3zmaGqN/OKXHnkTuE7SLxbNNsqDnCEq+Ob4GyZST+75zPBGFXSzy9 8ZsZ5DYJgRagb3auZwO5TULAWqLvTA6IySygKbF+lz5EuaPEk/cgI0Eq+CRuvBWEuIBPYtK2 6cwQYV6JjjYhiGoliZ0/n0AtlZC43DSHBcL2kPgyeSbzBEbFWUh+mYXkl1kIexcwMq9iFE8t Lc5NTy02zEst1ytOzC0uzUvXS87P3cQITImn/x3/tINx7quPeocYmTgYDzFKcDArifCqdmml CPGmJFZWpRblxxeV5qQWH2KU5mBREufVtj2ZLCSQnliSmp2aWpBaBJNl4uCUamAqttqR/yBv ydQfFxWDgvY2Ho27WX4+RfTF4kd2Hus3ZDlMaVBc0Op+j9P5Vsqki/kNBielS/ustp6VODZb 6cdH5d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MXaHtvQfubwJRHfVZ8PmmZeWqcb5Hzo kVoxo6WU6ok0qQXrNh8yXqyT473U8YHE8urqKwX/8qvDTxzqWOdfp56zYetPkcOaxZvjLC5a HbVeobM3/z+DuJDIp6ZPquc2TprcqaF1d0byz92rDJIk754/y+hSW7eW7cK0uqDc5hNF78Pf Z01LvS33cPJWsfNJfjpRhpNWssgHvj5rd+fp2quKvnWbPgvE2y89tEav5cO3F46JS15avTyl 817+UuTLfx9eu+g99rWZt69M2bH/5Mt/zD1Hpl27dU8st6F2svtd29rER18jeKPUr7rHz4qI 7eo6u9DzoXNJY4nbHb8dp0+ufJif+Xx3rBJLcUaioRZzUXEiAM3/pTloAwAA X-CMS-MailID: 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169 X-Msg-Generator: CA X-RootMTR: 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230403132224eucas1p21fd296fbd4af70220331bb19023f4169 References: <20230403132221.94921-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 Mon Apr 3 13:22: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: 13198162 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 6E0ADC77B6E for ; Mon, 3 Apr 2023 13:22:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbjDCNWg (ORCPT ); Mon, 3 Apr 2023 09:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232297AbjDCNWc (ORCPT ); Mon, 3 Apr 2023 09:22:32 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E0E955BC for ; Mon, 3 Apr 2023 06:22:31 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132227euoutp025754d395ae13df8f14406d682b822425~Sb3JIP4Ow1375413754euoutp02m for ; Mon, 3 Apr 2023 13:22:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230403132227euoutp025754d395ae13df8f14406d682b822425~Sb3JIP4Ow1375413754euoutp02m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528147; bh=C4y5H34/b66lYzmCayiry+Dr/iI1gotrFjxRhbqI+PI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WXp2XaelSwCkYKfkU9KMaQBicOuPO5FCl6eazPBuaqDzxeI0oeAp8adbZL8WddZmx X7uAsdaOnFuuiLwMj/35Lgs8J5U4FynuBTYEt2GUI96Y7F7qp/ZfxHo532agr5ULM5 JawW7/UyfI363OcIirmZR3Qt5uDyxChn97iVJZfQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230403132226eucas1p27c60b550a84a0f9a8d83aeb35c2131a7~Sb3Hq6jkH1831918319eucas1p26; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9C.F4.09503.113DA246; Mon, 3 Apr 2023 14:22:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230403132225eucas1p15848db3c850e950b21b339d5861080e1~Sb3HLozNU1121911219eucas1p1e; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230403132225eusmtrp222d08e847a640f99b1692735673dfaa4~Sb3HK3YsO0200802008eusmtrp2N; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) X-AuditID: cbfec7f2-ea5ff7000000251f-b8-642ad3114817 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id EF.16.08862.113DA246; Mon, 3 Apr 2023 14:22:25 +0100 (BST) Received: from localhost (unknown [106.210.248.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230403132225eusmtip18dbb686db7c510460cd06cbef5485d8b~Sb3G_SMEG2613126131eusmtip1C; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, minchan@kernel.org, martin@omnibond.com, hubcap@omnibond.com, brauner@kernel.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, akpm@linux-foundation.org, willy@infradead.org, hch@lst.de Cc: devel@lists.orangefs.org, mcgrof@kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-fsdevel@vger.kernel.org, Pankaj Raghav Subject: [PATCH v2 4/5] mpage: use folios in bio end_io handler Date: Mon, 3 Apr 2023 15:22:20 +0200 Message-Id: <20230403132221.94921-5-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403132221.94921-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOKsWRmVeSWpSXmKPExsWy7djP87qCl7VSDPZftbKYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8Wyr+/ZLT4vbWG32L1xEZvF+b/HWS1+/5jD5iDkMbvhIovH5hVaHpfPlnpsWtXJ5rHp 0yR2jxMzfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRXDYpqTmZZalF+nYJ XBkLXl5iKZjAW/Hn0j62BsY7XF2MnBwSAiYS16etY+li5OIQEljBKDF50wF2COcLo0Tr6g9Q zmdGiRNrTrDCtBxa9IEJIrGcUWL7yV1sEM4LRolvsx4ADePgYBPQkmjsBOsWEbjFKPGmZzZY B7PAfUaJebv3MoGMEhawl9jZupYRxGYRUJV4daYDzOYVsJSYd/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JpZ6hsbmsVZGpkr6djYpqTmZZalF+nYJehkLXl5iKZjAW/Hn0j62BsY7 XF2MnBwSAiYShxZ9YOpi5OIQEljKKDG3aTcrREJC4vbCJkYIW1jiz7UuNhBbSOAZo8SZztgu Rg4ONgEticZOdpBeEZDwsgvHWUAcZoHnjBJrpvxmBmkQFrCX2Nm6FmwQi4CqxKszHWA2r4Cl xLyTn6AWyEvsP3gWrJ5TwEqicfpcRohllhJfL95ihagXlDg58wkLiM0MVN+8dTbzBEaBWUhS s5CkFjAyrWIUSS0tzk3PLTbUK07MLS7NS9dLzs/dxAiM4W3Hfm7ewTjv1Ue9Q4xMHIyHGCU4 mJVEeFW7tFKEeFMSK6tSi/Lji0pzUosPMZoC3T2RWUo0OR+YRPJK4g3NDEwNTcwsDUwtzYyV xHk9CzoShQTSE0tSs1NTC1KLYPqYODilGpiymk/w5G2oWj4r4iKrZdfjvPB16yJijvkc2Jnm WDdd5JXYulznR9H9u4Ry3H4J/3X/LFgXUO//L6H1ghvz+woPFR9nWeZnobVbo+w5T/voWmQd +iAo0H6I78Tq2Tu0pktYhS2N1J+7bkZuTmj9m0+t0nV7tp2wrO97Kv/xh+CNZadbah/8/757 OdPL7sYPC3a++6l9bLKr7irvLbtf3Z1SlS0Z9rrwk5mNvnva6/zmywuLVgZoHdoafePuIuuf 1yeznihwWjFRaElt+A+rm79DOXvurOLm9XO772+Q8+P0YunoHuEqjxUzvDj3zD45c+7aJYHp p4RjGD4HX/p/gM307p3dEnGeWyQSbRbufzJPiaU4I9FQi7moOBEAW9tMD2oDAAA= X-CMS-MailID: 20230403132225eucas1p15848db3c850e950b21b339d5861080e1 X-Msg-Generator: CA X-RootMTR: 20230403132225eucas1p15848db3c850e950b21b339d5861080e1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230403132225eucas1p15848db3c850e950b21b339d5861080e1 References: <20230403132221.94921-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 Reviewed-by: Christoph Hellwig --- fs/mpage.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 3a545bf0f184..6f43b7c9d4de 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) { + if (!err) + folio_mark_uptodate(fi.folio); + else + folio_set_error(fi.folio); + folio_unlock(fi.folio); } bio_put(bio); @@ -59,13 +61,15 @@ 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) { + if (err) { + folio_set_error(fi.folio); + mapping_set_error(fi.folio->mapping, err); + } + folio_end_writeback(fi.folio); } bio_put(bio); From patchwork Mon Apr 3 13:22:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13198161 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 8DABEC77B70 for ; Mon, 3 Apr 2023 13:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbjDCNWe (ORCPT ); Mon, 3 Apr 2023 09:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjDCNWc (ORCPT ); Mon, 3 Apr 2023 09:22:32 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DFF4D1 for ; Mon, 3 Apr 2023 06:22:31 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132227euoutp02aa305be746b2445e2a0ed661aec2826a~Sb3JgdzQ31374713747euoutp02w for ; Mon, 3 Apr 2023 13:22:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230403132227euoutp02aa305be746b2445e2a0ed661aec2826a~Sb3JgdzQ31374713747euoutp02w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528148; bh=Qd/EHq/hNi9U0eDQzSkYHva3vzVuhQ3/uVr2IhrtsQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGRaqrsHJe/tM105jDHB0ftOz4tp9ykwUxKohoKXQeZyo/fTZFWFs7pnTJgch+XaC wL30I+NBkQCi7jwOHC0BVgsqKS06FTu2EMa4YOhiV+gpeTOSStNq5avdwfH/LZxBth /X293VQRjzjIueCXtZeJnU/zJdCzUIg7CEnR4EaQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230403132226eucas1p225350ac5d8a5d0d5516b7d1cf8fb6e30~Sb3ILi-3G1849718497eucas1p2G; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 3D.F2.09966.213DA246; Mon, 3 Apr 2023 14:22:26 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230403132226eucas1p182e09f5da7bc0bd284d6a8494cd40903~Sb3HzyLKr0206102061eucas1p1D; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230403132226eusmtrp2a7dbad3b8c19268ae7c0dcce1a593f16~Sb3HyusYY0200802008eusmtrp2Q; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) X-AuditID: cbfec7f4-d39ff700000026ee-4b-642ad3126dbf Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 08.ED.09583.113DA246; Mon, 3 Apr 2023 14:22:26 +0100 (BST) Received: from localhost (unknown [106.210.248.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230403132225eusmtip27a6506bf3fe6270d1a4735114f57705d~Sb3HhyA592060320603eusmtip2R; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, minchan@kernel.org, martin@omnibond.com, hubcap@omnibond.com, brauner@kernel.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, akpm@linux-foundation.org, willy@infradead.org, hch@lst.de Cc: devel@lists.orangefs.org, mcgrof@kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-fsdevel@vger.kernel.org, Pankaj Raghav Subject: [PATCH v2 5/5] filemap: remove page_endio() Date: Mon, 3 Apr 2023 15:22:21 +0200 Message-Id: <20230403132221.94921-6-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403132221.94921-1-p.raghav@samsung.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ZLfayL w9j62y/PXdQ+mZmh6FOcgeDbk89FDtw9kLbQAJgO+2wiHBwOdKdck77HvXr3igD22NeSFqIT +3d3Oi1SXPJ+99V3p1ga+I3ktzTY1ii2GSvseHLk2se/JpcFbmnsktac03jnfvqVRU+t5/9e FTz9rOjiFXaLU0wbXs5rD5q0/oLxNstP87YZla85rvr7Hcd0kdOemx9Gq+xUu7/tt+otkU0Z 9eUGs+OipGXvmM5p2hE841RwQ8HlmCX79ZVYijMSDbWYi4oTAWqlwddqAwAA X-CMS-MailID: 20230403132226eucas1p182e09f5da7bc0bd284d6a8494cd40903 X-Msg-Generator: CA X-RootMTR: 20230403132226eucas1p182e09f5da7bc0bd284d6a8494cd40903 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230403132226eucas1p182e09f5da7bc0bd284d6a8494cd40903 References: <20230403132221.94921-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org page_endio() is not used anymore. Remove it. Signed-off-by: Pankaj Raghav Reviewed-by: Christoph Hellwig --- 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