]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kill task_detached()
authorOleg Nesterov <oleg@redhat.com>
Wed, 22 Jun 2011 21:09:54 +0000 (23:09 +0200)
committerOleg Nesterov <oleg@redhat.com>
Mon, 27 Jun 2011 18:30:09 +0000 (20:30 +0200)
Upadate the last user of task_detached(), wait_task_zombie(), to
use thread_group_leader() and kill task_detached().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
include/linux/sched.h
kernel/exit.c

index 0cb4f097f76c30d382aff84dcf297e99b291b27f..39acee2c8929715b30ad7e97bdb9c4c6c32b7e71 100644 (file)
@@ -2318,11 +2318,6 @@ static inline int thread_group_empty(struct task_struct *p)
 #define delay_group_leader(p) \
                (thread_group_leader(p) && !thread_group_empty(p))
 
-static inline int task_detached(struct task_struct *p)
-{
-       return p->exit_signal == -1;
-}
-
 /*
  * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
  * subscriptions and synchronises with wait4().  Also used in procfs.  Also
index 2b1ba8048a14e8cb094af269a84c6ac7ce779319..9fa99702645da1f94751554970190bb8b7266cbf 100644 (file)
@@ -189,7 +189,6 @@ repeat:
        zap_leader = 0;
        leader = p->group_leader;
        if (leader != p && thread_group_empty(leader) && leader->exit_state == EXIT_ZOMBIE) {
-               BUG_ON(task_detached(leader));
                /*
                 * If we were the last child thread and the leader has
                 * exited already, and the leader's parent ignores SIGCHLD,
@@ -1231,9 +1230,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
        traced = ptrace_reparented(p);
        /*
         * It can be ptraced but not reparented, check
-        * !task_detached() to filter out sub-threads.
+        * thread_group_leader() to filter out sub-threads.
         */
-       if (likely(!traced) && likely(!task_detached(p))) {
+       if (likely(!traced) && thread_group_leader(p)) {
                struct signal_struct *psig;
                struct signal_struct *sig;
                unsigned long maxrss;