diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2012-05-31 19:26:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 20:49:28 -0400 |
commit | e7dcd9990e42ccfc798d4eb55e2dbf9d7d434c6b (patch) | |
tree | ab9d03a5caa1e3fa5b65a9614f699a05632d33c6 /fs/proc | |
parent | b409e578d9a4ec95913e06d8fea2a33f1754ea69 (diff) |
proc: remove mm_for_maps()
mm_for_maps() is a simple wrapper for mm_access(), and the name is
misleading, so just remove it and use mm_access() directly.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 7 | ||||
-rw-r--r-- | fs/proc/internal.h | 2 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 4 | ||||
-rw-r--r-- | fs/proc/task_nommu.c | 2 |
4 files changed, 4 insertions, 11 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index e2d234243269..cca635d252d4 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 | ||
202 | struct mm_struct *mm_for_maps(struct task_struct *task) | ||
203 | { | ||
204 | return mm_access(task, PTRACE_MODE_READ); | ||
205 | } | ||
206 | |||
207 | static int proc_pid_cmdline(struct task_struct *task, char * buffer) | 202 | static 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 | ||
244 | static int proc_pid_auxv(struct task_struct *task, char *buffer) | 239 | static 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 5f79bb8b4c60..a30643784db5 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 | ||
34 | extern 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) |
38 | extern void get_vmalloc_info(struct vmalloc_info *vmi); | 36 | extern void get_vmalloc_info(struct vmalloc_info *vmi); |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 7faaf2acc570..83ede6e3b5ec 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 74fe164d1b23..1ccfa537f5f5 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; |