[Devel] [RFC][PATCH 11/14] Remove pid ns field from nsproxy

sukadev at us.ibm.com sukadev at us.ibm.com
Tue Mar 20 20:23:12 PDT 2007


From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Subject: [RFC][PATCH 11/14] Remove pid ns field from nsproxy

Remove pid_ns field from nsproxy since we now use pid->pid_nrs list
to find our pid namespace.

Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
---
 include/linux/init_task.h |    1 -
 include/linux/nsproxy.h   |    2 --
 kernel/nsproxy.c          |   10 ----------
 3 files changed, 13 deletions(-)

Index: 2.6.21-rc3-mm2/include/linux/init_task.h
===================================================================
--- 2.6.21-rc3-mm2.orig/include/linux/init_task.h
+++ 2.6.21-rc3-mm2/include/linux/init_task.h
@@ -72,7 +72,6 @@

 extern struct nsproxy init_nsproxy;
 #define INIT_NSPROXY(nsproxy) {						\
-	.pid_ns		= &init_pid_ns,					\
 	.count		= ATOMIC_INIT(1),				\
 	.nslock		= __SPIN_LOCK_UNLOCKED(nsproxy.nslock),		\
 	.uts_ns		= &init_uts_ns,					\
Index: 2.6.21-rc3-mm2/include/linux/nsproxy.h
===================================================================
--- 2.6.21-rc3-mm2.orig/include/linux/nsproxy.h
+++ 2.6.21-rc3-mm2/include/linux/nsproxy.h
@@ -7,7 +7,6 @@
 struct mnt_namespace;
 struct uts_namespace;
 struct ipc_namespace;
-struct pid_namespace;

 /*
  * A structure to contain pointers to all per-process
@@ -27,7 +26,6 @@ struct nsproxy {
 	struct uts_namespace *uts_ns;
 	struct ipc_namespace *ipc_ns;
 	struct mnt_namespace *mnt_ns;
-	struct pid_namespace *pid_ns;
 };
 extern struct nsproxy init_nsproxy;

Index: 2.6.21-rc3-mm2/kernel/nsproxy.c
===================================================================
--- 2.6.21-rc3-mm2.orig/kernel/nsproxy.c
+++ 2.6.21-rc3-mm2/kernel/nsproxy.c
@@ -19,7 +19,6 @@
 #include <linux/init_task.h>
 #include <linux/mnt_namespace.h>
 #include <linux/utsname.h>
-#include <linux/pid_namespace.h>

 struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy);

@@ -75,15 +74,8 @@ static struct nsproxy *create_new_namesp
 	if (IS_ERR(new_nsp->ipc_ns))
 		goto out_ipc;

-	new_nsp->pid_ns = copy_pid_ns(flags, tsk->nsproxy->pid_ns);
-	if (IS_ERR(new_nsp->pid_ns))
-		goto out_pid;
-
 	return new_nsp;

-out_pid:
-	if (new_nsp->ipc_ns)
-		put_ipc_ns(new_nsp->ipc_ns);
 out_ipc:
 	if (new_nsp->uts_ns)
 		put_uts_ns(new_nsp->uts_ns);
@@ -138,8 +130,6 @@ void free_nsproxy(struct nsproxy *ns)
 		put_uts_ns(ns->uts_ns);
 	if (ns->ipc_ns)
 		put_ipc_ns(ns->ipc_ns);
-	if (ns->pid_ns)
-		put_pid_ns(ns->pid_ns);
 	kfree(ns);
 }


-- 

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list