Skip to contentSkip to conversation

Make proc have multiple superblocks - one for each namespace

PATCH In review [email protected] 1 participant 1 message Aug 10, 2007 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 11/20 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.

---

 fs/proc/inode.c               |    2 -
 fs/proc/root.c                |   67 +++++++++++++++++++++++++++++++++++++++---
 include/linux/pid_namespace.h |    3 +
 include/linux/proc_fs.h       |    3 +
 4 files changed, 69 insertions(+), 6 deletions(-)
fs/proc/inode.c renamed from fs/proc/inode.c.ve12 +1 -1
@@ -427,7 +428,7 @@ out_mod:
 	return NULL;
 }			
 
-int proc_fill_super(struct super_block *s, void *data, int silent)
+int proc_fill_super(struct super_block *s)
 {
 	struct inode * root_inode;
 
fs/proc/root.c renamed from fs/proc/root.c.ve12 +63 -4

107 lines not on this page · raw message

include/linux/pid_namespace.h renamed from include/linux/pid_namespace.h.ve12 +3 -0
@@ -23,6 +23,9 @@ struct pid_namespace {
 	struct kmem_cache *pid_cachep;
 	int level;
 	struct pid_namespace *parent;
+#ifdef CONFIG_PROC_FS
+	struct vfsmount *proc_mnt;
+#endif
 };
 
 extern struct pid_namespace init_pid_ns;
include/linux/proc_fs.h renamed from include/linux/proc_fs.h.ve12 +2 -1
@@ -126,7 +126,8 @@ extern struct proc_dir_entry *create_pro
 extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
 
 extern struct vfsmount *proc_mnt;
-extern int proc_fill_super(struct super_block *,void *,int);
+struct pid_namespace;
+extern int proc_fill_super(struct super_block *);
 extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *);
 
 /*