Messages in this thread Patch in this message | | | Date | Sun, 19 Mar 2006 22:26:00 +0300 | From | Oleg Nesterov <> | Subject | [PATCH] cleanup next_tid() |
| |
This patch tries to make next_tid() a bit more readable and deletes unnecessary "pid_alive(pos)" check.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- MM/fs/proc/base.c~ 2006-03-20 00:02:08.000000000 +0300 +++ MM/fs/proc/base.c 2006-03-20 00:52:02.000000000 +0300 @@ -2215,15 +2215,15 @@ out: */ static struct task_struct *next_tid(struct task_struct *start) { - struct task_struct *pos; + struct task_struct *pos = NULL; rcu_read_lock(); - pos = start; - if (pid_alive(start)) - pos = next_thread(start); - if (pid_alive(pos) && (pos != start->group_leader)) - get_task_struct(pos); - else - pos = NULL; + if (pid_alive(start)) { + pos = next_thread(start); + if (thread_group_leader(pos)) + pos = NULL; + else + get_task_struct(pos); + } rcu_read_unlock(); put_task_struct(start); return pos; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |