OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH] Use task_pgrp(), task_session() in copy_process()
[RFC][PATCH] Use task_pgrp(), task_session() in copy_process() [message #17142] Sat, 13 January 2007 22:05
Sukadev Bhattiprolu is currently offline  Sukadev Bhattiprolu
Messages: 413
Registered: August 2006
Senior Member
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@us.ibm.com>

Replace process_group() and process_session() with container-friendly
functions - task_pgrp() and task_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
---
 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@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Previous Topic: [PATCH 2/5] fixing errors handling during pci_driver resume stage [ata]
Next Topic: [RFC][PATCH] Static init struct pid for swapper
Goto Forum:
  


Current Time: Thu Jul 17 11:52:53 GMT 2025

Total time taken to generate the page: 0.06345 seconds