diff options
author | jdike <jdike> | 2003-03-22 21:38:57 +0000 |
---|---|---|
committer | jdike <jdike> | 2003-03-22 21:38:57 +0000 |
commit | 34cb2cfb9e7ec699a752e304713dc87e68cc3c70 (patch) | |
tree | 218b36a4a1e84d66a690997d265d7924775f9428 | |
parent | 05261739cb7c0353586d40d0d61f6500ba5ac6c4 (diff) | |
download | uml-history-34cb2cfb9e7ec699a752e304713dc87e68cc3c70.tar.gz |
Changed get_task to use find_task_by_pid instead of doing the search by
hand.
-rw-r--r-- | arch/um/kernel/process_kern.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index 75c292d..74f9655 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c @@ -52,17 +52,12 @@ struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } }; struct task_struct *get_task(int pid, int require) { - struct task_struct *task, *ret; + struct task_struct *ret; - ret = NULL; read_lock(&tasklist_lock); - for_each_task(task){ - if(task->pid == pid){ - ret = task; - break; - } - } + ret = find_task_by_pid(pid); read_unlock(&tasklist_lock); + if(require && (ret == NULL)) panic("get_task couldn't find a task\n"); return(ret); } |