diff options
author | vangyzen <vangyzen@FreeBSD.org> | 2015-10-02 14:36:41 +0000 |
---|---|---|
committer | vangyzen <vangyzen@FreeBSD.org> | 2015-10-02 14:36:41 +0000 |
commit | 8f32d0c83ec420d8944fbdbd6a323756c04c1546 (patch) | |
tree | 50f81cbd9709385229eb7c8ec9c23fe0614e7b02 /sys/kern/kern_proc.c | |
parent | 7b3b15b30002adb4bfb1e6836e4a76225fff3d6f (diff) | |
download | FreeBSD-src-8f32d0c83ec420d8944fbdbd6a323756c04c1546.zip FreeBSD-src-8f32d0c83ec420d8944fbdbd6a323756c04c1546.tar.gz |
MFC r283924
Provide vnode in memory map info for files on tmpfs
When providing memory map information to userland, populate the vnode pointer
for tmpfs files. Set the memory mapping to appear as a vnode type, to match
FreeBSD 9 behavior.
This fixes the use of tmpfs files with the dtrace pid provider,
procstat -v, procfs, linprocfs, pmc (pmcstat), and ptrace (PT_VM_ENTRY).
Submitted by: Eric Badger <eric@badgerio.us> (initial revision)
Obtained from: Dell Inc.
PR: 198431
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r-- | sys/kern/kern_proc.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 63ecf0f..a8580a5 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2074,7 +2074,15 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) vref(vp); break; case OBJT_SWAP: - kve->kve_type = KVME_TYPE_SWAP; + if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { + kve->kve_type = KVME_TYPE_VNODE; + if ((lobj->flags & OBJ_TMPFS) != 0) { + vp = lobj->un_pager.swp.swp_tmpfs; + vref(vp); + } + } else { + kve->kve_type = KVME_TYPE_SWAP; + } break; case OBJT_DEVICE: kve->kve_type = KVME_TYPE_DEVICE; @@ -2300,7 +2308,15 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb) vref(vp); break; case OBJT_SWAP: - kve->kve_type = KVME_TYPE_SWAP; + if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { + kve->kve_type = KVME_TYPE_VNODE; + if ((lobj->flags & OBJ_TMPFS) != 0) { + vp = lobj->un_pager.swp.swp_tmpfs; + vref(vp); + } + } else { + kve->kve_type = KVME_TYPE_SWAP; + } break; case OBJT_DEVICE: kve->kve_type = KVME_TYPE_DEVICE; |