summaryrefslogtreecommitdiff
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-03-31 21:12:27 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2025-04-28 15:26:44 +0000
commit0bd84d2d8912e83c4c6771ca12c647f4e37419cd (patch)
treeaeddea787b3ec1ddefb4bc9591cad5ea4d3d995b /fs/f2fs/dir.c
parentc190a13d71e7d9c3ccad1d17e00285888857b974 (diff)
f2fs: Pass a folio to f2fs_find_entry()
Convert all callers to pass in a pointer to a folio instead of a page. Also convert f2fs_inode_by_name() to take a folio pointer. Removes six calls 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>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 9f2700905b3b..a70cff0e22c5 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -385,24 +385,22 @@ out:
* Entry is guaranteed to be valid.
*/
struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
- const struct qstr *child, struct page **res_page)
+ const struct qstr *child, struct folio **res_folio)
{
struct f2fs_dir_entry *de = NULL;
struct f2fs_filename fname;
- struct folio *rfolio;
int err;
err = f2fs_setup_filename(dir, child, 1, &fname);
if (err) {
if (err == -ENOENT)
- *res_page = NULL;
+ *res_folio = NULL;
else
- *res_page = ERR_PTR(err);
+ *res_folio = ERR_PTR(err);
return NULL;
}
- de = __f2fs_find_entry(dir, &fname, &rfolio);
- *res_page = &rfolio->page;
+ de = __f2fs_find_entry(dir, &fname, res_folio);
f2fs_free_filename(&fname);
return de;
@@ -410,19 +408,22 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p)
{
- return f2fs_find_entry(dir, &dotdot_name, p);
+ struct folio *folio;
+ struct f2fs_dir_entry *r = f2fs_find_entry(dir, &dotdot_name, &folio);
+ *p = &folio->page;
+ return r;
}
ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr,
- struct page **page)
+ struct folio **folio)
{
ino_t res = 0;
struct f2fs_dir_entry *de;
- de = f2fs_find_entry(dir, qstr, page);
+ de = f2fs_find_entry(dir, qstr, folio);
if (de) {
res = le32_to_cpu(de->ino);
- f2fs_put_page(*page, 0);
+ f2fs_folio_put(*folio, false);
}
return res;