From: Al Viro Date: Tue, 12 May 2026 05:25:48 +0000 (-0400) Subject: configfs_do_depend_item(): pass configfs_dirent instead of dentry X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=cbd6bbd48732987de51e8a6d4917875daa636079;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Al Viro --- diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index a6b99bcbddbc..c6055a626bef 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -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: