diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-10-09 18:25:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:25:50 -0400 |
commit | 2c03376d2db005869b1d4449097d51c96196529e (patch) | |
tree | cb372cc5bc0b4cb9813a5e70df3f6d5c2fa040b6 /fs/proc | |
parent | 47fecca15c0944924423390fe21b956eea57da30 (diff) |
proc/maps: replace proc_maps_private->pid with "struct inode *inode"
m_start() can use get_proc_task() instead, and "struct inode *"
provides more potentially useful info, see the next changes.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.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/internal.h | 2 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 4 | ||||
-rw-r--r-- | fs/proc/task_nommu.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index d27182854a28..aa7a0ee182e1 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h | |||
@@ -268,7 +268,7 @@ extern int proc_remount(struct super_block *, int *, char *); | |||
268 | * task_[no]mmu.c | 268 | * task_[no]mmu.c |
269 | */ | 269 | */ |
270 | struct proc_maps_private { | 270 | struct proc_maps_private { |
271 | struct pid *pid; | 271 | struct inode *inode; |
272 | struct task_struct *task; | 272 | struct task_struct *task; |
273 | struct mm_struct *mm; | 273 | struct mm_struct *mm; |
274 | #ifdef CONFIG_MMU | 274 | #ifdef CONFIG_MMU |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 34d93a1cdeec..4793e4a843b0 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -164,7 +164,7 @@ static void *m_start(struct seq_file *m, loff_t *ppos) | |||
164 | if (last_addr == -1UL) | 164 | if (last_addr == -1UL) |
165 | return NULL; | 165 | return NULL; |
166 | 166 | ||
167 | priv->task = get_pid_task(priv->pid, PIDTYPE_PID); | 167 | priv->task = get_proc_task(priv->inode); |
168 | if (!priv->task) | 168 | if (!priv->task) |
169 | return ERR_PTR(-ESRCH); | 169 | return ERR_PTR(-ESRCH); |
170 | 170 | ||
@@ -231,7 +231,7 @@ static int proc_maps_open(struct inode *inode, struct file *file, | |||
231 | if (!priv) | 231 | if (!priv) |
232 | return -ENOMEM; | 232 | return -ENOMEM; |
233 | 233 | ||
234 | priv->pid = proc_pid(inode); | 234 | priv->inode = inode; |
235 | priv->mm = proc_mem_open(inode, PTRACE_MODE_READ); | 235 | priv->mm = proc_mem_open(inode, PTRACE_MODE_READ); |
236 | if (IS_ERR(priv->mm)) { | 236 | if (IS_ERR(priv->mm)) { |
237 | int err = PTR_ERR(priv->mm); | 237 | int err = PTR_ERR(priv->mm); |
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 429cb7a5419e..f36e213835cc 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c | |||
@@ -212,7 +212,7 @@ static void *m_start(struct seq_file *m, loff_t *pos) | |||
212 | loff_t n = *pos; | 212 | loff_t n = *pos; |
213 | 213 | ||
214 | /* pin the task and mm whilst we play with them */ | 214 | /* pin the task and mm whilst we play with them */ |
215 | priv->task = get_pid_task(priv->pid, PIDTYPE_PID); | 215 | priv->task = get_proc_task(priv->inode); |
216 | if (!priv->task) | 216 | if (!priv->task) |
217 | return ERR_PTR(-ESRCH); | 217 | return ERR_PTR(-ESRCH); |
218 | 218 | ||
@@ -276,7 +276,7 @@ static int maps_open(struct inode *inode, struct file *file, | |||
276 | if (!priv) | 276 | if (!priv) |
277 | return -ENOMEM; | 277 | return -ENOMEM; |
278 | 278 | ||
279 | priv->pid = proc_pid(inode); | 279 | priv->inode = inode; |
280 | priv->mm = proc_mem_open(inode, PTRACE_MODE_READ); | 280 | priv->mm = proc_mem_open(inode, PTRACE_MODE_READ); |
281 | if (IS_ERR(priv->mm)) { | 281 | if (IS_ERR(priv->mm)) { |
282 | int err = PTR_ERR(priv->mm); | 282 | int err = PTR_ERR(priv->mm); |