提交 0800d308 编写于 作者: S Sukadev Bhattiprolu 提交者: Linus Torvalds

Use task_pgrp() task_session() in copy_process()

Use task_pgrp() and task_session() in copy_process(), and avoid find_pid()
call when attaching the task to its process group and session.
Signed-off-by: NSukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: <containers@lists.osdl.org>
Acked-by: NEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 85868995
...@@ -1249,14 +1249,11 @@ static struct task_struct *copy_process(unsigned long clone_flags, ...@@ -1249,14 +1249,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
__ptrace_link(p, current->parent); __ptrace_link(p, current->parent);
if (thread_group_leader(p)) { if (thread_group_leader(p)) {
pid_t pgid = process_group(current);
pid_t sid = process_session(current);
p->signal->tty = current->signal->tty; p->signal->tty = current->signal->tty;
p->signal->pgrp = pgid; p->signal->pgrp = process_group(current);
set_signal_session(p->signal, process_session(current)); set_signal_session(p->signal, process_session(current));
attach_pid(p, PIDTYPE_PGID, find_pid(pgid)); attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
attach_pid(p, PIDTYPE_SID, find_pid(sid)); attach_pid(p, PIDTYPE_SID, task_session(current));
list_add_tail_rcu(&p->tasks, &init_task.tasks); list_add_tail_rcu(&p->tasks, &init_task.tasks);
__get_cpu_var(process_counts)++; __get_cpu_var(process_counts)++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册