diff mbox series

[f2fs-dev,095/153] f2fs: Pass folios to set_new_dnode()

Message ID 20250331201256.1057782-96-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
Removes a lot of conversions of folios into pages.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/f2fs/data.c   | 8 ++++----
 fs/f2fs/f2fs.h   | 6 +++---
 fs/f2fs/file.c   | 2 +-
 fs/f2fs/inline.c | 4 ++--
 fs/f2fs/node.c   | 4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 3776c1f2ad42..b728c5dbf180 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1360,7 +1360,7 @@  struct folio *f2fs_get_new_data_folio(struct inode *inode,
 		return ERR_PTR(-ENOMEM);
 	}
 
-	set_new_dnode(&dn, inode, &ifolio->page, NULL, 0);
+	set_new_dnode(&dn, inode, ifolio, NULL, 0);
 	err = f2fs_reserve_block(&dn, index);
 	if (err) {
 		f2fs_folio_put(folio, true);
@@ -3385,7 +3385,7 @@  static int prepare_write_begin(struct f2fs_sb_info *sbi,
 		goto unlock_out;
 	}
 
-	set_new_dnode(&dn, inode, &ifolio->page, &ifolio->page, 0);
+	set_new_dnode(&dn, inode, ifolio, ifolio, 0);
 
 	if (f2fs_has_inline_data(inode)) {
 		if (pos + len <= MAX_INLINE_DATA(inode)) {
@@ -3446,7 +3446,7 @@  static int __find_data_block(struct inode *inode, pgoff_t index,
 	if (IS_ERR(ifolio))
 		return PTR_ERR(ifolio);
 
-	set_new_dnode(&dn, inode, &ifolio->page, &ifolio->page, 0);
+	set_new_dnode(&dn, inode, ifolio, ifolio, 0);
 
 	if (!f2fs_lookup_read_extent_cache_block(inode, index,
 						 &dn.data_blkaddr)) {
@@ -3477,7 +3477,7 @@  static int __reserve_data_block(struct inode *inode, pgoff_t index,
 		err = PTR_ERR(ifolio);
 		goto unlock_out;
 	}
-	set_new_dnode(&dn, inode, &ifolio->page, &ifolio->page, 0);
+	set_new_dnode(&dn, inode, ifolio, ifolio, 0);
 
 	if (!f2fs_lookup_read_extent_cache_block(dn.inode, index,
 						&dn.data_blkaddr))
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 33a6584615bc..c2d384a7aab3 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1006,12 +1006,12 @@  struct dnode_of_data {
 };
 
 static inline void set_new_dnode(struct dnode_of_data *dn, struct inode *inode,
-		struct page *ipage, struct page *npage, nid_t nid)
+		struct folio *ifolio, struct folio *nfolio, nid_t nid)
 {
 	memset(dn, 0, sizeof(*dn));
 	dn->inode = inode;
-	dn->inode_page = ipage;
-	dn->node_page = npage;
+	dn->inode_page = &ifolio->page;
+	dn->node_page = &nfolio->page;
 	dn->nid = nid;
 }
 
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index f6835c0d1ce8..66c743a09756 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -787,7 +787,7 @@  int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock)
 		goto out;
 	}
 
-	set_new_dnode(&dn, inode, &ifolio->page, NULL, 0);
+	set_new_dnode(&dn, inode, ifolio, NULL, 0);
 	err = f2fs_get_dnode_of_data(&dn, free_from, LOOKUP_NODE_RA);
 	if (err) {
 		if (err == -ENOENT)
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 1bc6a0d61f7e..7638854bc7d9 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -243,7 +243,7 @@  int f2fs_convert_inline_inode(struct inode *inode)
 		goto out;
 	}
 
-	set_new_dnode(&dn, inode, &ifolio->page, &ifolio->page, 0);
+	set_new_dnode(&dn, inode, ifolio, ifolio, 0);
 
 	if (f2fs_has_inline_data(inode))
 		err = f2fs_convert_inline_page(&dn, &folio->page);
@@ -422,7 +422,7 @@  static int f2fs_move_inline_dirents(struct inode *dir, struct folio *ifolio,
 		return PTR_ERR(folio);
 	}
 
-	set_new_dnode(&dn, dir, &ifolio->page, NULL, 0);
+	set_new_dnode(&dn, dir, ifolio, NULL, 0);
 	err = f2fs_reserve_block(&dn, 0);
 	if (err)
 		goto out;
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index d1fa244c9fa7..3c8c8c8a5508 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1156,7 +1156,7 @@  int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from)
 		return PTR_ERR(folio);
 	}
 
-	set_new_dnode(&dn, inode, &folio->page, NULL, 0);
+	set_new_dnode(&dn, inode, folio, NULL, 0);
 	folio_unlock(folio);
 
 	ri = F2FS_INODE(&folio->page);
@@ -1252,7 +1252,7 @@  int f2fs_truncate_xattr_node(struct inode *inode)
 	if (IS_ERR(nfolio))
 		return PTR_ERR(nfolio);
 
-	set_new_dnode(&dn, inode, NULL, &nfolio->page, nid);
+	set_new_dnode(&dn, inode, NULL, nfolio, nid);
 	err = truncate_node(&dn);
 	if (err) {
 		f2fs_folio_put(nfolio, true);