diff options
author | Jan Kara <jack@suse.cz> | 2022-10-05 18:36:21 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2023-01-09 10:39:51 +0100 |
commit | 200918b34d158cdaee531db7e0c80b92c57e66f1 (patch) | |
tree | 535c54d640f8d7244a6253d92751e1541fa972b1 /fs/udf | |
parent | 1c80afa04db39c98aebea9aabfafa37a208cdfee (diff) |
udf: Convert udf_lookup() to use new directory iteration code
Convert udf_lookup() to use udf_fiiter_find_entry() for looking up
directory entries.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/namei.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 145883d15c0f..efc75cf5722d 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -366,25 +366,22 @@ static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) { struct inode *inode = NULL; - struct fileIdentDesc cfi; - struct udf_fileident_bh fibh; - struct fileIdentDesc *fi; + struct udf_fileident_iter iter; + int err; if (dentry->d_name.len > UDF_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); - fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); - if (IS_ERR(fi)) - return ERR_CAST(fi); + err = udf_fiiter_find_entry(dir, &dentry->d_name, &iter); + if (err < 0 && err != -ENOENT) + return ERR_PTR(err); - if (fi) { + if (err == 0) { struct kernel_lb_addr loc; - if (fibh.sbh != fibh.ebh) - brelse(fibh.ebh); - brelse(fibh.sbh); + loc = lelb_to_cpu(iter.fi.icb.extLocation); + udf_fiiter_release(&iter); - loc = lelb_to_cpu(cfi.icb.extLocation); inode = udf_iget(dir->i_sb, &loc); if (IS_ERR(inode)) return ERR_CAST(inode); |