summaryrefslogtreecommitdiffstats
path: root/fs/ufs/dir.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-07-08 15:11:00 -0400
committerChristian Brauner <brauner@kernel.org>2024-08-07 11:31:51 +0200
commite95d2754458a6a0a1c8a5dc1d593d80f6940fbdc (patch)
treee7d0d3c25139214c8159d43818db8a5c4b81cb45 /fs/ufs/dir.c
parenta60b0e8f150ff5e9fefaf9166b75381f162da45d (diff)
downloadlinux-e95d2754458a6a0a1c8a5dc1d593d80f6940fbdc.tar.gz
linux-e95d2754458a6a0a1c8a5dc1d593d80f6940fbdc.tar.bz2
linux-e95d2754458a6a0a1c8a5dc1d593d80f6940fbdc.zip
ufs: Convert ufs_find_entry() to take a folio
This matches ext2 and pushes the use of folios out by one layer. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/ufs/dir.c')
-rw-r--r--fs/ufs/dir.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 287cab597cc1..fb56a00b622c 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -76,12 +76,12 @@ ino_t ufs_inode_by_name(struct inode *dir, const struct qstr *qstr)
{
ino_t res = 0;
struct ufs_dir_entry *de;
- struct page *page;
+ struct folio *folio;
- de = ufs_find_entry(dir, qstr, &page);
+ de = ufs_find_entry(dir, qstr, &folio);
if (de) {
res = fs32_to_cpu(dir->i_sb, de->d_ino);
- ufs_put_page(page);
+ ufs_put_page(&folio->page);
}
return res;
}
@@ -255,7 +255,7 @@ struct ufs_dir_entry *ufs_dotdot(struct inode *dir, struct page **p)
* Entry is guaranteed to be valid.
*/
struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr,
- struct page **res_page)
+ struct folio **foliop)
{
struct super_block *sb = dir->i_sb;
const unsigned char *name = qstr->name;
@@ -263,7 +263,6 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr,
unsigned reclen = UFS_DIR_REC_LEN(namelen);
unsigned long start, n;
unsigned long npages = dir_pages(dir);
- struct folio *folio;
struct ufs_inode_info *ui = UFS_I(dir);
struct ufs_dir_entry *de;
@@ -272,16 +271,13 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr,
if (npages == 0 || namelen > UFS_MAXNAMLEN)
goto out;
- /* OFFSET_CACHE */
- *res_page = NULL;
-
start = ui->i_dir_start_lookup;
if (start >= npages)
start = 0;
n = start;
do {
- char *kaddr = ufs_get_folio(dir, n, &folio);
+ char *kaddr = ufs_get_folio(dir, n, foliop);
if (!IS_ERR(kaddr)) {
de = (struct ufs_dir_entry *)kaddr;
@@ -291,7 +287,7 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr,
goto found;
de = ufs_next_entry(sb, de);
}
- ufs_put_page(&folio->page);
+ ufs_put_page(&(*foliop)->page);
}
if (++n >= npages)
n = 0;
@@ -300,7 +296,6 @@ out:
return NULL;
found:
- *res_page = &folio->page;
ui->i_dir_start_lookup = n;
return de;
}