Subject: [PATCH] Modify proc to slict the process tree at the current pspace at mount time. From: Eric W. Biederman Date: 1130619651 -0600 --- fs/proc/inode.c | 3 ++- fs/proc/root.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 7bf711c47af96e50c22c6a1ab8caeb108ff9a373 diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 70527e0..2fb25f7 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -191,6 +191,7 @@ out_fail: int proc_fill_super(struct super_block *s, void *data, int silent) { struct inode * root_inode; + struct pspace *pspace = data; s->s_flags |= MS_NODIRATIME; s->s_blocksize = 1024; @@ -199,7 +200,7 @@ int proc_fill_super(struct super_block * s->s_op = &proc_sops; s->s_time_gran = 1; - root_inode = proc_pspace_make_inode(s, &init_pspace); + root_inode = proc_pspace_make_inode(s, pspace); if (!root_inode) goto out_no_root; s->s_root = d_alloc_root(root_inode); diff --git a/fs/proc/root.c b/fs/proc/root.c index e7f765a..a8be1e6 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -28,10 +28,24 @@ struct proc_dir_entry *proc_net, *proc_n struct proc_dir_entry *proc_sys_root; #endif +static int proc_test_sb(struct super_block *s, void *data) +{ + struct dentry *dentry = s->s_root; + struct inode *inode = dentry->d_inode; + struct task_struct *task = PROC_I(inode)->task; + + return task->pspace == data; +} + +static int proc_set_sb(struct super_block *s, void *data) +{ + return proc_fill_super(s, data, 0); +} + static struct super_block *proc_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { - return get_sb_single(fs_type, flags, data, proc_fill_super); + return sget(fs_type, proc_test_sb, proc_set_sb, current->pspace); } static struct file_system_type proc_fs_type = { -- 1.0.GIT