Skip to content

Commit

Permalink
[PATCH] proc: Remove tasklist_lock from proc_pid_lookup() and proc_ta…
Browse files Browse the repository at this point in the history
…sk_lookup()

Since we no longer need the tasklist_lock for get_task_struct the lookup
methods no longer need the tasklist_lock.

This just depends on my previous patch that makes get_task_struct() rcu
safe.

Signed-off-by: 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
Eric W. Biederman authored and Linus Torvalds committed Jun 26, 2006
1 parent 454cc10 commit de75873
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,11 +1940,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
if (tgid == ~0U)
goto out;

read_lock(&tasklist_lock);
rcu_read_lock();
task = find_task_by_pid(tgid);
if (task)
get_task_struct(task);
read_unlock(&tasklist_lock);
rcu_read_unlock();
if (!task)
goto out;

Expand Down Expand Up @@ -1988,11 +1988,11 @@ static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry
if (tid == ~0U)
goto out;

read_lock(&tasklist_lock);
rcu_read_lock();
task = find_task_by_pid(tid);
if (task)
get_task_struct(task);
read_unlock(&tasklist_lock);
rcu_read_unlock();
if (!task)
goto out;
if (leader->tgid != task->tgid)
Expand Down

0 comments on commit de75873

Please sign in to comment.