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 6/7] use current->nsproxy->pid_ns
Date: Tue, 17 Oct 2006 22:30:10 +0200	[thread overview]
Message-ID: <20061017205316.916962000@localhost.localdomain> (raw)
In-Reply-To: 20061017203004.555659000@localhost.localdomain

[-- Attachment #1: pid-namespace-use-pid_ns.patch --]
[-- Type: text/plain, Size: 1769 bytes --]

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>
---
 fs/proc/proc_misc.c |    2 +-
 kernel/pid.c        |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: 2.6.19-rc2-mm1/fs/proc/proc_misc.c
===================================================================
--- 2.6.19-rc2-mm1.orig/fs/proc/proc_misc.c
+++ 2.6.19-rc2-mm1/fs/proc/proc_misc.c
@@ -92,7 +92,7 @@ static int loadavg_read_proc(char *page,
 		LOAD_INT(a), LOAD_FRAC(a),
 		LOAD_INT(b), LOAD_FRAC(b),
 		LOAD_INT(c), LOAD_FRAC(c),
-		nr_running(), nr_threads, init_pid_ns.last_pid);
+		nr_running(), nr_threads, current->nsproxy->pid_ns->last_pid);
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
Index: 2.6.19-rc2-mm1/kernel/pid.c
===================================================================
--- 2.6.19-rc2-mm1.orig/kernel/pid.c
+++ 2.6.19-rc2-mm1/kernel/pid.c
@@ -196,7 +196,7 @@ fastcall void free_pid(struct pid *pid)
 	hlist_del_rcu(&pid->pid_chain);
 	spin_unlock_irqrestore(&pidmap_lock, flags);
 
-	free_pidmap(&init_pid_ns, pid->nr);
+	free_pidmap(current->nsproxy->pid_ns, pid->nr);
 	call_rcu(&pid->rcu, delayed_put_pid);
 }
 
@@ -210,7 +210,7 @@ struct pid *alloc_pid(void)
 	if (!pid)
 		goto out;
 
-	nr = alloc_pidmap(&init_pid_ns);
+	nr = alloc_pidmap(current->nsproxy->pid_ns);
 	if (nr < 0)
 		goto out_free;
 
@@ -353,7 +353,7 @@ struct pid *find_ge_pid(int nr)
 		pid = find_pid(nr);
 		if (pid)
 			break;
-		nr = next_pidmap(&init_pid_ns, nr);
+		nr = next_pidmap(current->nsproxy->pid_ns, nr);
 	} while (nr > 0);
 
 	return pid;

--

  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 ` [patch -mm 3/7] add an identifier to nsproxy Cedric Le Goater
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 ` Cedric Le Goater [this message]
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=20061017205316.916962000@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