aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pid_namespace.h
diff options
context:
space:
mode:
authorCedric Le Goater <clg@fr.ibm.com>2006-12-08 05:37:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:52 -0500
commit9a575a92db3312a40cdf0b0406d88de88ad9741e (patch)
tree0b789528da13cd31f7fb206f184cfa123cc0ba42 /include/linux/pid_namespace.h
parent61a58c6c238cc81f7742b8cc84212cc55fb57747 (diff)
[PATCH] to nsproxy
Add the pid namespace framework to the nsproxy object. The copy of the pid namespace only increases the refcount on the global pid namespace, init_pid_ns, and unshare is not implemented. There is no configuration option to activate or deactivate this feature because this not relevant for the moment. 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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/pid_namespace.h')
-rw-r--r--include/linux/pid_namespace.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 54d79095e295..76e7c6b2cf33 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -5,6 +5,8 @@
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/threads.h> 6#include <linux/threads.h>
7#include <linux/pid.h> 7#include <linux/pid.h>
8#include <linux/nsproxy.h>
9#include <linux/kref.h>
8 10
9struct pidmap { 11struct pidmap {
10 atomic_t nr_free; 12 atomic_t nr_free;
@@ -14,10 +16,24 @@ struct pidmap {
14#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) 16#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
15 17
16struct pid_namespace { 18struct pid_namespace {
17 struct pidmap pidmap[PIDMAP_ENTRIES]; 19 struct kref kref;
18 int last_pid; 20 struct pidmap pidmap[PIDMAP_ENTRIES];
21 int last_pid;
19}; 22};
20 23
21extern struct pid_namespace init_pid_ns; 24extern struct pid_namespace init_pid_ns;
22 25
26static inline void get_pid_ns(struct pid_namespace *ns)
27{
28 kref_get(&ns->kref);
29}
30
31extern int copy_pid_ns(int flags, struct task_struct *tsk);
32extern void free_pid_ns(struct kref *kref);
33
34static inline void put_pid_ns(struct pid_namespace *ns)
35{
36 kref_put(&ns->kref, free_pid_ns);
37}
38
23#endif /* _LINUX_PID_NS_H */ 39#endif /* _LINUX_PID_NS_H */