aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-07-10 18:23:34 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-11-19 06:09:35 -0500
commitae06c7c83fc6e97ba247a261921c101960f3d28f (patch)
treef7328e9b5aadaae1c6d4886147249d38b35de277 /fs/proc/base.c
parente656d8a6f7fdf7612d2f5771f0ddfca9487f59d9 (diff)
procfs: Don't cache a pid in the root inode.
Now that we have s_fs_info pointing to our pid namespace the original reason for the proc root inode having a struct pid is gone. Caching a pid in the root inode has led to some complicated code. Now that we don't need the struct pid, just remove it. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index cbe454e94af8..6177fc238fdb 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2714,19 +2714,12 @@ static int fake_filldir(void *buf, const char *name, int namelen,
2714/* for the /proc/ directory itself, after non-process stuff has been done */ 2714/* for the /proc/ directory itself, after non-process stuff has been done */
2715int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir) 2715int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
2716{ 2716{
2717 unsigned int nr;
2718 struct task_struct *reaper;
2719 struct tgid_iter iter; 2717 struct tgid_iter iter;
2720 struct pid_namespace *ns; 2718 struct pid_namespace *ns;
2721 filldir_t __filldir; 2719 filldir_t __filldir;
2722 2720
2723 if (filp->f_pos >= PID_MAX_LIMIT + TGID_OFFSET) 2721 if (filp->f_pos >= PID_MAX_LIMIT + TGID_OFFSET)
2724 goto out_no_task; 2722 goto out;
2725 nr = filp->f_pos - FIRST_PROCESS_ENTRY;
2726
2727 reaper = get_proc_task(filp->f_path.dentry->d_inode);
2728 if (!reaper)
2729 goto out_no_task;
2730 2723
2731 ns = filp->f_dentry->d_sb->s_fs_info; 2724 ns = filp->f_dentry->d_sb->s_fs_info;
2732 iter.task = NULL; 2725 iter.task = NULL;
@@ -2747,8 +2740,6 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
2747 } 2740 }
2748 filp->f_pos = PID_MAX_LIMIT + TGID_OFFSET; 2741 filp->f_pos = PID_MAX_LIMIT + TGID_OFFSET;
2749out: 2742out:
2750 put_task_struct(reaper);
2751out_no_task:
2752 return 0; 2743 return 0;
2753} 2744}
2754 2745