aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/pid.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/pid.c')
-rw-r--r--kernel/pid.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/pid.c b/kernel/pid.c
index d3ad724afa83..d76f59326bd4 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -247,13 +247,16 @@ struct pid * fastcall find_pid(int nr)
247} 247}
248EXPORT_SYMBOL_GPL(find_pid); 248EXPORT_SYMBOL_GPL(find_pid);
249 249
250int fastcall attach_pid(struct task_struct *task, enum pid_type type, int nr) 250/*
251 * attach_pid() must be called with the tasklist_lock write-held.
252 */
253int fastcall attach_pid(struct task_struct *task, enum pid_type type,
254 struct pid *pid)
251{ 255{
252 struct pid_link *link; 256 struct pid_link *link;
253 struct pid *pid;
254 257
255 link = &task->pids[type]; 258 link = &task->pids[type];
256 link->pid = pid = find_pid(nr); 259 link->pid = pid;
257 hlist_add_head_rcu(&link->node, &pid->tasks[type]); 260 hlist_add_head_rcu(&link->node, &pid->tasks[type]);
258 261
259 return 0; 262 return 0;