From 575dd22789c0fd8d870aec348ee05d35eea7605d Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 7 Jan 2009 18:08:49 -0800 Subject: [PATCH] --- yaml --- r: 127617 b: refs/heads/master c: 61bce0f1371cfff497fe85594fd39d1a0b15ebe1 h: refs/heads/master i: 127615: 364791cb5f622d48a8a50389c463b009b6e7cd79 v: v3 --- [refs] | 2 +- trunk/include/linux/pid_namespace.h | 6 +----- trunk/kernel/fork.c | 4 ++-- trunk/kernel/pid.c | 6 ++++++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 60b1a042e918..ec69e876ce53 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f9fb860f67b9542cd78d1558dec7058092b57d8e +refs/heads/master: 61bce0f1371cfff497fe85594fd39d1a0b15ebe1 diff --git a/trunk/include/linux/pid_namespace.h b/trunk/include/linux/pid_namespace.h index d82fe825d62f..38d10326246a 100644 --- a/trunk/include/linux/pid_namespace.h +++ b/trunk/include/linux/pid_namespace.h @@ -79,11 +79,7 @@ static inline void zap_pid_ns_processes(struct pid_namespace *ns) } #endif /* CONFIG_PID_NS */ -static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) -{ - return tsk->nsproxy->pid_ns; -} - +extern struct pid_namespace *task_active_pid_ns(struct task_struct *tsk); void pidhash_init(void); void pidmap_init(void); diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 7b8f2a78be3d..4018308048cf 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -1126,12 +1126,12 @@ static struct task_struct *copy_process(unsigned long clone_flags, if (pid != &init_struct_pid) { retval = -ENOMEM; - pid = alloc_pid(task_active_pid_ns(p)); + pid = alloc_pid(p->nsproxy->pid_ns); if (!pid) goto bad_fork_cleanup_io; if (clone_flags & CLONE_NEWPID) { - retval = pid_ns_prepare_proc(task_active_pid_ns(p)); + retval = pid_ns_prepare_proc(p->nsproxy->pid_ns); if (retval < 0) goto bad_fork_free_pid; } diff --git a/trunk/kernel/pid.c b/trunk/kernel/pid.c index af9224cdd6c0..1b3586fe753a 100644 --- a/trunk/kernel/pid.c +++ b/trunk/kernel/pid.c @@ -474,6 +474,12 @@ pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) } EXPORT_SYMBOL(task_session_nr_ns); +struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) +{ + return ns_of_pid(task_pid(tsk)); +} +EXPORT_SYMBOL_GPL(task_active_pid_ns); + /* * Used by proc to find the first pid that is greater than or equal to nr. *