@@ -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))
@@ -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;
}
@@ -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)
@@ -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;
@@ -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);
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(-)