public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cedric Le Goater <clg@fr.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Kirill Korotaev <dev@openvz.org>,
	Cedric Le Goater <clg@fr.ibm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Herbert Poetzl <herbert@13thfloor.at>,
	Sukadev Bhattiprolu <sukadev@us.ibm.com>,
	Andrew Morton <akpm@osdl.org>
Subject: [patch -mm 3/7] add an identifier to nsproxy
Date: Tue, 17 Oct 2006 22:30:07 +0200	[thread overview]
Message-ID: <20061017205314.623412000@localhost.localdomain> (raw)
In-Reply-To: 20061017203004.555659000@localhost.localdomain

[-- Attachment #1: nsproxy-add-id.patch --]
[-- Type: text/plain, Size: 1855 bytes --]

This patch adds an identifier to nsproxy. The default init_ns_proxy
has identifier 0 and allocated nsproxies are given -1.

This identifier will be used by a new syscall sys_bind_ns.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>
---
 include/linux/init_task.h |    1 +
 include/linux/nsproxy.h   |    1 +
 kernel/nsproxy.c          |    1 +
 3 files changed, 3 insertions(+)

Index: 2.6.19-rc2-mm1/include/linux/init_task.h
===================================================================
--- 2.6.19-rc2-mm1.orig/include/linux/init_task.h
+++ 2.6.19-rc2-mm1/include/linux/init_task.h
@@ -72,6 +72,7 @@ extern struct nsproxy init_nsproxy;
 #define INIT_NSPROXY(nsproxy) {						\
 	.count		= ATOMIC_INIT(1),				\
 	.nslock		= SPIN_LOCK_UNLOCKED,				\
+	.id		= 0,						\
 	.uts_ns		= &init_uts_ns,					\
 	.mnt_ns		= NULL,						\
 	INIT_IPC_NS(ipc_ns)						\
Index: 2.6.19-rc2-mm1/include/linux/nsproxy.h
===================================================================
--- 2.6.19-rc2-mm1.orig/include/linux/nsproxy.h
+++ 2.6.19-rc2-mm1/include/linux/nsproxy.h
@@ -23,6 +23,7 @@ struct ipc_namespace;
 struct nsproxy {
 	atomic_t count;
 	spinlock_t nslock;
+	unsigned long id;
 	struct uts_namespace *uts_ns;
 	struct ipc_namespace *ipc_ns;
 	struct mnt_namespace *mnt_ns;
Index: 2.6.19-rc2-mm1/kernel/nsproxy.c
===================================================================
--- 2.6.19-rc2-mm1.orig/kernel/nsproxy.c
+++ 2.6.19-rc2-mm1/kernel/nsproxy.c
@@ -48,6 +48,7 @@ static inline struct nsproxy *clone_name
 	if (ns) {
 		memcpy(ns, orig, sizeof(struct nsproxy));
 		atomic_set(&ns->count, 1);
+		ns->id = -1;
 	}
 	return ns;
 }

--

  parent reply	other threads:[~2006-10-17 20:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-17 20:30 [patch -mm 0/7] pid namespace and namespace cleanups Cedric Le Goater
2006-10-17 20:30 ` [patch -mm 1/7] add process_session() helper routine Cedric Le Goater
2006-10-17 20:30 ` [patch -mm 2/7] rename struct namespace to struct mnt_namespace Cedric Le Goater
2006-10-17 21:17   ` Cedric Le Goater
2006-10-17 20:30 ` Cedric Le Goater [this message]
2006-10-17 20:30 ` [patch -mm 4/7] rename struct pspace to struct pid_namespace Cedric Le Goater
2006-10-17 21:19   ` Cedric Le Goater
2006-10-17 20:30 ` [patch -mm 5/7] add pid_namespace to nsproxy Cedric Le Goater
2006-10-17 20:30 ` [patch -mm 6/7] use current->nsproxy->pid_ns Cedric Le Goater
2006-10-17 20:30 ` [patch -mm 7/7] add child reaper to pid_namespace Cedric Le Goater
2006-10-17 21:21   ` Cedric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061017205314.623412000@localhost.localdomain \
    --to=clg@fr.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dev@openvz.org \
    --cc=ebiederm@xmission.com \
    --cc=herbert@13thfloor.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sukadev@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox