From patchwork Wed Oct 4 16:53:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13409075 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 0F73FE7C4E5 for ; Wed, 4 Oct 2023 16:53:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78F2E6B0289; Wed, 4 Oct 2023 12:53:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7647A6B028A; Wed, 4 Oct 2023 12:53:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DDE36B028B; Wed, 4 Oct 2023 12:53:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4A4A86B0289 for ; Wed, 4 Oct 2023 12:53:34 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2494440396 for ; Wed, 4 Oct 2023 16:53:34 +0000 (UTC) X-FDA: 81308375148.25.2C8EA56 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 6CB0112001A for ; Wed, 4 Oct 2023 16:53:32 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Aw3Cl2LA; dmarc=none; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696438412; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZWM/c0Bk7RP+LkIKV16/78R+lD44jh4KeYNE9FiQZ2g=; b=sApBCg6eiWau/l78NZrYcvpCtcJIK7ef+IJS/kakImFmo6e5hc6jR1WJiBz1mlzonhrsee Uh0vC3Mjf0PyZu6xW/GCvyIUgrZ8NBL6+k+rf0L4hKxaqOPdSo3hMeo7zGkC443OLqO5R6 cGtrq8lbXUb54JQxeiByA1G1MFQUHK4= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Aw3Cl2LA; dmarc=none; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696438412; a=rsa-sha256; cv=none; b=XVX67Rh2Rivm9xQM+9WhBs1v6H/B2dPdDc5p4enQytLj6KMjfDK93R5nFE1GzKDQVNc2hq dO1gl8eeFfZdx9OxGGRj6t6vKdUF9bf84jT+XH5NST0n0d0e6z8RYLlVHqrvDMrLu+RIaw oQ3KC3Sp+5NW79HnVzKy4os0+0cMHoU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=ZWM/c0Bk7RP+LkIKV16/78R+lD44jh4KeYNE9FiQZ2g=; b=Aw3Cl2LAeVVsVTuLeNEwUq/VbA l81BMeA2S58v2J8f3iduduSKLq5Ymwo3HIDSHj2xkuXTosEziXIyE7ACXOdvHQWhHUd3P5J71NIMO xiGvXkUZP2C5I4rHffcnPBy9wVyXH5wXIZdFqV71NZtCtdtjIuNk9thk4UFfUpvE6etPONmOfwN65 zUosIjQElESczPZGIu2xynSiayxES/+8eLUaYJB0EYwYG+1frJmEMX9TeHHTFefunADL5TbmnR0R7 z5BWvZCFdQrRwZ+tua2GqBnj6E6lKbFUQ4tb4uEvGCnNpj3U9Ak8FHSTiKJeKeCNZlSrGLW0rM3HE 66+mylQw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qo57f-004SF0-Da; Wed, 04 Oct 2023 16:53:19 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, torvalds@linux-foundation.org, npiggin@gmail.com Subject: [PATCH v2 04/17] ext4: Use folio_end_read() Date: Wed, 4 Oct 2023 17:53:04 +0100 Message-Id: <20231004165317.1061855-5-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231004165317.1061855-1-willy@infradead.org> References: <20231004165317.1061855-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6CB0112001A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 7qp3xaniqmbdpn9dpoi3apaac1t9x4dg X-HE-Tag: 1696438412-86795 X-HE-Meta: U2FsdGVkX18CaNlh4MU0bLMNtyA3K0/Ohfl8LxExuEtVAt+ag+w5tqkfOIFelZRsgpa3flhsYIttbBctUMtTmJ7/JAYsTfuxtJIWUYBc2T2rEM5KheVxD0K1h/aEtaLZIXffioOu2d8wvJYzjWMeQ48RGt7zPAPnGsxdiB2xfsg9cpnF/XPZ8u1Ajd3zGv17mDlmBn0dAcPXDTU4wDvwlnsbaDol9q9n9n8zUEJAZAay/yzaG/a+18H4wCXiMjwF/P/she4qYDuJDrF22w0DVABD6A/fUCflrvKni5G8qUNyF5MEIpBAtioSuv/p/TSVqIvkVM53wCoSdfKxDEvMKj/IH7WGceca4xlPMbEv2+LegCt4rrPcLTyDTgJf1/0QsD4B4lAnfj0IJODnsCVejFouDiqkJh5tzLuO5ME3zwrumctTr/2nRxi0sMSa5C9T88gKY+zHWD3qyz2nBPtM41raNxpTwEj/dIkvVS7nswg2u2PjlzbsKXmUIMztKauYyoxbNkBMRaP5q+mbGo4BO2mVzCrR5qA2CySAjAbN6chpiviqMSY9pbBqQhVrXPkVIz1/KDPn9f45s7BzPMqWbl8bn9qxidzHfb7Wr69H72G/ReCSUZlcGCNGq3U6ZqUt6IK1d300PvFb2ws1O0qqNso2Lmb/qyA2FUGuvintoqPMHf0Uy+lIlb07Czn9xYCpK5Pls+9Y3H/0eWI3O1u3dskc+6o7vKpoPsmls1WWO2lGTYWpSRyQJMmYN4VDEbIFEY+UjcF1LZltebFKRnTINWVBUUWQQIzU4UqzPezjpse/324y3qlyyM9RNxgQdzCCtbWZ8zBYQLDUNKMMSMYtadh7L1v2WeFYhxLEdPfZyHePgPsRPCjg1iBwKD/bdg3w4dNJ/rq8V8KHF/ZY+4q+V90CjfROpZ5EMbIyohGhLyq9Tll2i5CySMSTwpPdr8JCGzjHj6Untu8pxzkHzRP bPBOt/0Y Mz9+YM2lc3E2GYywWKh7DIfQHMdTTsFS2qUpBlAWp/5gdS1To9GR50cOVmWtz33Gz2Qi0Utk2NaXGhiZlQDBGxiJk9cfGBeVF/5lD5Ax74Ja9+SUcGYMIrdPKcPSA5H/Or/Djm6v10rS1u0gWUwpjTkdauPYWp+Si7t+g+aQbXVB7XyxCoQ2SkPTzO7+pBtebNzz43TC5EYax3KZkNF3BwW60om5REjsYICoQ 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: folio_end_read() is the perfect fit for ext4. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/readpage.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 3e7d160f543f..21e8f0aebb3c 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -70,15 +70,8 @@ static void __read_end_io(struct bio *bio) { struct folio_iter fi; - bio_for_each_folio_all(fi, bio) { - struct folio *folio = fi.folio; - - if (bio->bi_status) - folio_clear_uptodate(folio); - else - folio_mark_uptodate(folio); - folio_unlock(folio); - } + bio_for_each_folio_all(fi, bio) + folio_end_read(fi.folio, bio->bi_status == 0); if (bio->bi_private) mempool_free(bio->bi_private, bio_post_read_ctx_pool); bio_put(bio); @@ -336,8 +329,7 @@ int ext4_mpage_readpages(struct inode *inode, if (ext4_need_verity(inode, folio->index) && !fsverity_verify_folio(folio)) goto set_error_page; - folio_mark_uptodate(folio); - folio_unlock(folio); + folio_end_read(folio, true); continue; } } else if (fully_mapped) {