aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-14 04:27:22 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 16:09:08 -0700
commit608e266a2d4e62c1b98c1c573064b6afe8c06a58 (patch)
tree73d670ab6c315b42273bc9d2731ec2b8e7c199af /fs/sysfs/inode.c
parentsysfs: implement sysfs_find_dirent() and sysfs_get_dirent() (diff)
downloadlinux-dev-608e266a2d4e62c1b98c1c573064b6afe8c06a58.tar.xz
linux-dev-608e266a2d4e62c1b98c1c573064b6afe8c06a58.zip
sysfs: make kobj point to sysfs_dirent instead of dentry
As kobj sysfs dentries and inodes are gonna be made reclaimable, dentry can't be used as naming token for sysfs file/directory, replace kobj->dentry with kobj->sd. The only external interface change is shadow directory handling. All other changes are contained in kobj and sysfs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index e2f6ef138d20..1be853706e99 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -275,22 +275,23 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd)
}
}
-int sysfs_hash_and_remove(struct dentry * dir, const char * name)
+int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name)
{
+ struct dentry *dir;
struct sysfs_dirent **pos, *sd;
- struct sysfs_dirent *parent_sd;
int found = 0;
- if (!dir)
+ if (!dir_sd)
return -ENOENT;
+ dir = dir_sd->s_dentry;
+
if (dir->d_inode == NULL)
/* no inode means this hasn't been made visible yet */
return -ENOENT;
- parent_sd = dir->d_fsdata;
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
- for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) {
+ for (pos = &dir_sd->s_children; *pos; pos = &(*pos)->s_sibling) {
sd = *pos;
if (!sysfs_type(sd))