configfs_do_depend_item(): pass configfs_dirent instead of dentry

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>
This commit is contained in:
Al Viro 2026-05-12 01:25:48 -04:00
parent 764682e011
commit cbd6bbd487

View File

@ -1119,7 +1119,7 @@ static int configfs_depend_prep(struct configfs_dirent *sd,
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: