]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
configfs_do_depend_item(): pass configfs_dirent instead of dentry
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 12 May 2026 05:25:48 +0000 (01:25 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Jun 2026 18:53:09 +0000 (14:53 -0400)
Again, the only thing it uses the argument for is its ->d_fsdata
and callers already have that - as the matter of fact, they are
passing ->s_dentry of that configfs_dirent, so that the function
could get it back as ->d_fsdata of that.  With nothing else in
dentry even looked at...

configfs_dirent in question is a directory one - in this case those
are subdirectories of root (aka roots of "subsystem" trees).

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/configfs/dir.c

index a6b99bcbddbc13929af9dbaa8724e731b911eeac..c6055a626bef57d1ba79e710019bcb5b128ad3d4 100644 (file)
@@ -1119,7 +1119,7 @@ out:
        return ret;
 }
 
-static int configfs_do_depend_item(struct dentry *subsys_dentry,
+static int configfs_do_depend_item(struct configfs_dirent *subsys_sd,
                                   struct config_item *target)
 {
        struct configfs_dirent *p;
@@ -1127,7 +1127,7 @@ static int configfs_do_depend_item(struct dentry *subsys_dentry,
 
        spin_lock(&configfs_dirent_lock);
        /* Scan the tree, return 0 if found */
-       ret = configfs_depend_prep(subsys_dentry->d_fsdata, target);
+       ret = configfs_depend_prep(subsys_sd, target);
        if (ret)
                goto out_unlock_dirent_lock;
 
@@ -1195,7 +1195,7 @@ int configfs_depend_item(struct configfs_subsystem *subsys,
        }
 
        /* Ok, now we can trust subsys/s_item */
-       ret = configfs_do_depend_item(subsys_sd->s_dentry, target);
+       ret = configfs_do_depend_item(subsys_sd, target);
 
 out_unlock_fs:
        inode_unlock(d_inode(root));
@@ -1297,7 +1297,7 @@ int configfs_depend_item_unlocked(struct configfs_subsystem *caller_subsys,
        }
 
        /* Now we can execute core of depend item */
-       ret = configfs_do_depend_item(subsys_sd->s_dentry, target);
+       ret = configfs_do_depend_item(subsys_sd, target);
 
        if (target_subsys != caller_subsys)
 out_root_unlock: