From cce64333cae238da5587e0ca737bc3582026c207 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Mon, 26 Jun 2006 00:26:01 -0700 Subject: [PATCH] --- yaml --- r: 30258 b: refs/heads/master c: cc288738c9ae3c64d3c50b86604044d1f6d22941 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/proc/base.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index a391ebc7944b..c3ca02919001 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df26c40e567356caeefe2861311e19c54444d917 +refs/heads/master: cc288738c9ae3c64d3c50b86604044d1f6d22941 diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index 773469703c62..6092a6e2c5a9 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -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); @@ -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; } @@ -2271,7 +2272,7 @@ 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); @@ -2279,7 +2280,7 @@ static struct task_struct *next_tid(struct task_struct *start) get_task_struct(pos); else pos = NULL; - read_unlock(&tasklist_lock); + rcu_read_unlock(); put_task_struct(start); return pos; }