|
@@ -32,7 +32,7 @@ static const struct super_operations sysfs_ops = {
|
|
.evict_inode = sysfs_evict_inode,
|
|
.evict_inode = sysfs_evict_inode,
|
|
};
|
|
};
|
|
|
|
|
|
-struct sysfs_dirent sysfs_root = {
|
|
|
|
|
|
+static struct sysfs_dirent sysfs_root = {
|
|
.s_name = "",
|
|
.s_name = "",
|
|
.s_count = ATOMIC_INIT(1),
|
|
.s_count = ATOMIC_INIT(1),
|
|
.s_flags = SYSFS_DIR,
|
|
.s_flags = SYSFS_DIR,
|
|
@@ -40,6 +40,8 @@ struct sysfs_dirent sysfs_root = {
|
|
.s_ino = 1,
|
|
.s_ino = 1,
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+struct sysfs_dirent *sysfs_root_sd = &sysfs_root;
|
|
|
|
+
|
|
static int sysfs_fill_super(struct super_block *sb)
|
|
static int sysfs_fill_super(struct super_block *sb)
|
|
{
|
|
{
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
@@ -53,7 +55,7 @@ static int sysfs_fill_super(struct super_block *sb)
|
|
|
|
|
|
/* get root inode, initialize and unlock it */
|
|
/* get root inode, initialize and unlock it */
|
|
mutex_lock(&sysfs_mutex);
|
|
mutex_lock(&sysfs_mutex);
|
|
- inode = sysfs_get_inode(sb, &sysfs_root);
|
|
|
|
|
|
+ inode = sysfs_get_inode(sb, sysfs_root_sd);
|
|
mutex_unlock(&sysfs_mutex);
|
|
mutex_unlock(&sysfs_mutex);
|
|
if (!inode) {
|
|
if (!inode) {
|
|
pr_debug("sysfs: could not get root inode\n");
|
|
pr_debug("sysfs: could not get root inode\n");
|
|
@@ -66,7 +68,7 @@ static int sysfs_fill_super(struct super_block *sb)
|
|
pr_debug("%s: could not get root dentry!\n", __func__);
|
|
pr_debug("%s: could not get root dentry!\n", __func__);
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
- root->d_fsdata = &sysfs_root;
|
|
|
|
|
|
+ root->d_fsdata = sysfs_root_sd;
|
|
sb->s_root = root;
|
|
sb->s_root = root;
|
|
sb->s_d_op = &sysfs_dentry_ops;
|
|
sb->s_d_op = &sysfs_dentry_ops;
|
|
return 0;
|
|
return 0;
|