[Devel] [PATCH] Use task_pgrp() and task_session in copy_process()

sukadev at us.ibm.com sukadev at us.ibm.com
Thu Feb 22 15:25:51 PST 2007


From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Subject: [PATCH] Use task_pgrp() and task_session in copy_process()

Replace process_group() and process_session() in copy_process()
with their container-friendly counterparts (task_pgrp() and
task_session()).

Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Cc: Cedric Le Goater <clg at fr.ibm.com>
Cc: Dave Hansen <haveblue at us.ibm.com>
Cc: Serge Hallyn <serue at us.ibm.com>
Cc: containers at lists.osdl.org
---
 kernel/fork.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Index: lx26-20-mm2/kernel/fork.c
===================================================================
--- lx26-20-mm2.orig/kernel/fork.c	2007-02-21 15:33:57.000000000 -0800
+++ lx26-20-mm2/kernel/fork.c	2007-02-21 15:34:08.000000000 -0800
@@ -1254,14 +1254,12 @@ 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;
-			set_signal_session(p->signal, process_session(current));
-			attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
-			attach_pid(p, PIDTYPE_SID, find_pid(sid));
+			p->signal->pgrp = pid_nr(task_pgrp(current));
+			set_signal_session(p->signal,
+						pid_nr(task_session(current)));
+			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)++;
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list