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: 13198169 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE92AC77B62 for ; Mon, 3 Apr 2023 13:22:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15EB9900004; Mon, 3 Apr 2023 09:22:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C95906B0078; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8931E900002; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5FCDE900003 for ; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1F3E240B0B for ; Mon, 3 Apr 2023 13:22:32 +0000 (UTC) X-FDA: 80640144144.13.C5EFCD0 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf26.hostedemail.com (Postfix) with ESMTP id 2D61914001C for ; Mon, 3 Apr 2023 13:22:27 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=JhANKrSk; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf26.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680528148; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=r3yJCwvgy++or0tEjkGksO6JgkEF47Bw1cuUMKfgKoM=; b=8KN+Ro8Mr6x/oYm9kNHaUIEsFjj+9UJ81en49UoQAcodMb/ttwRrXerD+MWq5KZUnBi50K j8QmH4kPpn6182RVYMngg0+XPgjsCVdoy3G/dM7JJPAgp3vWjVtNnfVmgN25XNdGbZgFR2 +PoU7LdHq5D0gPbd+TGbA2Rf6qJNw5U= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=JhANKrSk; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf26.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680528148; a=rsa-sha256; cv=none; b=ah33UegYvcmtBmZisRzKfyWn/sJgDjFmvrzBSvc0m6lza8FFPL5uM743ev/2kLaQKlzQZo U/2VLzRb7o1e+PJbQQwhtRnCht/ta/gXNQDLE3kOtWhLk/iZNjduz5xFiCHjjj+SDMSkUr +C4KyHfKJ/ge2Bfft9t+kBrB6NrukuM= Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132225euoutp013d3088c14843bd4621716cb6f2d210dc~Sb3HmqSBu1624016240euoutp01D for ; Mon, 3 Apr 2023 13:22:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230403132225euoutp013d3088c14843bd4621716cb6f2d210dc~Sb3HmqSBu1624016240euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680528145; bh=r3yJCwvgy++or0tEjkGksO6JgkEF47Bw1cuUMKfgKoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JhANKrSkrLa1IQ1mQtDKoTkw/o7N5fvkDkWocOPgATDcH+7WkAcsiu6yJOIgxbAIS p73vKRyFFsGDV0PDEcVX0vhesyjo7qtm9QUSYgnk9jYzJAtZMDmtWgpRldg5/zZuA1 OR+6T4iSmzo6hv2qKxQcOJMjgl2FBwnBXRap5B0s= 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 JP7vnA8Vr5Z4euM3VHM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p8JIiEhcXthEyOELSzx51oXG0TRM0aJv+efsnYx cnCwCWhJNHayg8RFQOLLLhxnAXGYBZ4zSqyZ8psZpFtYIERi7eZDbCA2i4CqxMo9B5lBmnkF LCXe3jCFWCAvsf/gWbByTgEricbpc8EWCwGVfL14ixXE5hUQlDg58wkLiM0MVN+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> X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2D61914001C X-Stat-Signature: ksma6rdp15f9gkf9kz8osk4bnga17ajq X-HE-Tag: 1680528147-292277 X-HE-Meta: U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tFNAbONJTZsrLLo0fZFJoleXogzb4jsLjZZKX0bABO33iEKUhaT5VthKP2081yZKH0b5 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 13198167 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C364C76196 for ; Mon, 3 Apr 2023 13:22:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B87AF6B0074; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BB3D900005; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D41C900002; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 33BB96B0078 for ; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0264B120629 for ; Mon, 3 Apr 2023 13:22:32 +0000 (UTC) X-FDA: 80640144144.17.F368480 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf02.hostedemail.com (Postfix) with ESMTP id 85E458000C for ; Mon, 3 Apr 2023 13:22:28 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=B39O5prH; spf=pass (imf02.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680528148; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cv+Hj0FwPtC3HT2R3DDLLPaYMWixtk1Tvm8cFC27+6k=; b=YBfSiEDFnwHe3V5Joho9o4j3xu9GN7ywDpgj2MVHzLUudqg3ToJoY7WMNTAGZE06hTXl01 OVukuinyl5sUvNBQorGDMdly5S02h5RkKLsiQ41ctLjlDkqO0QeTAJ2SHUhI2djVHunUiW HPGQQA0cgUvno9e0sd6ox3D9swbqK/k= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=B39O5prH; spf=pass (imf02.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680528148; a=rsa-sha256; cv=none; b=MyCctCOVH+ZVCfuOR0k/MtnPHV1Rd+4YFHokFazsj61Xd6mHgq/zKk8Pcpl8wgOs4O2JtU H2e9FSA0QPIsYbYoHbHT/i7WsW4ppNP3+io0aIXnKrltPJwK2S+HtRvl40bP4BZ1FwNsHR K3HP+KUFB4qRBrv7QvHWD/rqb59drqE= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132226euoutp015384ec7c3ed392b61e80d94b8cae5229~Sb3IC-UM61624916249euoutp015 for ; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230403132226euoutp015384ec7c3ed392b61e80d94b8cae5229~Sb3IC-UM61624916249euoutp015 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/Bc/yLCFzs+I/D4 JTuBz7ZdIXD1ZA2Beye2457eQQF2OswUnrL4hXjQ6ifxWO0Mwt8se0R46cxhEe5ub6Lw6PqA EK/5zFSGnG0wXhewHS0q1jlcwdpaj1CsbfG4iP355JqANZ6YoNjucSPFrt7+XcjWnGtF7JIt hrW5FohXQl+TpBdwWs2bnD7puXzJ/mvVnWSpU/L2qmlRZES3aRMS08A8CQ6fhzIhCS1nWhA0 Tp8i+MGLoGv8uogflhB4710jH1gWTHNBSzMCu/sm4oe7CC5M24UmRNMUo4LKI5vuCGYCwfzR hs29JHMHwVfdvURgVTjzPJjrbgkDLGDioGrkXxRgKZMG89UnBHzcVrj44/BmtJh5Girrvgxq wmDwC9emhryvqepsIAMBwFwQw8ySB/HmLOi5+rmQ53CYHTgn4lkBfnsjwfNBmBlbC5oPIzhm t1KBCsA8AzVD2gCSzONgdSTx8kxoGrkZVMhgbCGMf4IMjp+vI/ljKXz0oZxXK8G+4gqGAjg/ MAdbsTD5XT9Zi2LrHypT/1CZ+v9zTyGyFUVyFQ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BMYBWYhSc1C klrAyLSKUSS1tDg3PbfYSK84Mbe4NC9dLzk/dxMjMIq3Hfu5ZQfjylcf9Q4xMnEwHmKU4GBW EuFV7dJKEeJNSaysSi3Kjy8qzUktPsRoCnT3RGYp0eR8YBrJK4k3NDMwNTQxszQwtTQzVhLn 9SzoSBQSSE8sSc1OTS1ILYLpY+LglGpgcilVf7KCv+Lyc/6jD2JqbHY0XMnU0pn2dG/oFBvj dTsktU4r2bfY74izZbxxUbaxzv/BLhvR54YWTzrONwrx83T4Hvwad+eOF39h2uKjrxVOCQto nnHr5pB5L6U0tasvlX/OOh1fRc0bkmn+cdqax3m/Hz4o6BnBfn2yIr/3kew6tqoF2TIT4+sD 5Bu7p+h83uXn/P3OTCZjtereyvd/FjNOOGV/OqJ3rZL25H3PHi8y8OV37mfqV899l3PAbqmA WvoxNfOGvZav762ZKbtJ/EGHVq7elQAF11leb6ZU3Pz8LOyAqwK74BYpJ2/HR1cab/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> X-Rspamd-Queue-Id: 85E458000C X-Stat-Signature: 5brdu5yjknt89rcfn59qktkjs8bzatk6 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1680528148-239384 X-HE-Meta: U2FsdGVkX1+GWaVQMcVcAvUDpr8WRpLXT56kPm4njBsEq6ejINHZPPvDcB9oFlRK/h3PdKL+Q4pa6kNDrvp2tSGj9FWyQ/ka/m6GPtUAw69jhVRujafTOBPqEXFL5JpPKhm83W9+QBilcPhC7dSuqDR/NwQklXHPXX3PwQ9kHe4EujMHspN0RoEhl/d9NmOKQNp6xXElloNCCkv8+v9D/IlnHImaIABtIbqHqhlRuTz06hIlRnWQvrNgWJdnfzaBtANuBLU5+iV71eN8I6xoJUh7YXys3KmVIWGnaU3WKm0jBV82lUrmsP7sU46a4hrFE1cKSuhxubJ+xfVvKRgw/uS63gWR9PdGE6wi3nswrr4LEdPT7BY4n5+M/Ras2hllJ+t0kL4wyUvkHz/hQYKwNYtBHDlCA8iMTBQ4akQ/KHHZ4oe5po0TKzV2UiYHxqcjReoOOzE+fUjYI+mwHqEP/AEPz+hzi3AYI1tKLqplYKHeWzw4NuDVXCaw7dJ4uj43MtyxIve51yDW54i+qlM8y4e1GK3IWo/C2zKBnP5UZwe366E3S3N68ckFsuIuXsuFF3p9o3AWI3vHTt7U37rwNxl2UmA1TVwEgXrpTWaCycg7q3wWVeWuj7ETgY0iV6YV/rT4CVZQE2lV3ZNf1OweL4gijd82v3XMhCsnMn27/8SLF6Zr+1dfHAQ6jjk86Kxj6cZnO3ClR6xEHFeGGtYpkM+Snifn65H1yUK09OyghEAc7g45Nk/yOqw757pKOdT+IjblJG6vkhM6ig5+PO4i5WIpVnBKlcX+6f8dBxm5Gqj4fF6iSvu82J5wQf6CPsoj9UyxKnaDYs7s4olMc1yyyG9YiOadumm/4vfsrvQaLiF05IokDXih0UG2TqYIVUrzBWAyJhs3ZogbrPnhr6yqSDod56sL6mc78Q0092N2EPBYg8Ht549WP/LmGiTRjvPNixzLmFrHtM2xmv/CfgM bqTGUwhL GScfoBMBXykWZAj00VHn4atXmimFCCzs0xWBGEcoKMv3AiTz+SvO4BN4Y2b7WyyjFl9zdRpZABK9tZjZLBIbxj6AlE/sITBdWnPtaktVbX74VbBdw7ODiVOwaPUTmeX4ltXz5iRylV0HcgiwP6PkwRHGfBqkcuij5+Ye0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 13198165 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFD0BC76196 for ; Mon, 3 Apr 2023 13:22:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 156636B0072; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 140EC900003; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFAC56B0075; Mon, 3 Apr 2023 09:22:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E15DE6B0072 for ; Mon, 3 Apr 2023 09:22:31 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A66EA160B6F for ; Mon, 3 Apr 2023 13:22:31 +0000 (UTC) X-FDA: 80640144102.21.F24F268 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by imf26.hostedemail.com (Postfix) with ESMTP id 06F5F14000A for ; Mon, 3 Apr 2023 13:22:28 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=r++2oaFN; spf=pass (imf26.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680528149; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5/+0KaEbpjyZkaLqtYLBQz1+pPqkvr1OOiQOg6+VTQI=; b=LXt2mI/DSJqM8arGA0g1n6BODeOAUoiL+Bn+vALEw8FpZAyY/r3GSso9JtYFh80lkUqB4r /jSLrlOH+gkci3/7jhSWofKaUf6v+4oqVIVFU8UfhSmbFhkvqWwVn2mi6ZBM/Ugpwa3j+9 A9cbtFkXoDwqhoG5+b8D5zTwRjLJ0Qk= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=r++2oaFN; spf=pass (imf26.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680528149; a=rsa-sha256; cv=none; b=prZ33mCZRCjdugKWlEsgXhY6KOF5gS+s9XaOnRUx54yIBxAHmTQIxHeMFwzvs19C0R7SNK bvtPjJ/hBLrV+rQ26XR8RMfX0Bv6I6wrKB0RikPn/qF12yTBb9WeZBAaEMYUvk85M/iSqZ U0iV2tVSNs7MEmaaLkmY8tkWGQGQEHI= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132226euoutp029b77011b7eda0236051b9117bb250fe6~Sb3Idh7E31296712967euoutp02- for ; Mon, 3 Apr 2023 13:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230403132226euoutp029b77011b7eda0236051b9117bb250fe6~Sb3Idh7E31296712967euoutp02- 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+NgFnrKKsWRmVeSWpSXmKPExsWy7djP87qCl7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78Pf 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> X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: x7qeyobehtpkqu54qxw73q7ybjjs3q1m X-Rspamd-Queue-Id: 06F5F14000A X-HE-Tag: 1680528148-736750 X-HE-Meta: U2FsdGVkX18tpFX1sYR+2MH0Nn6R9etIea8Py2LgJ5/EyXTAXWvlsYvfJDsl5y1C0bcfy0nqTZ7VUxip5GMLCm1u0A4US/Qb52LcwZJLAA2IsZPIlHmIQjQFIJZGyFvdZM6eUwZlFNH8jF1DfF2Q5jnjugwmZio1/HMxC+mpafzzU4Zx6YKnqYtoLbO+uBRElJ84HUEK6udS5NWSwgFOIoroPrvUXa1mkhgv+NrkSt5Yca4uGpPDZtfg2PaD6fAeIG6IkdSs8U4g6fCIXOQ+M/GFrRwGurRj8lPDywqnhg7P2W4zEp8dpRF62NVv70BItxpqbFRZtu5feHaETkc18PcTC8UV5tTSduQoGEtKd5C+ADvphALrJTw8HmzVcOWZFRP+OZJyvwfc/F1cS7nBra2yuv45jYJ0gK9KjH09rvMomhZQo2i9AZptC+GdOHhcgqpGzJCXKzpWu00F/PrmS47jQ8BrX6T1Xca8yVbla0BPDSW+paP1K9GmeMWlc+8rP8WKw8fK9AaXWcIv/rW+EmHJuEbl2OJU13YXe0k0NWFtCa7AtuKGIa1e29IIErsixYW56UpNVMvR7EUUaEWbs1MWZmK/moNaKmK5RGb89WOL91xIbYerWLHOxm6YDzdIZpB1AyzbHFrJW2AS0PbuIkS5CphwJDSMOhSBoKpRybL4hBOpwM3fXl6UsxW4boihN2wv92LiCZ+yJohTdJvL18l9dZiVR10bPJ21IJKXVEevd3M/WPrmK9mPlYtH745ZgCFyKf2h8nah55TkhNGnmR0Pcdy1TavWHmGGdzWZ0FzEtgwjvCr0gB7fyAUjZfs0gj+Ca1jozpEvhesFg0qae+qVgvAGyXEbs0fkeLhPe0Dzj1UHAJoWB6Uzopwx7V88BZGir8B03rjrqSKp+v2jY3q+18+5195I5GcXBRT3z+HVSlxL/s3QBpVXiEV0ASfonWjuCdGOO8dS0FK1A7Z rrS4y1/e U8nrI4Gp2c67SR7Ta7pCW2BZExgiJk3EUH7cCqUiq015Xv4kH5q4FeMZowZcanUyhNuAUedMJCjivqYJmyigiqXx/9V8p7d5UVxUftuO5LBOE7KdkxHqRbjitELrIANM+peqXOLJ/JSQSQiJT297cPlQttDb0tQCSc1BR X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 13198166 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1CADC761A6 for ; Mon, 3 Apr 2023 13:22:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 894EF900003; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 846606B0078; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 425976B007B; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0A12A900002 for ; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9DB29ABF1D for ; Mon, 3 Apr 2023 13:22:31 +0000 (UTC) X-FDA: 80640144102.19.7A17BF4 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf19.hostedemail.com (Postfix) with ESMTP id 0E0481A0017 for ; Mon, 3 Apr 2023 13:22:28 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=WXp2Xael; spf=pass (imf19.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680528149; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=C4y5H34/b66lYzmCayiry+Dr/iI1gotrFjxRhbqI+PI=; b=qR9YCo7Bx7Ydt66KpTcu/Y8e1Un0pT/5AG71hku+RD3iLOH8g1Ms/c3lgqqbqTCXdSMwFk bnvTnzLZiKxuOBbwOZ0N4i1XjqOp2Rcx2qbuEKzrrrLySIj9FNjzOG0vN2eFqvVNKtDhMk D+LlIqCJkfyMN1zcbBAHBUFeSBqkrAQ= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=WXp2Xael; spf=pass (imf19.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680528149; a=rsa-sha256; cv=none; b=2hZm9k3GXiP2Xm+IATtMBiUUni05WmpouRdw9cqfnG6ZTDhlEN2R35r04F8cF9KWYLgG6/ JDhI4P9S+/BfkPwFRUK1wVBzkYGTOy+7WV0J8h0hZRWrU2ksUMYfaPs07PCB9gkQW8HRk2 hleWbTqr1s5psr/3AcuhfuyXIhI632Y= Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132227euoutp01c2ee7068f888a6ae4a843c1a64d12f73~Sb3JFZNVc1624716247euoutp010 for ; Mon, 3 Apr 2023 13:22:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230403132227euoutp01c2ee7068f888a6ae4a843c1a64d12f73~Sb3JFZNVc1624716247euoutp010 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+2YDm8ev23dYPf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AA= 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> X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: w5bpb3u3tr4uwpqzk7gmkmsp6n5nyez5 X-Rspamd-Queue-Id: 0E0481A0017 X-HE-Tag: 1680528148-736947 X-HE-Meta: U2FsdGVkX195t5il1D3TrTkFLeUyPRwcgO3C0bTSiYrRcq6kiao3N0ICvJoPQCxY8CsYQnfH5K6Q2C2NlB+n3ieYNWUd//3HLDg7RjeVQVKnCqXzNJeRcl+d01seXOwiS0U+SZ2GDtU2h+PpS3BdeakFNjDGJLDmErOTtAhUMNUqCkm3DklF9XC1lrkMgiaTCcEU/XckQEG2FpKRoLPwFqdW0gtLaeQOe2pmyiUg74DXn0T4OUbXMk5voC2tMF6aXgkl8LR4sGROZ/ZirCoLLExfm0u5lHAQdZArdhNN4Zo89vanQOuGajg3uCk4kQdlzSnG6uJSiHBeZKgt2wU9vua/S7qm0yxWPuPDDxV8vyxgCbwnHbilq09V0i8rA2vs/PJb6LVlcTjDJ9ZtZeYC88p8QNTvgi4bZyWCtmSovmLDNBjWlRENhXOPDR3X25yq7JsrhmezXG64qW59Xp0THd7Zv4nvjoI8/1ED28TayzzngFzcaAyzu2YXHTfUxQsSVcXuZGnP9G6mcJxgiNPSt+BhTAjb57bkqcDHVq7CYbHEdabQhy9H7QtDD5x41YCO3rRywLQfgI4Td7LZOLqzZMc8WCU6mK1/S6xZS6EFSvURtmdc9l8snrSjZnAJ+oMbUMvuHmHazqMb3SPjAoCAuw5k/YWkGx0qacvSfVekG0UWDG/oZlIff5y7Sufp7HapOsUSj9IRmLQlJq9kGXjZlPb4mVpoPLDsfPJD0nXzRIgnhXlaeBkhCmLAZNJN2Lt2gAtUxiYqphzLlIYon7qSzq7SHXijVxgYfACkY1MqaL0h49mm7uuq83abuPoKYkrjfUUbQYScbznMAsFhEsVqlTWIIH7Aw7RO8inx5alk1zZ1zRpGbPqdK1K7rh0AfhKZY/d0zFGgwIffIoslCQCySNyQVy896r4L4B4mvDF9bUEEgHHWzLM9gRKyaxYQo9nTH79w1QwZWO3hsxq8NQO 7SC4SQlf xoxxE4utYKh/lNL0eT1kWFAotmNafJyKqg9eHqfTB4voW1gcT26OU5w3uFsmKqA40ZiUMrTkzbD8kqFh38Akyi+tNcvmnMXf/Z/bgyRKXi/8lLLV1a+PNGNEjB2OWp9lC1Mhvs3En8mhXGuKjyhe/96bR4Y2Lm7cjEuOV X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 13198168 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1978CC77B6D for ; Mon, 3 Apr 2023 13:22:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFF99900002; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A40BE900006; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7356D900004; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 284AD6B0075 for ; Mon, 3 Apr 2023 09:22:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EBACDABE0A for ; Mon, 3 Apr 2023 13:22:31 +0000 (UTC) X-FDA: 80640144102.19.0CF5B26 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf25.hostedemail.com (Postfix) with ESMTP id 6198BA0006 for ; Mon, 3 Apr 2023 13:22:29 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=MGRaqrsH; spf=pass (imf25.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680528149; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Qd/EHq/hNi9U0eDQzSkYHva3vzVuhQ3/uVr2IhrtsQQ=; b=DHqm4I/Bjmf9tBDoiWZeS4hcupvXoREAV5PE3h55hamVDZjlsTGmnID+faLR0SKZT/8qyS oBffaCu35RgTs9AhLYLpjKhCQbFEh2azBY+eLzfF1upQ6sL3xH5tNApwzZUOusqPdtvyeW PEJYcGNEtCzjUFe0Wn/CgqM+ATOmQv4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=MGRaqrsH; spf=pass (imf25.hostedemail.com: domain of p.raghav@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=p.raghav@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680528149; a=rsa-sha256; cv=none; b=3+W+XQxKh6AXKH/lMaYVbgDqTpuO9nBDuK6tJtyICjwJHaNqKiYDvl0SzibWRBT0fC0R70 mMsXqX840gcFJy9UINLKw03dMJCqFnEfBOjUxjCLlR4oB0SgTmoBmLwW1RqfZzFgVVRoVf d1a+Wnlhp0hUR7pyG9a1PwhuQqd3PV4= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230403132227euoutp01fb3f26490c02e000654383401f52bbfa~Sb3JgRkxY1586215862euoutp01C for ; Mon, 3 Apr 2023 13:22:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230403132227euoutp01fb3f26490c02e000654383401f52bbfa~Sb3JgRkxY1586215862euoutp01C 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.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7djP87pCl7VSDPquylrMWb+GzWL13X42 i9eHPzFa7N88hcni5oGdTBYrVx9lsmi/28dksfeWtsWevSdZLC7vmsNmcW/Nf1aLk+v/M1vc mPCU0WLZ1/fsFp+XtrBb7N64iM3i/N/jrBa/f8xhcxDymN1wkcVj8wotj8tnSz02repk89j0 aRK7x4kZv1k8GqbeYvPYfbOBzePX7TusHn1bVjF6fN4k57HpyVumAJ4oLpuU1JzMstQifbsE roy33bNYC+bxVay//4GxgfEsdxcjJ4eEgInE3VlvGLsYuTiEBFYwSjQ+XMvexcgB5HxhlOgM A6kREvjMKHFkth5M/bK+OUwQ9csZJe4f2gzV/IJRYv7BJYwgzWwCWhKNnewgcRG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zfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRejZF+aUlqQoZ+cUl tkrRhhZGeoaWFnpGJpZ6hsbmsVZGpkr6djYpqTmZZalF+nYJehlvu2exFszjq1h//wNjA+NZ 7i5GTg4JAROJZX1zmLoYuTiEBJYySpxumsEIkZCQuL2wCcoWlvhzrYsNxBYSeMYosfBuYRcj BwebgJZEYyc7SK8ISHjZheMsIA6zwHNGiTVTfjODNAgDbeh4ugmsmUVAVWLZyjYwm1fAUmLp 5zdMEAvkJfYfPAtWzylgJdE4fS4jxDJLia8Xb7FC1AtKnJz5hAXEZgaqb946m3kCo8AsJKlZ SFILGJlWMYqklhbnpucWG+kVJ+YWl+al6yXn525iBMbwtmM/t+xgXPnqo94hRiYOxkOMEhzM SiK8ql1aKUK8KYmVValF+fFFpTmpxYcYTYHunsgsJZqcD0wieSXxhmYGpoYmZpYGppZmxkri vJ4FHYlCAumJJanZqakFqUUwfUwcnFINTDxHo9drrbvzV2V7wYpNCa1enCkzFmk4ye/O3tt2 XNxmio7Sy+bzieunTODQaLq12+xdiq7KcgnV9Jv+/GuNzkz7fl+5TTxkV+C32iyf+OZLfayL 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> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6198BA0006 X-Rspam-User: X-Stat-Signature: pmzbddwrngawr658h3pz7kzpysdsek3b X-HE-Tag: 1680528149-931499 X-HE-Meta: U2FsdGVkX18BCNS1Fh+sM1f24Uh1R0Kas2O4Cjb4ZCtQKCyeUCfeCf9TjFylfW3sZqB4NIH34zwZ+rhrLUj81yhXjnonfP8FlPbdz4qAcp85MOtjYxFGJLZ0/exMAfbHbZ6LUcjUni7YiRQw6LqrQRJ5IGHgUhPZiVhyQmlurvTl/VHQbkbuwjP45pZ871XKl80zXE4tgJWlPjW6D4qiF33ZHlVb6H7GC/FT4ED2Wbe+IAs9TVh2mOEI4WzH8finjblaSaOrqWXFMvSHq7db+XIr6K9rbrejyaqGgo0voPsgDqx7gQfrDlsmN6YvGRxI9Ii/Xk3FQX5TpeCmed1y2lzmFJQS/D7HCIWL8AJS4B/HPyKvlct6kxEvjnlwDwNat5wiU070Qfqjpm0tXw/ujhy+OiO4HkTGVDt4YohCH4n7PnHZs+I9JNNBEspdDvDBl2Lou2JQ26jbPeCD2oLVZMZQGn0bTsOGLwcHjZ1CodtongdiJV+2xfMZKRUcFkzuc/FsQVKI6b19FZK/4s4AxIYipJT/B6x3GarnLapt7F/CdWQL8D7h1p7ojcJ+7VX4tNi+qxeQMIcFGBXYvwBOb2EF+FEa6AVO8w6FrLvAVTOQfgqICShFY3UDE2fYlLoRPv6ff+Mz8mo3M0Xt28DQTu33u+4YGZmML2RJOuFoxL8i1se5heMYVCEM8CBw1Yzm3pM+Y/bfRKAf9EnJexDF+w5oQ0IhZ1euqa9sd8BpJM3bmetJs5JMm7Ndj22YlSu3YoSPC0Nw5ZKzKmSt24tDwCWO96D1OuVZxP/Pxr2b5v8tkYdsfccSasPGEkOzskoIC/8Eakfe4ZFVEX2Y5Ow8Biw+KGOAMsuBswgV0D8pUJ1OtYWn5KLZ34dW/7WOucUCn4SSZbfPuELNhdNzd+wYqPIHwmQk6+lKgMvCjrWE/fEeBxWicNJcG/BVu0Tkadn8VsZJVUsanR39Ir14JYQ e/Ol09KC QSMsk0BjFEiy1SK4o4OjfM3gqhRnZi+0GjYwTRIsT8ul+EtP+6ybjeqnVLGvlUmfY6KpYrJ0awibW56j9/ryxotQZfXXQB+aDDeKr7FXgKN1TJKNWtWklK1lnrFZn4obvO25p9AGzGzwHDtIhQPDiriy6GTh49UISV31i X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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