aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-03-23 19:43:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:57 -0400
commit45a68628d37222e655219febce9e91b6484789b2 (patch)
tree6acb5c45e8b11022358a1c28691c9b2c75a7df91 /include/linux
parentbfdc0b497faa82a0ba2f9dddcf109231dd519fcc (diff)
pid: remove the child_reaper special case in init/main.c
This patchset is a cleanup and a preparation to unshare the pid namespace. These prerequisites prepare for Eric's patchset to give a file descriptor to a namespace and join an existing namespace. This patch: It turns out that the existing assignment in copy_process of the child_reaper can handle the initial assignment of child_reaper we just need to generalize the test in kernel/fork.c Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Serge E. Hallyn <serge@hallyn.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pid.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 49f1c2f66e95..efceda0a51b1 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -141,6 +141,17 @@ static inline struct pid_namespace *ns_of_pid(struct pid *pid)
141} 141}
142 142
143/* 143/*
144 * is_child_reaper returns true if the pid is the init process
145 * of the current namespace. As this one could be checked before
146 * pid_ns->child_reaper is assigned in copy_process, we check
147 * with the pid number.
148 */
149static inline bool is_child_reaper(struct pid *pid)
150{
151 return pid->numbers[pid->level].nr == 1;
152}
153
154/*
144 * the helpers to get the pid's id seen from different namespaces 155 * the helpers to get the pid's id seen from different namespaces
145 * 156 *
146 * pid_nr() : global id, i.e. the id seen from the init namespace; 157 * pid_nr() : global id, i.e. the id seen from the init namespace;