diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2026-05-12 01:17:13 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2026-06-08 14:53:09 -0400 |
| commit | 96551d7f9f7b59c87da1a6d1b072ab9219a2263e (patch) | |
| tree | 5ee7d548c85f37ebdd976ec9892b6441ffec43ea | |
| parent | 5cefe23f63742881229ea80a55b5f9e5021966bc (diff) | |
| download | linux-stable-96551d7f9f7b59c87da1a6d1b072ab9219a2263e.tar.gz linux-stable-96551d7f9f7b59c87da1a6d1b072ab9219a2263e.zip | |
configfs_detach_prep(): pass configfs_dirent instead of dentry
The only thing it uses the argument for is its ->d_fsdata and
all callers have that already available.
Note that in the recursive call we are dealing with a (sub)directory
configfs_dirent, and for those ->s_dentry->d_fsdata points back
to configfs_dirent itself.
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| -rw-r--r-- | fs/configfs/dir.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 8181771c8a58..b456e4de25ab 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -517,9 +517,8 @@ done: * If there is an error, the caller will reset the flags via * configfs_detach_rollback(). */ -static int configfs_detach_prep(struct dentry *dentry, struct dentry **wait) +static int configfs_detach_prep(struct configfs_dirent *parent_sd, struct dentry **wait) { - struct configfs_dirent *parent_sd = dentry->d_fsdata; struct configfs_dirent *sd; int ret; @@ -547,7 +546,7 @@ static int configfs_detach_prep(struct dentry *dentry, struct dentry **wait) * Yup, recursive. If there's a problem, blame * deep nesting of default_groups */ - ret = configfs_detach_prep(sd->s_dentry, wait); + ret = configfs_detach_prep(sd, wait); if (!ret) continue; } else @@ -1540,7 +1539,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry) */ ret = sd->s_dependent_count ? -EBUSY : 0; if (!ret) { - ret = configfs_detach_prep(dentry, &wait); + ret = configfs_detach_prep(sd, &wait); if (ret) configfs_detach_rollback(dentry); } @@ -1837,7 +1836,7 @@ void configfs_unregister_group(struct config_group *group) inode_lock_nested(d_inode(parent), I_MUTEX_PARENT); spin_lock(&configfs_dirent_lock); - configfs_detach_prep(dentry, NULL); + configfs_detach_prep(sd, NULL); spin_unlock(&configfs_dirent_lock); configfs_detach_group(&group->cg_item); @@ -1984,7 +1983,7 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys) inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); mutex_lock(&configfs_symlink_mutex); spin_lock(&configfs_dirent_lock); - if (configfs_detach_prep(dentry, NULL)) { + if (configfs_detach_prep(sd, NULL)) { pr_err("Tried to unregister non-empty subsystem!\n"); } spin_unlock(&configfs_dirent_lock); |
