sysfs, kernfs: introduce sysfs_root_sd
Currently, it's assumed that there's a single kernfs hierarchy in the
system anchored at sysfs_root which is defined as a global struct. To
allow other users of kernfs, this will be made dynamic. Introduce a
new global variable sysfs_root_sd which points to &sysfs_root and
convert all &sysfs_root users.
This patch doesn't introduce any behavior difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 6797c9c..62f0e01 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -70,7 +70,7 @@
struct sysfs_dirent *parent_sd = NULL;
if (!kobj)
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
else
parent_sd = kobj->sd;
@@ -144,7 +144,7 @@
struct sysfs_dirent *parent_sd = NULL;
if (!kobj)
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
else
parent_sd = kobj->sd;
@@ -170,7 +170,7 @@
int result;
if (!kobj)
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
else
parent_sd = kobj->sd;