Message ID | 20230328112716.50120-5-p.raghav@samsung.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1D0BAC77B61 for <linux-mm@archiver.kernel.org>; Tue, 28 Mar 2023 11:27:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C51F6B0078; Tue, 28 Mar 2023 07:27:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 24D0A6B007B; Tue, 28 Mar 2023 07:27:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F122A6B0080; Tue, 28 Mar 2023 07:27:26 -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 D70D76B007B for <linux-mm@kvack.org>; Tue, 28 Mar 2023 07:27:26 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A9713ABCB3 for <linux-mm@kvack.org>; Tue, 28 Mar 2023 11:27:26 +0000 (UTC) X-FDA: 80618081292.06.16605F9 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf25.hostedemail.com (Postfix) with ESMTP id 332F6A0018 for <linux-mm@kvack.org>; Tue, 28 Mar 2023 11:27:23 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=SOQeOheN; 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=1680002844; 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=UN942d/dzdm4cfPQ1XoIz03YPzuLMyIuwNH8C95bAwNjeZLWXnyLIW2wMwpr+tkXNFAOWp fuiNgnXTWXqJlj2wayQGHQpY0tjmWqzDHmQGB/OK+XLni+HmXpBUy24co41TgGb1hKZLge wEprFl5Xg2ZvwKV0qUuAD8EQPD6CfMk= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=SOQeOheN; 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=1680002844; a=rsa-sha256; cv=none; b=bUh4cBAW+tIBaepDZLYVIr2SNJr0mRxd/g53/sDYjhcRTdkUY3ngJQgHt24rLVZvkLbhs+ 0c52TXD0KEFEH6/VmcGxNfkSyUbRtdUcejBITgZkoTvJyYsx6K93KgQ3lS2DA+g9fSCnJY cIWMqaLWHu72HmiJ/DsDC9q6RBFJzLs= Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230328112722euoutp0188ab30292ceb68c6dc74b3ca002290c2~Qka8x4WJH0435604356euoutp01m for <linux-mm@kvack.org>; Tue, 28 Mar 2023 11:27:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230328112722euoutp0188ab30292ceb68c6dc74b3ca002290c2~Qka8x4WJH0435604356euoutp01m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680002842; bh=C4y5H34/b66lYzmCayiry+Dr/iI1gotrFjxRhbqI+PI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SOQeOheNVR3TOZRUeQLXiB9Fxu+PcuYHKieaWtx2g3+sxEx86tj7vwcSVUFDblKMz Vj9tVHIZqhGlVhs5bIfLHmUm6Q8p7o9xtBiSeHx+scxD1HY0YSnL9ots26OszOY10S VMBk19gD3UFgy+dC35ln638RaAPyCp6CALsLljU8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230328112720eucas1p208a91e75a4df810cf7dd3781ee8559e2~Qka7MHLqp0948509485eucas1p2J; Tue, 28 Mar 2023 11:27:20 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 07.51.09503.81FC2246; Tue, 28 Mar 2023 12:27:20 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230328112720eucas1p1148c03b8664f6c212c7189454a36b796~Qka6blNGF1794717947eucas1p1w; Tue, 28 Mar 2023 11:27:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230328112720eusmtrp269ad4302d80bafe5b32231e8e7b2f8b3~Qka6a46bI0134701347eusmtrp2R; Tue, 28 Mar 2023 11:27:20 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-7e-6422cf189df9 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 1F.71.09583.71FC2246; Tue, 28 Mar 2023 12:27:20 +0100 (BST) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230328112719eusmtip21f0b4a5953ca974547d94cb63d3c29a0~Qka6Ka8Ob2590125901eusmtip2_; Tue, 28 Mar 2023 11:27:19 +0000 (GMT) From: Pankaj Raghav <p.raghav@samsung.com> To: martin@omnibond.com, axboe@kernel.dk, minchan@kernel.org, akpm@linux-foundation.org, hubcap@omnibond.com, willy@infradead.org, viro@zeniv.linux.org.uk, senozhatsky@chromium.org, brauner@kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, mcgrof@kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, linux-mm@kvack.org, devel@lists.orangefs.org, Pankaj Raghav <p.raghav@samsung.com> Subject: [PATCH 4/5] mpage: use folios in bio end_io handler Date: Tue, 28 Mar 2023 13:27:15 +0200 Message-Id: <20230328112716.50120-5-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230328112716.50120-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLKsWRmVeSWpSXmKPExsWy7djPc7oS55VSDK73mlrMWb+GzWL13X42 i9eHPzFa7N88hcni5oGdTBbtd/uYLPbe0rbYs/cki8XlXXPYLO6t+c9qcXL9f2aLGxOeMlos +/qe3eLz0hZ2i90bF7FZnP97nNXi9485bA6CHrMbLrJ4bF6h5XH5bKnHplWdbB6bPk1i9zgx 4zeLR8PUW2wev27fYfXo27KK0ePzJjmPTU/eMgVwR3HZpKTmZJalFunbJXBlLHh5iaVgAm/F n0v72BoY73B1MXJySAiYSNxdco+9i5GLQ0hgBaPE3R9TGCGcL4wSDw88hHI+M0rc2H+WCabl 7YwNLCC2kMByRokj32Igil4ySqzufA+U4OBgE9CSaOwEGysicIZRYvHyRjYQh1ngPqPEt5fn wSYJC9hI/Ft/ghHEZhFQlWj83sEKYvMKWEqcmjmPDWKbvMT+g2eZQYZyClhJTPttBVEiKHFy 5hOwI5iBSpq3zmYGmS8hsJpTYt2ebhaIXheJg3t3Q10tLPHq+BZ2CFtG4v/O+VDxaomnN35D NbcwSvT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F/7n+gIg4ONgEticZOdpC4 iMANRom1T3+xgjjMIEV390FMEhawkfi3/gTYJBYBVYnG7x1gcV4BS4lTM+exQWyQl9h/8Cwz yFBOASuJab+tQMJCQCVXz7xnhCgXlDg58wkLiM0MVN68dTbzBEaBWUhSs5CkFjAyrWIUSS0t zk3PLTbSK07MLS7NS9dLzs/dxAiM123Hfm7Zwbjy1Ue9Q4xMHIyHGCU4mJVEeDd7K6YI8aYk VlalFuXHF5XmpBYfYjQFOnsis5Rocj4wYeSVxBuaGZgamphZGphamhkrifN6FnQkCgmkJ5ak ZqemFqQWwfQxcXBKNTAlPHR9UXHFs9y11PaUL7v3dQnTfoFVp6P17f9F+Hx/LfOS+0W3jGj7 LDbGQ9sXXtX8XewT+m3J9YN1M2ZbKM3KWuj0yvb4Iiv+CUITebjP+X+Oj1DLMYh8vXH3SwOG H12pkpuOXl124ov8MTuWtKNZBz71HPin5Nm53LnskUXbrDn9olknAjLim49779Ap3p+xfoK2 w+XqWR8EJdY4ZrfwGER9qnGX331c4I+f5XrmlbvfNTZcqUzPWph3S5wnvLLmpXqC+KkHzuZX Xj23LzoTJWfLdL7twZOUTsOSrwu6V2r3VcbNEC+Xcur3zO/bwJjZcG1d/sZf19l36vJZ3d34 9u7iY0o/5jqG7/edP0WJpTgj0VCLuag4EQAOWOnYYAMAAA== X-CMS-MailID: 20230328112720eucas1p1148c03b8664f6c212c7189454a36b796 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20230328112720eucas1p1148c03b8664f6c212c7189454a36b796 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230328112720eucas1p1148c03b8664f6c212c7189454a36b796 References: <20230328112716.50120-1-p.raghav@samsung.com> <CGME20230328112720eucas1p1148c03b8664f6c212c7189454a36b796@eucas1p1.samsung.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 332F6A0018 X-Rspam-User: X-Stat-Signature: 4sqhskoufmnwddhbra8j3pp8qkpfxgd9 X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wKjws1G4ML/vtq48c8+gtoQsCH5SBW+MTRrAFeh5HJA6C/e3gk4FRrhbIsEcuwiqJ4boruOGYzmLJLMw63XgGamiUGyPYfd7WQvcwcYM5znM7zFyTT7u 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: <linux-mm.kvack.org> |
Series | [1/5] zram: remove the call to page_endio in the bio end_io handler | expand |
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);
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 <p.raghav@samsung.com> --- fs/mpage.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-)