diff options
-rw-r--r-- | fs/namespace.c | 2 | ||||
-rw-r--r-- | include/linux/init.h | 2 | ||||
-rw-r--r-- | init/do_mounts.c | 9 | ||||
-rw-r--r-- | init/main.c | 1 | ||||
-rw-r--r-- | mm/shmem.c | 4 |
5 files changed, 5 insertions, 13 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index e272c2403014..e6990f3d526d 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/sched/task.h> | 29 | #include <linux/sched/task.h> |
30 | #include <uapi/linux/mount.h> | 30 | #include <uapi/linux/mount.h> |
31 | #include <linux/fs_context.h> | 31 | #include <linux/fs_context.h> |
32 | #include <linux/shmem_fs.h> | ||
32 | 33 | ||
33 | #include "pnode.h" | 34 | #include "pnode.h" |
34 | #include "internal.h" | 35 | #include "internal.h" |
@@ -3740,6 +3741,7 @@ void __init mnt_init(void) | |||
3740 | fs_kobj = kobject_create_and_add("fs", NULL); | 3741 | fs_kobj = kobject_create_and_add("fs", NULL); |
3741 | if (!fs_kobj) | 3742 | if (!fs_kobj) |
3742 | printk(KERN_WARNING "%s: kobj create error\n", __func__); | 3743 | printk(KERN_WARNING "%s: kobj create error\n", __func__); |
3744 | shmem_init(); | ||
3743 | init_rootfs(); | 3745 | init_rootfs(); |
3744 | init_mount_tree(); | 3746 | init_mount_tree(); |
3745 | } | 3747 | } |
diff --git a/include/linux/init.h b/include/linux/init.h index cbe93521397e..212fc9e2f691 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -148,7 +148,7 @@ extern unsigned int reset_devices; | |||
148 | /* used by init/main.c */ | 148 | /* used by init/main.c */ |
149 | void setup_arch(char **); | 149 | void setup_arch(char **); |
150 | void prepare_namespace(void); | 150 | void prepare_namespace(void); |
151 | int __init init_rootfs(void); | 151 | void __init init_rootfs(void); |
152 | extern struct file_system_type rootfs_fs_type; | 152 | extern struct file_system_type rootfs_fs_type; |
153 | 153 | ||
154 | #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX) | 154 | #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX) |
diff --git a/init/do_mounts.c b/init/do_mounts.c index e7f0b0f18cce..864c032e995d 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -643,14 +643,9 @@ struct file_system_type rootfs_fs_type = { | |||
643 | .kill_sb = kill_litter_super, | 643 | .kill_sb = kill_litter_super, |
644 | }; | 644 | }; |
645 | 645 | ||
646 | int __init init_rootfs(void) | 646 | void __init init_rootfs(void) |
647 | { | 647 | { |
648 | int err = 0; | ||
649 | |||
650 | if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && | 648 | if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && |
651 | (!root_fs_names || strstr(root_fs_names, "tmpfs"))) { | 649 | (!root_fs_names || strstr(root_fs_names, "tmpfs"))) |
652 | err = shmem_init(); | ||
653 | is_tmpfs = true; | 650 | is_tmpfs = true; |
654 | } | ||
655 | return err; | ||
656 | } | 651 | } |
diff --git a/init/main.c b/init/main.c index 5a2c69b4d7b3..4dbc7243557e 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -1000,7 +1000,6 @@ static void __init do_initcalls(void) | |||
1000 | static void __init do_basic_setup(void) | 1000 | static void __init do_basic_setup(void) |
1001 | { | 1001 | { |
1002 | cpuset_init_smp(); | 1002 | cpuset_init_smp(); |
1003 | shmem_init(); | ||
1004 | driver_init(); | 1003 | driver_init(); |
1005 | init_irq_proc(); | 1004 | init_irq_proc(); |
1006 | do_ctors(); | 1005 | do_ctors(); |
diff --git a/mm/shmem.c b/mm/shmem.c index 1bb3b8dc8bb2..1f67ec9e2062 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -3775,10 +3775,6 @@ int __init shmem_init(void) | |||
3775 | { | 3775 | { |
3776 | int error; | 3776 | int error; |
3777 | 3777 | ||
3778 | /* If rootfs called this, don't re-init */ | ||
3779 | if (shmem_inode_cachep) | ||
3780 | return 0; | ||
3781 | |||
3782 | shmem_init_inodecache(); | 3778 | shmem_init_inodecache(); |
3783 | 3779 | ||
3784 | error = register_filesystem(&shmem_fs_type); | 3780 | error = register_filesystem(&shmem_fs_type); |