mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-17 22:23:45 -04:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
bfdc0b497f
commit
45a68628d3
@@ -140,6 +140,17 @@ static inline struct pid_namespace *ns_of_pid(struct pid *pid)
|
||||
return ns;
|
||||
}
|
||||
|
||||
/*
|
||||
* is_child_reaper returns true if the pid is the init process
|
||||
* of the current namespace. As this one could be checked before
|
||||
* pid_ns->child_reaper is assigned in copy_process, we check
|
||||
* with the pid number.
|
||||
*/
|
||||
static inline bool is_child_reaper(struct pid *pid)
|
||||
{
|
||||
return pid->numbers[pid->level].nr == 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* the helpers to get the pid's id seen from different namespaces
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user