Date: Sat, 22 May 2021 09:46:37 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: f3253c60b426 - stable/13 - procfs_map: switch to use vm_object_kvme_type Message-ID: <202105220946.14M9kbmw012611@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f3253c60b426ba7ce4c2da47a8ad04f688ced52c commit f3253c60b426ba7ce4c2da47a8ad04f688ced52c Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-05-10 15:20:42 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-05-22 09:38:30 +0000 procfs_map: switch to use vm_object_kvme_type (cherry picked from commit 8b99833ac2538a74d013d101e2b5ec2d9e29d198) --- sys/fs/procfs/procfs_map.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index 9ee49b0149a2..bd4cd2c09c00 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -51,6 +51,7 @@ #include <sys/sysent.h> #endif #include <sys/uio.h> +#include <sys/user.h> #include <sys/vnode.h> #include <fs/pseudofs/pseudofs.h> @@ -85,7 +86,8 @@ procfs_doprocmap(PFS_FILL_ARGS) char *fullpath, *freepath, *type; struct ucred *cred; vm_object_t lobj, nobj, obj, tobj; - int error, privateresident, ref_count, resident, shadow_count, flags; + int error, flags, kvme, privateresident, ref_count, resident; + int shadow_count; vm_offset_t e_start, e_end; vm_eflags_t e_eflags; vm_prot_t e_prot; @@ -155,29 +157,29 @@ procfs_doprocmap(PFS_FILL_ARGS) freepath = NULL; fullpath = "-"; if (lobj) { - vp = NULL; - switch (lobj->type) { - default: - case OBJT_DEFAULT: - type = "default"; - break; - case OBJT_VNODE: - type = "vnode"; - vp = lobj->handle; + kvme = vm_object_kvme_type(lobj, &vp); + if (vp != NULL) vref(vp); + switch (kvme) { + default: + type = "unknown"; break; - case OBJT_SWAP_TMPFS: - type = "vnode"; - if ((lobj->flags & OBJ_TMPFS) != 0) { - vp = lobj->un_pager.swp.swp_tmpfs; - vref(vp); - } + case KVME_TYPE_PHYS: + type = "phys"; break; - case OBJT_SWAP: + case KVME_TYPE_DEFAULT: + case KVME_TYPE_SWAP: type = "swap"; break; - case OBJT_SG: - case OBJT_DEVICE: + case KVME_TYPE_DEAD: + type = "dead"; + break; + case KVME_TYPE_VNODE: + type = "vnode"; + break; + case KVME_TYPE_SG: + case KVME_TYPE_DEVICE: + case KVME_TYPE_MGTDEVICE: type = "device"; break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105220946.14M9kbmw012611>