aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/base.c7
-rw-r--r--fs/proc/internal.h2
-rw-r--r--fs/proc/task_mmu.c4
-rw-r--r--fs/proc/task_nommu.c2
4 files changed, 4 insertions, 11 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index e2d23424326..cca635d252d 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -199,11 +199,6 @@ static int proc_root_link(struct dentry *dentry, struct path *path)
199 return result; 199 return result;
200} 200}
201 201
202struct mm_struct *mm_for_maps(struct task_struct *task)
203{
204 return mm_access(task, PTRACE_MODE_READ);
205}
206
207static int proc_pid_cmdline(struct task_struct *task, char * buffer) 202static int proc_pid_cmdline(struct task_struct *task, char * buffer)
208{ 203{
209 int res = 0; 204 int res = 0;
@@ -243,7 +238,7 @@ out:
243 238
244static int proc_pid_auxv(struct task_struct *task, char *buffer) 239static int proc_pid_auxv(struct task_struct *task, char *buffer)
245{ 240{
246 struct mm_struct *mm = mm_for_maps(task); 241 struct mm_struct *mm = mm_access(task, PTRACE_MODE_READ);
247 int res = PTR_ERR(mm); 242 int res = PTR_ERR(mm);
248 if (mm && !IS_ERR(mm)) { 243 if (mm && !IS_ERR(mm)) {
249 unsigned int nwords = 0; 244 unsigned int nwords = 0;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 5f79bb8b4c6..a30643784db 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -31,8 +31,6 @@ struct vmalloc_info {
31 unsigned long largest_chunk; 31 unsigned long largest_chunk;
32}; 32};
33 33
34extern struct mm_struct *mm_for_maps(struct task_struct *);
35
36#ifdef CONFIG_MMU 34#ifdef CONFIG_MMU
37#define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) 35#define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START)
38extern void get_vmalloc_info(struct vmalloc_info *vmi); 36extern void get_vmalloc_info(struct vmalloc_info *vmi);
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 7faaf2acc57..83ede6e3b5e 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -125,7 +125,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
125 if (!priv->task) 125 if (!priv->task)
126 return ERR_PTR(-ESRCH); 126 return ERR_PTR(-ESRCH);
127 127
128 mm = mm_for_maps(priv->task); 128 mm = mm_access(priv->task, PTRACE_MODE_READ);
129 if (!mm || IS_ERR(mm)) 129 if (!mm || IS_ERR(mm))
130 return mm; 130 return mm;
131 down_read(&mm->mmap_sem); 131 down_read(&mm->mmap_sem);
@@ -919,7 +919,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
919 if (!pm.buffer) 919 if (!pm.buffer)
920 goto out_task; 920 goto out_task;
921 921
922 mm = mm_for_maps(task); 922 mm = mm_access(task, PTRACE_MODE_READ);
923 ret = PTR_ERR(mm); 923 ret = PTR_ERR(mm);
924 if (!mm || IS_ERR(mm)) 924 if (!mm || IS_ERR(mm))
925 goto out_free; 925 goto out_free;
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 74fe164d1b2..1ccfa537f5f 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -223,7 +223,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
223 if (!priv->task) 223 if (!priv->task)
224 return ERR_PTR(-ESRCH); 224 return ERR_PTR(-ESRCH);
225 225
226 mm = mm_for_maps(priv->task); 226 mm = mm_access(priv->task, PTRACE_MODE_READ);
227 if (!mm || IS_ERR(mm)) { 227 if (!mm || IS_ERR(mm)) {
228 put_task_struct(priv->task); 228 put_task_struct(priv->task);
229 priv->task = NULL; 229 priv->task = NULL;