X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=kernel%2Fpid.c;h=6db82b68e2f881ad453f3b47a6f704cf05ba8a4b;hb=c18258c6f0848f97e85287f6271c511a092bb784;hp=93e212f20671fd3b19838327366c45e3ad54ced8;hpb=35fa2048ab13d1be846be612e395c15c200bd51c;p=deliverable%2Flinux.git diff --git a/kernel/pid.c b/kernel/pid.c index 93e212f20671..6db82b68e2f8 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -252,6 +252,15 @@ void fastcall detach_pid(struct task_struct *task, enum pid_type type) free_pid(pid); } +/* transfer_pid is an optimization of attach_pid(new), detach_pid(old) */ +void fastcall transfer_pid(struct task_struct *old, struct task_struct *new, + enum pid_type type) +{ + new->pids[type].pid = old->pids[type].pid; + hlist_replace_rcu(&old->pids[type].node, &new->pids[type].node); + old->pids[type].pid = NULL; +} + struct task_struct * fastcall pid_task(struct pid *pid, enum pid_type type) { struct task_struct *result = NULL;