]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: Use a folio in f2fs_ra_node_page()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:11:25 +0000 (21:11 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:35 +0000 (15:26 +0000)
Save a call to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index 4ebbce183c5bfbe1788939b8ef54e17ac3038e47..0a885bf6f4292e24b2617e069d293e12ed8ee641 100644 (file)
@@ -1436,7 +1436,7 @@ static int read_node_page(struct page *page, blk_opf_t op_flags)
  */
 void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
 {
-       struct page *apage;
+       struct folio *afolio;
        int err;
 
        if (!nid)
@@ -1444,16 +1444,16 @@ void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
        if (f2fs_check_nid_range(sbi, nid))
                return;
 
-       apage = xa_load(&NODE_MAPPING(sbi)->i_pages, nid);
-       if (apage)
+       afolio = xa_load(&NODE_MAPPING(sbi)->i_pages, nid);
+       if (afolio)
                return;
 
-       apage = f2fs_grab_cache_page(NODE_MAPPING(sbi), nid, false);
-       if (!apage)
+       afolio = f2fs_grab_cache_folio(NODE_MAPPING(sbi), nid, false);
+       if (IS_ERR(afolio))
                return;
 
-       err = read_node_page(apage, REQ_RAHEAD);
-       f2fs_put_page(apage, err ? 1 : 0);
+       err = read_node_page(&afolio->page, REQ_RAHEAD);
+       f2fs_folio_put(afolio, err ? true : false);
 }
 
 static int sanity_check_node_footer(struct f2fs_sb_info *sbi,