|
@@ -2043,7 +2043,7 @@ out:
|
|
static struct task_struct *first_tgid(int tgid, int nr)
|
|
static struct task_struct *first_tgid(int tgid, int nr)
|
|
{
|
|
{
|
|
struct task_struct *pos = NULL;
|
|
struct task_struct *pos = NULL;
|
|
- read_lock(&tasklist_lock);
|
|
|
|
|
|
+ rcu_read_lock();
|
|
if (tgid && nr) {
|
|
if (tgid && nr) {
|
|
pos = find_task_by_pid(tgid);
|
|
pos = find_task_by_pid(tgid);
|
|
if (pos && !thread_group_leader(pos))
|
|
if (pos && !thread_group_leader(pos))
|
|
@@ -2069,7 +2069,7 @@ static struct task_struct *first_tgid(int tgid, int nr)
|
|
}
|
|
}
|
|
pos = NULL;
|
|
pos = NULL;
|
|
done:
|
|
done:
|
|
- read_unlock(&tasklist_lock);
|
|
|
|
|
|
+ rcu_read_unlock();
|
|
return pos;
|
|
return pos;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2082,7 +2082,7 @@ done:
|
|
static struct task_struct *next_tgid(struct task_struct *start)
|
|
static struct task_struct *next_tgid(struct task_struct *start)
|
|
{
|
|
{
|
|
struct task_struct *pos;
|
|
struct task_struct *pos;
|
|
- read_lock(&tasklist_lock);
|
|
|
|
|
|
+ rcu_read_lock();
|
|
pos = start;
|
|
pos = start;
|
|
if (pid_alive(start))
|
|
if (pid_alive(start))
|
|
pos = next_task(start);
|
|
pos = next_task(start);
|
|
@@ -2092,7 +2092,7 @@ static struct task_struct *next_tgid(struct task_struct *start)
|
|
}
|
|
}
|
|
pos = NULL;
|
|
pos = NULL;
|
|
done:
|
|
done:
|
|
- read_unlock(&tasklist_lock);
|
|
|
|
|
|
+ rcu_read_unlock();
|
|
put_task_struct(start);
|
|
put_task_struct(start);
|
|
return pos;
|
|
return pos;
|
|
}
|
|
}
|