Skip to content

Commit

Permalink
[PATCH] cleanup next_tid()
Browse files Browse the repository at this point in the history
Try to make next_tid() a bit more readable and deletes unnecessary
"pid_alive(pos)" check.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jun 26, 2006
1 parent a872ff0 commit c1df7fb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2267,15 +2267,15 @@ static struct task_struct *first_tid(struct task_struct *leader,
*/
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))
if (pid_alive(start)) {
pos = next_thread(start);
if (pid_alive(pos) && (pos != start->group_leader))
get_task_struct(pos);
else
pos = NULL;
if (thread_group_leader(pos))
pos = NULL;
else
get_task_struct(pos);
}
rcu_read_unlock();
put_task_struct(start);
return pos;
Expand Down

0 comments on commit c1df7fb

Please sign in to comment.