udf: Convert udf_lookup() to use new directory iteration code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Kara <jack@xxxxxxx>

[ Upstream commit 200918b34d158cdaee531db7e0c80b92c57e66f1 ]

Convert udf_lookup() to use udf_fiiter_find_entry() for looking up
directory entries.

Signed-off-by: Jan Kara <jack@xxxxxxx>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/udf/namei.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -366,25 +366,22 @@ static struct dentry *udf_lookup(struct
 				 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);


Patches currently in stable-queue which might be from cascardo@xxxxxxxxxx are

queue-5.15/udf-handle-error-when-expanding-directory.patch
queue-5.15/udf-convert-empty_dir-to-new-directory-iteration-code.patch
queue-5.15/udf-fix-bogus-checksum-computation-in-udf_rename.patch
queue-5.15/udf-convert-udf_expand_dir_adinicb-to-new-directory-iteration.patch
queue-5.15/udf-convert-udf_unlink-to-new-directory-iteration-code.patch
queue-5.15/udf-convert-udf_add_nondir-to-new-directory-iteration.patch
queue-5.15/udf-convert-udf_link-to-new-directory-iteration-code.patch
queue-5.15/udf-remove-old-directory-iteration-code.patch
queue-5.15/udf-don-t-return-bh-from-udf_expand_dir_adinicb.patch
queue-5.15/udf-new-directory-iteration-code.patch
queue-5.15/udf-convert-udf_rmdir-to-new-directory-iteration-code.patch
queue-5.15/udf-move-udf_expand_dir_adinicb-to-its-callsite.patch
queue-5.15/udf-convert-udf_readdir-to-new-directory-iteration.patch
queue-5.15/udf-convert-udf_mkdir-to-new-directory-iteration-code.patch
queue-5.15/udf-provide-function-to-mark-entry-as-deleted-using-new-directory-iteration-code.patch
queue-5.15/udf-convert-udf_lookup-to-use-new-directory-iteration-code.patch
queue-5.15/udf-implement-adding-of-dir-entries-using-new-iteration-code.patch
queue-5.15/udf-convert-udf_rename-to-new-directory-iteration-code.patch
queue-5.15/udf-convert-udf_get_parent-to-new-directory-iteration-code.patch
queue-5.15/udf-implement-searching-for-directory-entry-using-new-iteration-code.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux