]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
udf: Convert udf_get_parent() to new directory iteration code
authorJan Kara <jack@suse.cz>
Thu, 17 Oct 2024 20:19:51 +0000 (17:19 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Oct 2024 13:40:38 +0000 (15:40 +0200)
[ Upstream commit 9b06fbef4202363d74bba5459ddd231db6d3b1af ]

Convert udf_get_parent() to use udf_fiiter_find_entry().

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/namei.c

index 02fa9482e9cea2069d6c6a480a5e1591ee635b5b..bc847e709fe66f0c12303dacf46ac85ae9ff2f8b 100644 (file)
@@ -1368,17 +1368,15 @@ static struct dentry *udf_get_parent(struct dentry *child)
 {
        struct kernel_lb_addr tloc;
        struct inode *inode = NULL;
-       struct fileIdentDesc cfi;
-       struct udf_fileident_bh fibh;
-
-       if (!udf_find_entry(d_inode(child), &dotdot_name, &fibh, &cfi))
-               return ERR_PTR(-EACCES);
+       struct udf_fileident_iter iter;
+       int err;
 
-       if (fibh.sbh != fibh.ebh)
-               brelse(fibh.ebh);
-       brelse(fibh.sbh);
+       err = udf_fiiter_find_entry(d_inode(child), &dotdot_name, &iter);
+       if (err)
+               return ERR_PTR(err);
 
-       tloc = lelb_to_cpu(cfi.icb.extLocation);
+       tloc = lelb_to_cpu(iter.fi.icb.extLocation);
+       udf_fiiter_release(&iter);
        inode = udf_iget(child->d_sb, &tloc);
        if (IS_ERR(inode))
                return ERR_CAST(inode);