* [PATCH 5/5] Use task_pgrp() task_session() in copy_process()
@ 2007-03-13 4:45 sukadev
0 siblings, 0 replies; only message in thread
From: sukadev @ 2007-03-13 4:45 UTC (permalink / raw)
To: Andrew Morton
Cc: Cedric Le Goater, Dave Hansen, Serge Hallyn, Eric Biederman,
Herbert Poetzl, containers, linux-kernel
From: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Subject: [PATCH 5/5] 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>
---
kernel/fork.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: lx26-21-rc3-mm2/kernel/fork.c
===================================================================
--- lx26-21-rc3-mm2.orig/kernel/fork.c 2007-03-12 17:18:03.000000000 -0700
+++ lx26-21-rc3-mm2/kernel/fork.c 2007-03-12 17:18:11.000000000 -0700
@@ -1252,14 +1252,11 @@ static struct task_struct *copy_process(
tracehook_init_task(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->pgrp = pgid;
+ p->signal->pgrp = process_group(current);
set_signal_session(p->signal, process_session(current));
- attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
- attach_pid(p, PIDTYPE_SID, find_pid(sid));
+ attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
+ attach_pid(p, PIDTYPE_SID, task_session(current));
list_add_tail_rcu(&p->tasks, &init_task.tasks);
__get_cpu_var(process_counts)++;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-03-13 4:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-13 4:45 [PATCH 5/5] Use task_pgrp() task_session() in copy_process() sukadev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).