alistair23-linux/fs/proc
Matt Helsley 925d1c401f procfs task exe symlink
The kernel implements readlink of /proc/pid/exe by getting the file from
the first executable VMA.  Then the path to the file is reconstructed and
reported as the result.

Because of the VMA walk the code is slightly different on nommu systems.
This patch avoids separate /proc/pid/exe code on nommu systems.  Instead of
walking the VMAs to find the first executable file-backed VMA we store a
reference to the exec'd file in the mm_struct.

That reference would prevent the filesystem holding the executable file
from being unmounted even after unmapping the VMAs.  So we track the number
of VM_EXECUTABLE VMAs and drop the new reference when the last one is
unmapped.  This avoids pinning the mounted filesystem.

[akpm@linux-foundation.org: improve comments]
[yamamoto@valinux.co.jp: fix dup_mmap]
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: David Howells <dhowells@redhat.com>
Cc:"Eric W. Biederman" <ebiederm@xmission.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:17 -07:00
..
array.c proc: seqfile convert proc_pid_status to properly handle pid namespaces 2008-02-08 09:22:24 -08:00
base.c procfs task exe symlink 2008-04-29 08:06:17 -07:00
generic.c proc: print more information when removing non-empty directories 2008-04-29 08:06:17 -07:00
inode-alloc.txt
inode.c
internal.h procfs task exe symlink 2008-04-29 08:06:17 -07:00
kcore.c aout: remove unnecessary inclusions of {asm, linux}/a.out.h 2008-02-08 09:22:30 -08:00
kmsg.c
Makefile
mmu.c
nommu.c d_path: Make seq_path() use a struct path argument 2008-02-14 21:17:08 -08:00
proc_devtree.c
proc_misc.c vmalloc: show vmalloced areas via /proc/vmallocinfo 2008-04-28 08:58:21 -07:00
proc_net.c [NETNS]: Remove ifdef CONFIG_NET braces in fs/proc/proc_net.c. 2008-04-02 00:10:04 -07:00
proc_sysctl.c Embed a struct path into struct nameidata instead of nd->{dentry,mnt} 2008-02-14 21:13:33 -08:00
proc_tty.c procfs: constify function pointer tables 2008-02-08 09:22:38 -08:00
root.c proc: fix ->open'less usage due to ->proc_fops flip 2008-02-08 09:22:24 -08:00
task_mmu.c procfs task exe symlink 2008-04-29 08:06:17 -07:00
task_nommu.c procfs task exe symlink 2008-04-29 08:06:17 -07:00
vmcore.c aout: remove unnecessary inclusions of {asm, linux}/a.out.h 2008-02-08 09:22:30 -08:00