diff options
author | Sukadev Bhattiprolu <sukadev@us.ibm.com> | 2007-05-11 01:23:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 11:29:36 -0400 |
commit | 0800d30832ddecf2d9dc40068fed9df95930a8f1 (patch) | |
tree | fa4aa77d9cd95818b4ba32ced6bbb096c19b1bfb /kernel | |
parent | 85868995d9d82de5b0de38d695559daddffef893 (diff) |
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: Sukadev 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: Eric W. Biederman <ebiederm@xmission.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/fork.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index cf13c44f3da..083bf8953ce 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1249,14 +1249,11 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1249 | __ptrace_link(p, current->parent); | 1249 | __ptrace_link(p, current->parent); |
1250 | 1250 | ||
1251 | if (thread_group_leader(p)) { | 1251 | if (thread_group_leader(p)) { |
1252 | pid_t pgid = process_group(current); | ||
1253 | pid_t sid = process_session(current); | ||
1254 | |||
1255 | p->signal->tty = current->signal->tty; | 1252 | p->signal->tty = current->signal->tty; |
1256 | p->signal->pgrp = pgid; | 1253 | p->signal->pgrp = process_group(current); |
1257 | set_signal_session(p->signal, process_session(current)); | 1254 | set_signal_session(p->signal, process_session(current)); |
1258 | attach_pid(p, PIDTYPE_PGID, find_pid(pgid)); | 1255 | attach_pid(p, PIDTYPE_PGID, task_pgrp(current)); |
1259 | attach_pid(p, PIDTYPE_SID, find_pid(sid)); | 1256 | attach_pid(p, PIDTYPE_SID, task_session(current)); |
1260 | 1257 | ||
1261 | list_add_tail_rcu(&p->tasks, &init_task.tasks); | 1258 | list_add_tail_rcu(&p->tasks, &init_task.tasks); |
1262 | __get_cpu_var(process_counts)++; | 1259 | __get_cpu_var(process_counts)++; |