Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Oleg Nesterov and committed by
Linus Torvalds
2c03376d 47fecca1

+5 -5
+1 -1
fs/proc/internal.h
··· 268 268 * task_[no]mmu.c 269 269 */ 270 270 struct proc_maps_private { 271 - struct pid *pid; 271 + struct inode *inode; 272 272 struct task_struct *task; 273 273 struct mm_struct *mm; 274 274 #ifdef CONFIG_MMU
+2 -2
fs/proc/task_mmu.c
··· 164 164 if (last_addr == -1UL) 165 165 return NULL; 166 166 167 - priv->task = get_pid_task(priv->pid, PIDTYPE_PID); 167 + priv->task = get_proc_task(priv->inode); 168 168 if (!priv->task) 169 169 return ERR_PTR(-ESRCH); 170 170 ··· 231 231 if (!priv) 232 232 return -ENOMEM; 233 233 234 - priv->pid = proc_pid(inode); 234 + priv->inode = inode; 235 235 priv->mm = proc_mem_open(inode, PTRACE_MODE_READ); 236 236 if (IS_ERR(priv->mm)) { 237 237 int err = PTR_ERR(priv->mm);
+2 -2
fs/proc/task_nommu.c
··· 212 212 loff_t n = *pos; 213 213 214 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 216 if (!priv->task) 217 217 return ERR_PTR(-ESRCH); 218 218 ··· 276 276 if (!priv) 277 277 return -ENOMEM; 278 278 279 - priv->pid = proc_pid(inode); 279 + priv->inode = inode; 280 280 priv->mm = proc_mem_open(inode, PTRACE_MODE_READ); 281 281 if (IS_ERR(priv->mm)) { 282 282 int err = PTR_ERR(priv->mm);