diff mbox series

[f2fs-dev,066/153] f2fs: Convert read_node_page() to read_node_folio()

Message ID 20250331201256.1057782-67-willy@infradead.org (mailing list archive)
State New
Headers show
Series f2fs folio conversions for 6.16 | expand

Commit Message

Matthew Wilcox (Oracle) March 31, 2025, 8:11 p.m. UTC
Both callers now have a folio, so pass it in and remove the
conversion back to a folio.  Removes two calls to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/f2fs/node.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 083863557414..f1f0d5159f2d 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1385,26 +1385,25 @@  struct folio *f2fs_new_node_folio(struct dnode_of_data *dn, unsigned int ofs)
 
 /*
  * Caller should do after getting the following values.
- * 0: f2fs_put_page(page, 0)
- * LOCKED_PAGE or error: f2fs_put_page(page, 1)
+ * 0: f2fs_folio_put(folio, false)
+ * LOCKED_PAGE or error: f2fs_folio_put(folio, true)
  */
-static int read_node_page(struct page *page, blk_opf_t op_flags)
+static int read_node_folio(struct folio *folio, blk_opf_t op_flags)
 {
-	struct folio *folio = page_folio(page);
-	struct f2fs_sb_info *sbi = F2FS_P_SB(page);
+	struct f2fs_sb_info *sbi = F2FS_F_SB(folio);
 	struct node_info ni;
 	struct f2fs_io_info fio = {
 		.sbi = sbi,
 		.type = NODE,
 		.op = REQ_OP_READ,
 		.op_flags = op_flags,
-		.page = page,
+		.page = &folio->page,
 		.encrypted_page = NULL,
 	};
 	int err;
 
 	if (folio_test_uptodate(folio)) {
-		if (!f2fs_inode_chksum_verify(sbi, page)) {
+		if (!f2fs_inode_chksum_verify(sbi, &folio->page)) {
 			folio_clear_uptodate(folio);
 			return -EFSBADCRC;
 		}
@@ -1452,7 +1451,7 @@  void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
 	if (IS_ERR(afolio))
 		return;
 
-	err = read_node_page(&afolio->page, REQ_RAHEAD);
+	err = read_node_folio(afolio, REQ_RAHEAD);
 	f2fs_folio_put(afolio, err ? true : false);
 }
 
@@ -1495,7 +1494,7 @@  static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,
 	if (IS_ERR(folio))
 		return folio;
 
-	err = read_node_page(&folio->page, 0);
+	err = read_node_folio(folio, 0);
 	if (err < 0) {
 		goto out_put_err;
 	} else if (err == LOCKED_PAGE) {
@@ -1529,7 +1528,7 @@  static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,
 out_err:
 	folio_clear_uptodate(folio);
 out_put_err:
-	/* ENOENT comes from read_node_page which is not an error. */
+	/* ENOENT comes from read_node_folio which is not an error. */
 	if (err != -ENOENT)
 		f2fs_handle_page_eio(sbi, folio, NODE);
 	f2fs_folio_put(folio, true);