uml: tidy fault code
[firefly-linux-kernel-4.4.55.git] / kernel / pid.c
index 5319b9f2fc5e6ee57b17316e9cc5e2e6056c6074..9c80bc23d6b8551c41fffffe1fb92e1711ce3547 100644 (file)
@@ -65,7 +65,8 @@ struct pid_namespace init_pid_ns = {
        .pidmap = {
                [ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL }
        },
-       .last_pid = 0
+       .last_pid = 0,
+       .child_reaper = &init_task
 };
 
 /*
@@ -210,7 +211,7 @@ struct pid *alloc_pid(void)
        if (!pid)
                goto out;
 
-       nr = alloc_pidmap(&init_pid_ns);
+       nr = alloc_pidmap(current->nsproxy->pid_ns);
        if (nr < 0)
                goto out_free;
 
@@ -352,7 +353,7 @@ struct pid *find_ge_pid(int nr)
                pid = find_pid(nr);
                if (pid)
                        break;
-               nr = next_pidmap(&init_pid_ns, nr);
+               nr = next_pidmap(current->nsproxy->pid_ns, nr);
        } while (nr > 0);
 
        return pid;
@@ -411,7 +412,5 @@ void __init pidmap_init(void)
        set_bit(0, init_pid_ns.pidmap[0].page);
        atomic_dec(&init_pid_ns.pidmap[0].nr_free);
 
-       pid_cachep = kmem_cache_create("pid", sizeof(struct pid),
-                                       __alignof__(struct pid),
-                                       SLAB_PANIC, NULL, NULL);
+       pid_cachep = KMEM_CACHE(pid, SLAB_PANIC);
 }