[Devel] [RFC][PATCH] Use task_pgrp(), task_session() in copy_process()

Sukadev Bhattiprolu sukadev at us.ibm.com
Sat Jan 13 14:05:10 PST 2007


This patch must be applied on top of the patch to static initialize swapper
struct pid (or we will crash on boot) and serves as a test for that patch.
I have unit tested on x86_64 for now.

---

From: Sukadev Bhattiprolu <sukadev at us.ibm.com>

Replace process_group() and process_session() with container-friendly
functions - 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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: lx26-20-rc2-mm1/kernel/fork.c
===================================================================
--- lx26-20-rc2-mm1.orig/kernel/fork.c	2007-01-13 05:26:51.228582128 -0800
+++ lx26-20-rc2-mm1/kernel/fork.c	2007-01-13 05:28:40.973898304 -0800
@@ -1251,8 +1251,8 @@ static struct task_struct *copy_process(
 			p->signal->tty = current->signal->tty;
 			p->signal->pgrp = pgid;
 			set_signal_session(p->signal, sid);
-			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)++;
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list