diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-28 20:54:39 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-30 03:09:27 +0100 |
commit | 061447a496b915f1dc8f8c645c6825f856d2bbac (patch) | |
tree | ce67f6c0ed84ab95594ae3b50fe409e80ca336cf /fs/sysfs/dir.c | |
parent | sysfs, kernfs: no need to kern_mount() sysfs from sysfs_init() (diff) | |
download | linux-061447a496b915f1dc8f8c645c6825f856d2bbac.tar.xz linux-061447a496b915f1dc8f8c645c6825f856d2bbac.zip |
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>
Diffstat (limited to 'fs/sysfs/dir.c')
-rw-r--r-- | fs/sysfs/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index e5c4e7118050..2fea501889e7 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -68,7 +68,7 @@ int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) if (kobj->parent) parent_sd = kobj->parent->sd; else - parent_sd = &sysfs_root; + parent_sd = sysfs_root_sd; if (!parent_sd) return -ENOENT; @@ -134,7 +134,7 @@ int sysfs_move_dir_ns(struct kobject *kobj, struct kobject *new_parent_kobj, BUG_ON(!sd->s_parent); new_parent_sd = new_parent_kobj && new_parent_kobj->sd ? - new_parent_kobj->sd : &sysfs_root; + new_parent_kobj->sd : sysfs_root_sd; return kernfs_rename_ns(sd, new_parent_sd, sd->s_name, new_ns); } |