aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-06-26 03:26:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:26 -0400
commitc1df7fb88a011b39ea722ac00975c5b8a803261b (patch)
treed3cbbe5bde859897993ceb8969a080ae71166a67 /fs/proc
parenta872ff0cb2218dc9688b990c5ccda064dc40946b (diff)
[PATCH] cleanup next_tid()
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>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 5ee46d3a5cac..43871c85729d 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2267,15 +2267,15 @@ out:
2267 */ 2267 */
2268static struct task_struct *next_tid(struct task_struct *start) 2268static struct task_struct *next_tid(struct task_struct *start)
2269{ 2269{
2270 struct task_struct *pos; 2270 struct task_struct *pos = NULL;
2271 rcu_read_lock(); 2271 rcu_read_lock();
2272 pos = start; 2272 if (pid_alive(start)) {
2273 if (pid_alive(start))
2274 pos = next_thread(start); 2273 pos = next_thread(start);
2275 if (pid_alive(pos) && (pos != start->group_leader)) 2274 if (thread_group_leader(pos))
2276 get_task_struct(pos); 2275 pos = NULL;
2277 else 2276 else
2278 pos = NULL; 2277 get_task_struct(pos);
2278 }
2279 rcu_read_unlock(); 2279 rcu_read_unlock();
2280 put_task_struct(start); 2280 put_task_struct(start);
2281 return pos; 2281 return pos;