From patchwork Tue Apr 11 12:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13207508 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 ADD8BC77B77 for ; Tue, 11 Apr 2023 12:29:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C34AB6B007B; Tue, 11 Apr 2023 08:29:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE5716B007D; Tue, 11 Apr 2023 08:29:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E85E6B007E; Tue, 11 Apr 2023 08:29:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9068F6B007B for ; Tue, 11 Apr 2023 08:29:31 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 66F50ABCAB for ; Tue, 11 Apr 2023 12:29:31 +0000 (UTC) X-FDA: 80669040942.08.9363CDC Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf17.hostedemail.com (Postfix) with ESMTP id CCB284000C for ; Tue, 11 Apr 2023 12:29:28 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=k6k7bPGM; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf17.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=1681216169; 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=1qC6zHvAgcTgYm8ljFpJs+7FVJXDek+LLyQQCiQNxfg=; b=75fr8Vgj9ichGlfL1v31QLl4mbr9+yOI8fxSZ32mCaKlDiUzMFctkD1pRcz8DlYF95TCE3 yo2m6SnQv/9VyrMAtvfDPLQRiuNGMyK7fLcXMhrrgKc3mD1415a+EmREi7sJWLjMzMSzP6 sFVophpNhXrT3AA/wgKQmw2XiFENWwY= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=k6k7bPGM; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf17.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=1681216169; a=rsa-sha256; cv=none; b=tzafpvFKQA0AYDsatA+AcAsUQ+7mVezcE31WEWNJ2F2H9SziJ308Js5UKRogNauC9Dtfup J/J4hTr4LKZbKWEXqaZ7w//96ZKRMEKrQpzm1Mz+/Ki5wHC2/zf+tYhzQ9DOQHGCERhTrP I4DGX48sqZ2rEVrqyW6bg6mTEgvEze0= Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230411122926euoutp01e96da30d9594402c24ee8dd1b45c313c~U4TIk-all0506105061euoutp01R for ; Tue, 11 Apr 2023 12:29:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230411122926euoutp01e96da30d9594402c24ee8dd1b45c313c~U4TIk-all0506105061euoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1681216166; bh=1qC6zHvAgcTgYm8ljFpJs+7FVJXDek+LLyQQCiQNxfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k6k7bPGMEm2WHoEuC8ctkZLXXHIOTQHQqoV82xAuO9/lme4BfzpuXcLwM22tTO2wG L3UTTJPx6bmJ5ObCRUWkgAaYB1PogBSfjKjSwToyDIL80kxUwhaOZn2anIaaf4esh3 /HVXMrUTHDMOG6Y1maEiN1Ktyk/5rrfuuZnaq0Po= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230411122924eucas1p2a842969709d6b49b03f7c346bb6d7103~U4THBHNHL3227732277eucas1p2w; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 8E.9A.10014.4A255346; Tue, 11 Apr 2023 13:29:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d~U4TGnGH0t0202002020eucas1p1Q; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230411122924eusmtrp241d6a59a92a6a323b6b491c16e7e34ca~U4TGmSAGr0100601006eusmtrp2p; Tue, 11 Apr 2023 12:29:24 +0000 (GMT) X-AuditID: cbfec7f5-ba1ff7000000271e-0a-643552a43e97 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1D.58.22108.4A255346; Tue, 11 Apr 2023 13:29:24 +0100 (BST) Received: from localhost (unknown [106.210.248.243]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230411122924eusmtip2237fca85463f83e9b9eeb88cf4b5bc78~U4TGX3VXf1077210772eusmtip2d; Tue, 11 Apr 2023 12:29:23 +0000 (GMT) From: Pankaj Raghav To: hubcap@omnibond.com, brauner@kernel.org, martin@omnibond.com, willy@infradead.org, hch@lst.de, minchan@kernel.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, akpm@linux-foundation.org, senozhatsky@chromium.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, Pankaj Raghav Subject: [PATCH v3 3/3] mpage: use folios in bio end_io handler Date: Tue, 11 Apr 2023 14:29:20 +0200 Message-Id: <20230411122920.30134-4-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411122920.30134-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJKsWRmVeSWpSXmKPExsWy7djP87pLgkxTDG4vUrOYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSxWrj7KZNF+t4/JYu8tbYs9e0+yWFzeNYfN4t6a/6wWJ9f/Z7a4 MeEpo8Wyr+/ZLT4vbWG32L1xEZvF+b/HWS1+/5jD5iDkMbvhIovH5hVaHpfPlnpsWtXJ5rHp 0yR2jxMzfrN4NEy9xeax+2YDm8ev23dYPfq2rGL0+LxJzmPTk7dMATxRXDYpqTmZZalF+nYJ XBmfVs5iKTjAU7FhzgbGBsb5XF2MnBwSAiYSzdeesHUxcnEICaxglLh64wiU84VR4tWerSwQ zmdGiRcb7zHBtDx+8h2qajmjxOIFR6Gcl4wS70+uYOxi5OBgE9CSaOxkB4mLCNxilFjw+Qoj iMMscJ9R4uGtU+wgo4QF7CWm/lrEDGKzCKhK/Hu+AWwFr4ClxJztz6HWyUvsP3gWrIZTwEpi 9aoPjBA1ghInZz5hAbGZgWqat85mBlkgIbCbU2LHrL9QzS4SPRsuMUPYwhKvjm9hh7BlJP7v nA9VUy3x9MZvqOYWRon+nevZQF6QELCW6DuTA2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T0JJo7GQHiYsIPGOUmL1hCytIAzNI0a9HvCC2sIC9xNRfi5hBbBYBVYl/zzcwgdi8ApYS c7Y/Z4JYIC+x/+BZsBpOASuJ1as+gC0WAqq50D6PFaJeUOLkzCcsEPPlJZq3zmaewCgwC0lq FpLUAkamVYwiqaXFuem5xYZ6xYm5xaV56XrJ+bmbGIExvO3Yz807GOe9+qh3iJGJg/EQowQH s5II7w8X0xQh3pTEyqrUovz4otKc1OJDjKZAd09klhJNzgcmkbySeEMzA1NDEzNLA1NLM2Ml cV7Pgo5EIYH0xJLU7NTUgtQimD4mDk6pBqZ644a9izas16pqZj209yzDXsk63we8Vq+UDWf+ uj858OvviVEyD5tS7nZNkEuSCPhzeGtvxZsE4Vsf8+aKfeq4qcv5YnFx9SYvscVmCpKdy6Pu Ofov8JZxiPz2LnZFTMI3b8lLLm+nvhNJd5dfobXNyCVgJou70brwfdcZ8nUMs3qK0oMyJnFo 2J9VUFW/xpDeu0T4aMGvpWVW4hW/6pf89MvfISCd+Lb67WOPomwfjsA5Hg7XPvYwq3CEmnu/ mvc8R/l88+U8bd79nIcWWeVu81I5pPOIz9n/bPVRW7t/c+bYZ5s9WLCa89wnNw6v/YJ+zEVT Jy7eNI+l7/VSw4/fLmy9vGnpD/lbzHfNtymxFGckGmoxFxUnAgCIKuLiagMAAA== X-CMS-MailID: 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d X-Msg-Generator: CA X-RootMTR: 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230411122924eucas1p16c6abcf91a3e04c6a0a225606ca0044d References: <20230411122920.30134-1-p.raghav@samsung.com> X-Rspamd-Queue-Id: CCB284000C X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: nnjo84dofy6i6xjepxnzuiepniye34qp X-HE-Tag: 1681216168-132029 X-HE-Meta: U2FsdGVkX18dec0ySxa8DUhqGDF8cpkZBZns9DNPjgMgH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Nn71VtxreWjnr35qQ7whPmP9cUWhI 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, 18 insertions(+), 10 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index d9540c1b7427..242e213ee064 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -45,24 +45,32 @@ */ static void mpage_read_end_io(struct bio *bio) { - struct bio_vec *bv; - struct bvec_iter_all iter_all; + struct folio_iter fi; + int err = blk_status_to_errno(bio->bi_status); - bio_for_each_segment_all(bv, bio, iter_all) - page_endio(bv->bv_page, REQ_OP_READ, - blk_status_to_errno(bio->bi_status)); + bio_for_each_folio_all(fi, bio) { + if (err) + folio_set_error(fi.folio); + else + folio_mark_uptodate(fi.folio); + folio_unlock(fi.folio); + } bio_put(bio); } static void mpage_write_end_io(struct bio *bio) { - struct bio_vec *bv; - struct bvec_iter_all iter_all; + struct folio_iter fi; + int err = blk_status_to_errno(bio->bi_status); - bio_for_each_segment_all(bv, bio, iter_all) - page_endio(bv->bv_page, REQ_OP_WRITE, - blk_status_to_errno(bio->bi_status)); + bio_for_each_folio_all(fi, bio) { + if (err) { + folio_set_error(fi.folio); + mapping_set_error(fi.folio->mapping, err); + } + folio_end_writeback(fi.folio); + } bio_put(bio); }