aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-19 02:40:08 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:39 -0400
commit07543f5c75cee744b791cf7716c69571486fe753 (patch)
tree3e0d78f869114e5a6e2629fc157ee8f9023316bd /include/linux
parent425fb2b4bf5dde24be4a82e9a2c344bb49ac92e4 (diff)
pid namespaces: make proc have multiple superblocks - one for each namespace
Each pid namespace have to be visible through its own proc mount. Thus we need to have per-namespace proc trees with their own superblocks. We cannot easily show different pid namespace via one global proc tree, since each pid refers to different tasks in different namespaces. E.g. pid 1 refers to the init task in the initial namespace and to some other task when seeing from another namespace. Moreover - pid, exisintg in one namespace may not exist in the other. This approach has one move advantage is that the tasks from the init namespace can see what tasks live in another namespace by reading entries from another proc tree. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Paul Menage <menage@google.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pid_namespace.h3
-rw-r--r--include/linux/proc_fs.h3
2 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 14376ebf4bac..416d4e4ce94e 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -23,6 +23,9 @@ struct pid_namespace {
23 struct kmem_cache *pid_cachep; 23 struct kmem_cache *pid_cachep;
24 int level; 24 int level;
25 struct pid_namespace *parent; 25 struct pid_namespace *parent;
26#ifdef CONFIG_PROC_FS
27 struct vfsmount *proc_mnt;
28#endif
26}; 29};
27 30
28extern struct pid_namespace init_pid_ns; 31extern struct pid_namespace init_pid_ns;
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index dbd601c7244c..cbc1038c7900 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -125,7 +125,8 @@ extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
125extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); 125extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
126 126
127extern struct vfsmount *proc_mnt; 127extern struct vfsmount *proc_mnt;
128extern int proc_fill_super(struct super_block *,void *,int); 128struct pid_namespace;
129extern int proc_fill_super(struct super_block *);
129extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *); 130extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *);
130 131
131/* 132/*