sysfs: add sysfs_dirent->s_name

Add s_name to sysfs_dirent.  This is to further reduce dependency to
the associated dentry.  Name is copied for directories and symlinks
but not for attributes.

Where possible, name dereferences are converted to use sd->s_name.
sysfs_symlink->link_name and sysfs_get_name() are unused now and
removed.

This change allows symlink to be implemented using sysfs_dirent tree
proper, which is the last remaining dentry-dependent sysfs walk.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Tejun Heo
2007-06-14 03:45:15 +09:00
committed by Greg Kroah-Hartman
parent 13b3086d2e
commit 0c096b507f
6 changed files with 52 additions and 68 deletions
+1 -1
View File
@@ -454,7 +454,7 @@ int sysfs_add_file(struct dentry * dir, const struct attribute * attr, int type)
goto out_unlock;
}
sd = sysfs_new_dirent((void *)attr, mode, type);
sd = sysfs_new_dirent(attr->name, (void *)attr, mode, type);
if (!sd) {
error = -ENOMEM;
goto out_unlock;