[Devel] [RFC][PATCH] Add pspace to task_struct

Sukadev Bhattiprolu sukadev at us.ibm.com
Wed Sep 6 17:46:57 PDT 2006


Add a notion of pid space to task_struct. Currently there is only one
pid space, init_pspace and all tasks belong to this pspace. When a new
task is created, it inherits its parent's pid space (in copy_process()).

This is based on Eric Biederman's patch: http://lkml.org/lkml/2006/2/6/285

Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Cc: Eric Biederman <ebiederm at xmission.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

 include/linux/init_task.h |    2 ++
 include/linux/sched.h     |    1 +
 2 files changed, 3 insertions(+)

Index: lx26-18-rc5/include/linux/init_task.h
===================================================================
--- lx26-18-rc5.orig/include/linux/init_task.h	2006-08-29 14:03:07.000000000 -0700
+++ lx26-18-rc5/include/linux/init_task.h	2006-09-06 12:36:55.000000000 -0700
@@ -5,6 +5,7 @@
 #include <linux/rcupdate.h>
 #include <linux/irqflags.h>
 #include <linux/lockdep.h>
+#include <linux/pspace.h>
 
 #define INIT_FDTABLE \
 {							\
@@ -115,6 +116,7 @@ extern struct group_info init_groups;
 	.thread		= INIT_THREAD,					\
 	.fs		= &init_fs,					\
 	.files		= &init_files,					\
+	.pspace		= &init_pspace,					\
 	.signal		= &init_signals,				\
 	.sighand	= &init_sighand,				\
 	.pending	= {						\
Index: lx26-18-rc5/include/linux/sched.h
===================================================================
--- lx26-18-rc5.orig/include/linux/sched.h	2006-08-31 12:46:42.000000000 -0700
+++ lx26-18-rc5/include/linux/sched.h	2006-09-06 12:33:59.000000000 -0700
@@ -816,6 +816,7 @@ struct task_struct {
 	/* ??? */
 	unsigned long personality;
 	unsigned did_exec:1;
+	struct pspace *pspace;	/* process id namespace */
 	pid_t pid;
 	pid_t tgid;
 	/* 
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list