diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-04-30 03:54:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:48 -0400 |
commit | 5cd204550b1a006f2b0c986b0e0f53220ebfd391 (patch) | |
tree | ee0f5e042072d4d2f4a3c6cd6e3a8b60676868ae /kernel | |
parent | cb41d6d068716b2b3666925da34d3d7e658bf4f3 (diff) |
Deprecate find_task_by_pid()
There are some places that are known to operate on tasks'
global pids only:
* the rest_init() call (called on boot)
* the kgdb's getthread
* the create_kthread() (since the kthread is run in init ns)
So use the find_task_by_pid_ns(..., &init_pid_ns) there
and schedule the find_task_by_pid for removal.
[sukadev@us.ibm.com: Fix warning in kernel/pid.c]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kthread.c | 2 | ||||
-rw-r--r-- | kernel/pid.c | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index ac72eea48339..bd1b9ea024e1 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
@@ -98,7 +98,7 @@ static void create_kthread(struct kthread_create_info *create) | |||
98 | struct sched_param param = { .sched_priority = 0 }; | 98 | struct sched_param param = { .sched_priority = 0 }; |
99 | wait_for_completion(&create->started); | 99 | wait_for_completion(&create->started); |
100 | read_lock(&tasklist_lock); | 100 | read_lock(&tasklist_lock); |
101 | create->result = find_task_by_pid(pid); | 101 | create->result = find_task_by_pid_ns(pid, &init_pid_ns); |
102 | read_unlock(&tasklist_lock); | 102 | read_unlock(&tasklist_lock); |
103 | /* | 103 | /* |
104 | * root may have changed our (kthreadd's) priority or CPU mask. | 104 | * root may have changed our (kthreadd's) priority or CPU mask. |
diff --git a/kernel/pid.c b/kernel/pid.c index b322cdf401bf..a9ae9f7fb229 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -381,12 +381,6 @@ struct task_struct *find_task_by_pid_type_ns(int type, int nr, | |||
381 | 381 | ||
382 | EXPORT_SYMBOL(find_task_by_pid_type_ns); | 382 | EXPORT_SYMBOL(find_task_by_pid_type_ns); |
383 | 383 | ||
384 | struct task_struct *find_task_by_pid(pid_t nr) | ||
385 | { | ||
386 | return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns); | ||
387 | } | ||
388 | EXPORT_SYMBOL(find_task_by_pid); | ||
389 | |||
390 | struct task_struct *find_task_by_vpid(pid_t vnr) | 384 | struct task_struct *find_task_by_vpid(pid_t vnr) |
391 | { | 385 | { |
392 | return find_task_by_pid_type_ns(PIDTYPE_PID, vnr, | 386 | return find_task_by_pid_type_ns(PIDTYPE_PID, vnr, |