diff options
Diffstat (limited to 'kernel/pid.c')
-rw-r--r-- | kernel/pid.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index 25807e1b98dd..5319b9f2fc5e 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -59,6 +59,9 @@ static inline int mk_pid(struct pid_namespace *pid_ns, | |||
59 | * the scheme scales to up to 4 million PIDs, runtime. | 59 | * the scheme scales to up to 4 million PIDs, runtime. |
60 | */ | 60 | */ |
61 | struct pid_namespace init_pid_ns = { | 61 | struct pid_namespace init_pid_ns = { |
62 | .kref = { | ||
63 | .refcount = ATOMIC_INIT(2), | ||
64 | }, | ||
62 | .pidmap = { | 65 | .pidmap = { |
63 | [ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL } | 66 | [ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL } |
64 | }, | 67 | }, |
@@ -356,6 +359,26 @@ struct pid *find_ge_pid(int nr) | |||
356 | } | 359 | } |
357 | EXPORT_SYMBOL_GPL(find_get_pid); | 360 | EXPORT_SYMBOL_GPL(find_get_pid); |
358 | 361 | ||
362 | int copy_pid_ns(int flags, struct task_struct *tsk) | ||
363 | { | ||
364 | struct pid_namespace *old_ns = tsk->nsproxy->pid_ns; | ||
365 | int err = 0; | ||
366 | |||
367 | if (!old_ns) | ||
368 | return 0; | ||
369 | |||
370 | get_pid_ns(old_ns); | ||
371 | return err; | ||
372 | } | ||
373 | |||
374 | void free_pid_ns(struct kref *kref) | ||
375 | { | ||
376 | struct pid_namespace *ns; | ||
377 | |||
378 | ns = container_of(kref, struct pid_namespace, kref); | ||
379 | kfree(ns); | ||
380 | } | ||
381 | |||
359 | /* | 382 | /* |
360 | * The pid hash table is scaled according to the amount of memory in the | 383 | * The pid hash table is scaled according to the amount of memory in the |
361 | * machine. From a minimum of 16 slots up to 4096 slots at one gigabyte or | 384 | * machine. From a minimum of 16 slots up to 4096 slots at one gigabyte or |