diff --git a/fs/namespace.c b/fs/namespace.c index e272c2403014ffd9c3e6577b4e3e0e551c4637af..e6990f3d526d8e8eb7bf592f55b23cd36bc5d795 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "pnode.h" #include "internal.h" @@ -3740,6 +3741,7 @@ void __init mnt_init(void) fs_kobj = kobject_create_and_add("fs", NULL); if (!fs_kobj) printk(KERN_WARNING "%s: kobj create error\n", __func__); + shmem_init(); init_rootfs(); init_mount_tree(); } diff --git a/include/linux/init.h b/include/linux/init.h index cbe93521397e7cea6ff1558479d0193cdd6aa213..212fc9e2f691a17c48262248e404159ba1f2b94e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -148,7 +148,7 @@ extern unsigned int reset_devices; /* used by init/main.c */ void setup_arch(char **); void prepare_namespace(void); -int __init init_rootfs(void); +void __init init_rootfs(void); extern struct file_system_type rootfs_fs_type; #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX) diff --git a/init/do_mounts.c b/init/do_mounts.c index e7f0b0f18cce35af3994314e36b69803cd08665a..864c032e995de460cabcda6c555884db99f2fd94 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -643,14 +643,9 @@ struct file_system_type rootfs_fs_type = { .kill_sb = kill_litter_super, }; -int __init init_rootfs(void) +void __init init_rootfs(void) { - int err = 0; - if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && - (!root_fs_names || strstr(root_fs_names, "tmpfs"))) { - err = shmem_init(); + (!root_fs_names || strstr(root_fs_names, "tmpfs"))) is_tmpfs = true; - } - return err; } diff --git a/init/main.c b/init/main.c index 5a2c69b4d7b3ac040f45eb0b2922bfcd7d2ab832..4dbc7243557ef18656904a027c691aab07bfc1bd 100644 --- a/init/main.c +++ b/init/main.c @@ -1000,7 +1000,6 @@ static void __init do_initcalls(void) static void __init do_basic_setup(void) { cpuset_init_smp(); - shmem_init(); driver_init(); init_irq_proc(); do_ctors(); diff --git a/mm/shmem.c b/mm/shmem.c index 1bb3b8dc8bb2113a8232153d3ba9fc5e8c453471..1f67ec9e2062ac88fb5ce4ebe4ae698f64cfc080 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3775,10 +3775,6 @@ int __init shmem_init(void) { int error; - /* If rootfs called this, don't re-init */ - if (shmem_inode_cachep) - return 0; - shmem_init_inodecache(); error = register_filesystem(&shmem_fs_type);