Commit 200918b3 authored by Jan Kara's avatar Jan Kara

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: default avatarJan Kara <jack@suse.cz>
parent 1c80afa0
...@@ -366,25 +366,22 @@ static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry, ...@@ -366,25 +366,22 @@ static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry,
unsigned int flags) unsigned int flags)
{ {
struct inode *inode = NULL; struct inode *inode = NULL;
struct fileIdentDesc cfi; struct udf_fileident_iter iter;
struct udf_fileident_bh fibh; int err;
struct fileIdentDesc *fi;
if (dentry->d_name.len > UDF_NAME_LEN) if (dentry->d_name.len > UDF_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG); return ERR_PTR(-ENAMETOOLONG);
fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); err = udf_fiiter_find_entry(dir, &dentry->d_name, &iter);
if (IS_ERR(fi)) if (err < 0 && err != -ENOENT)
return ERR_CAST(fi); return ERR_PTR(err);
if (fi) { if (err == 0) {
struct kernel_lb_addr loc; struct kernel_lb_addr loc;
if (fibh.sbh != fibh.ebh) loc = lelb_to_cpu(iter.fi.icb.extLocation);
brelse(fibh.ebh); udf_fiiter_release(&iter);
brelse(fibh.sbh);
loc = lelb_to_cpu(cfi.icb.extLocation);
inode = udf_iget(dir->i_sb, &loc); inode = udf_iget(dir->i_sb, &loc);
if (IS_ERR(inode)) if (IS_ERR(inode))
return ERR_CAST(inode); return ERR_CAST(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment