diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-18 23:40:05 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 11:53:39 -0700 |
commit | 8ef047aaaeb811247a5639c92e2f2ae1221a28dd (patch) | |
tree | 296a61f66daa8ac42b3d77a53d06a97eb71155c9 /kernel/fork.c | |
parent | faacbfd3a6808bf87d8f353b42eceeaba2c78a47 (diff) | |
download | linux-8ef047aaaeb811247a5639c92e2f2ae1221a28dd.tar.gz linux-8ef047aaaeb811247a5639c92e2f2ae1221a28dd.tar.bz2 linux-8ef047aaaeb811247a5639c92e2f2ae1221a28dd.zip |
pid namespaces: make alloc_pid(), free_pid() and put_pid() work with struct upid
Each struct upid element of struct pid has to be initialized properly, i.e.
its nr mst be allocated from appropriate pidmap and ns set to appropriate
namespace.
When allocating a new pid, we need to know the namespace this pid will live
in, so the additional argument is added to alloc_pid().
On the other hand, the rest of the kernel still uses the pid->nr and
pid->pid_chain fields, so these ones are still initialized, but this will be
removed soon.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Paul Menage <menage@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index d2f4a420a5b9..984d259e172d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1041,7 +1041,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, goto bad_fork_cleanup_put_domain; if (pid != &init_struct_pid) { - pid = alloc_pid(); + pid = alloc_pid(task_active_pid_ns(p)); if (!pid) goto bad_fork_put_binfmt_module; } |