if (kobj->parent)
parent_sd = kobj->parent->sd;
else
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
if (!parent_sd)
return -ENOENT;
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);
}
.evict_inode = sysfs_evict_inode,
};
-struct sysfs_dirent sysfs_root = {
+static struct sysfs_dirent sysfs_root = {
.s_name = "",
.s_count = ATOMIC_INIT(1),
.s_flags = SYSFS_DIR,
.s_ino = 1,
};
+struct sysfs_dirent *sysfs_root_sd = &sysfs_root;
+
static int sysfs_fill_super(struct super_block *sb)
{
struct inode *inode;
/* get root inode, initialize and unlock it */
mutex_lock(&sysfs_mutex);
- inode = sysfs_get_inode(sb, &sysfs_root);
+ inode = sysfs_get_inode(sb, sysfs_root_sd);
mutex_unlock(&sysfs_mutex);
if (!inode) {
pr_debug("sysfs: could not get root inode\n");
pr_debug("%s: could not get root dentry!\n", __func__);
return -ENOMEM;
}
- root->d_fsdata = &sysfs_root;
+ root->d_fsdata = sysfs_root_sd;
sb->s_root = root;
sb->s_d_op = &sysfs_dentry_ops;
return 0;
struct sysfs_dirent *parent_sd = NULL;
if (!kobj)
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
else
parent_sd = kobj->sd;
struct sysfs_dirent *parent_sd = NULL;
if (!kobj)
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
else
parent_sd = kobj->sd;
int result;
if (!kobj)
- parent_sd = &sysfs_root;
+ parent_sd = sysfs_root_sd;
else
parent_sd = kobj->sd;
const void *ns;
};
#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
-extern struct sysfs_dirent sysfs_root;
+extern struct sysfs_dirent *sysfs_root_sd;
extern struct kmem_cache *sysfs_dir_cachep;
/*