]> Pileus Git - ~andy/linux/blobdiff - init/main.c
s390/headers: remove #ifdef __KERNEL__ from not exported headers
[~andy/linux] / init / main.c
index 11bc6f7ed866498e04233c0ac5aee883430d2980..1ca6b32c482875cbfd90fb315831c4c110d28414 100644 (file)
@@ -225,14 +225,9 @@ static int __init loglevel(char *str)
 
 early_param("loglevel", loglevel);
 
-/*
- * Unknown boot options get handed to init, unless they look like
- * unused parameters (modprobe will find them in /proc/cmdline).
- */
-static int __init unknown_bootoption(char *param, char *val,
-                               const char *unused)
+/* Change NUL term back to "=", to make "param" the whole string. */
+static int __init repair_env_string(char *param, char *val, const char *unused)
 {
-       /* Change NUL term back to "=", to make "param" the whole string. */
        if (val) {
                /* param=val or param="val"? */
                if (val == param+strlen(param)+1)
@@ -244,6 +239,16 @@ static int __init unknown_bootoption(char *param, char *val,
                } else
                        BUG();
        }
+       return 0;
+}
+
+/*
+ * Unknown boot options get handed to init, unless they look like
+ * unused parameters (modprobe will find them in /proc/cmdline).
+ */
+static int __init unknown_bootoption(char *param, char *val, const char *unused)
+{
+       repair_env_string(param, val, unused);
 
        /* Handle obsolete-style parameters */
        if (obsolete_checksetup(param))
@@ -555,9 +560,6 @@ asmlinkage void __init start_kernel(void)
        early_boot_irqs_disabled = false;
        local_irq_enable();
 
-       /* Interrupts are enabled now so all GFP allocations are safe. */
-       gfp_allowed_mask = __GFP_BITS_MASK;
-
        kmem_cache_init_late();
 
        /*
@@ -733,12 +735,6 @@ static char *initcall_level_names[] __initdata = {
        "late",
 };
 
-static int __init ignore_unknown_bootoption(char *param, char *val,
-                                       const char *doing)
-{
-       return 0;
-}
-
 static void __init do_initcall_level(int level)
 {
        extern const struct kernel_param __start___param[], __stop___param[];
@@ -749,7 +745,7 @@ static void __init do_initcall_level(int level)
                   static_command_line, __start___param,
                   __stop___param - __start___param,
                   level, level,
-                  &ignore_unknown_bootoption);
+                  &repair_env_string);
 
        for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)
                do_one_initcall(*fn);
@@ -848,6 +844,10 @@ static int __init kernel_init(void * unused)
         * Wait until kthreadd is all set-up.
         */
        wait_for_completion(&kthreadd_done);
+
+       /* Now the scheduler is fully set up and can do blocking allocations */
+       gfp_allowed_mask = __GFP_BITS_MASK;
+
        /*
         * init can allocate pages on any node
         */