Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30258
b: refs/heads/master
c: cc28873
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Jun 26, 2006
1 parent 9f4603c commit cce6433
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df26c40e567356caeefe2861311e19c54444d917
refs/heads/master: cc288738c9ae3c64d3c50b86604044d1f6d22941
11 changes: 6 additions & 5 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,11 +2224,12 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
* In the case of a seek we start with the leader and walk nr
* threads past it.
*/
static struct task_struct *first_tid(struct task_struct *leader, int tid, int nr)
static struct task_struct *first_tid(struct task_struct *leader,
int tid, int nr)
{
struct task_struct *pos = NULL;
read_lock(&tasklist_lock);

rcu_read_lock();
/* Attempt to start with the pid of a thread */
if (tid && (nr > 0)) {
pos = find_task_by_pid(tid);
Expand Down Expand Up @@ -2258,7 +2259,7 @@ static struct task_struct *first_tid(struct task_struct *leader, int tid, int nr
}
pos = NULL;
done:
read_unlock(&tasklist_lock);
rcu_read_unlock();
return pos;
}

Expand All @@ -2271,15 +2272,15 @@ static struct task_struct *first_tid(struct task_struct *leader, int tid, int nr
static struct task_struct *next_tid(struct task_struct *start)
{
struct task_struct *pos;
read_lock(&tasklist_lock);
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;
read_unlock(&tasklist_lock);
rcu_read_unlock();
put_task_struct(start);
return pos;
}
Expand Down

0 comments on commit cce6433

Please sign in to comment.