From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31EDDC36014 for ; Mon, 31 Mar 2025 20:13:19 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tzLVV-0000sR-8A; Mon, 31 Mar 2025 20:13:18 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tzLVO-0000rj-9F for linux-f2fs-devel@lists.sourceforge.net; Mon, 31 Mar 2025 20:13:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FjOppThpLmYB/HtBc3gYJ90YO4RBGnLgSmU7TtJFrJo=; b=lokJRQ0Kp0BsC16E9NPwOGQA1J on8Bxnpl7Ce0m4GadsTlCKCsAYhXLQTEr8/IEBBK614c/nqiF8laAbbXguycFawol973Cmv9ae443 XdfG9DD85mku9oGjjEP3CREsMHJY9zIUTmcToNOlXppsNmg9/jnPefh7/f3gP+ZoK9E0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FjOppThpLmYB/HtBc3gYJ90YO4RBGnLgSmU7TtJFrJo=; b=NUeg8wdiOuy1j55Ti5yQzFDgNl OIrrfYK92eQf0g9qI0JtDwUPJE9fw88bffPvyEmW4jL0tjbZvxciOOy50cfvf0WTq/yNYHC0SLPwX 31HLybNR3LBj/cW63Vx70hXWnMToMAwOPnL8tTRvqw6ssBZJsS9711ajBFeLnTBbsRNo=; Received: from casper.infradead.org ([90.155.50.34]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tzLVO-0003YR-5o for linux-f2fs-devel@lists.sourceforge.net; Mon, 31 Mar 2025 20:13:10 +0000 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=FjOppThpLmYB/HtBc3gYJ90YO4RBGnLgSmU7TtJFrJo=; b=K0F+wpMroYexti8/FDOPE6McZN CImT5NOy1kuDmNBIRDuNgq7+utuhDhWFWvgIjr0IV0pZnvf1Cq5HqBBjArhB5v+obWqrQBnzBpnWJ YIIxOnpxP3emhd32JDTO6wlCUQl2CUUgxRHhTu9a7ZWuE8DI9xZeByRApcnaNbZ9TQ24Tq4gTIsLa Jy5keLf5FaQKyEegvmM05AEi50Rq8THqBEYEkCbfty3s2aqbvMjtS5pDLua2UNppe0qst2TMcfodN GnYkBEDcqHjjRWSZSIlzNXDX8XALrj7RVdwrAMwkM+3T2Y59YOMGR8E86ViJMlCMpQLQjgJ5LRuK1 O+3kjgYw==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzLVH-00000004RXs-3EiA; Mon, 31 Mar 2025 20:13:03 +0000 From: "Matthew Wilcox (Oracle)" To: Jaegeuk Kim , Chao Yu Date: Mon, 31 Mar 2025 21:10:39 +0100 Message-ID: <20250331201256.1057782-20-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250331201256.1057782-1-willy@infradead.org> References: <20250331201256.1057782-1-willy@infradead.org> MIME-Version: 1.0 X-Headers-End: 1tzLVO-0003YR-5o Subject: [f2fs-dev] [PATCH 019/153] f2fs: Use a folio in f2fs_ra_meta_pages_cond() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Matthew Wilcox \(Oracle\)" , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Remove a call to find_get_page(). Saves two hidden calls to compound_head(). Change f2fs_folio_put() to check for IS_ERR_OR_NULL to handle the case where we got an error pointer back from filemap_get_folio(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/checkpoint.c | 8 ++++---- fs/f2fs/f2fs.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 1a5fbecd9356..30e68de82f73 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -325,16 +325,16 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages, void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index, unsigned int ra_blocks) { - struct page *page; + struct folio *folio; bool readahead = false; if (ra_blocks == RECOVERY_MIN_RA_BLOCKS) return; - page = find_get_page(META_MAPPING(sbi), index); - if (!page || !PageUptodate(page)) + folio = filemap_get_folio(META_MAPPING(sbi), index); + if (IS_ERR(folio) || !folio_test_uptodate(folio)) readahead = true; - f2fs_put_page(page, 0); + f2fs_folio_put(folio, 0); if (readahead) f2fs_ra_meta_pages(sbi, index, ra_blocks, META_POR, true); diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 3d2be01f9363..f05185ed1c75 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2871,7 +2871,7 @@ static inline struct page *f2fs_pagecache_get_page( static inline void f2fs_folio_put(struct folio *folio, bool unlock) { - if (!folio) + if (IS_ERR_OR_NULL(folio)) return; if (unlock) { -- 2.47.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel