sysctl vm.objects: report objects backing posix shm segments

Add the KVMO_FLAG_POSIXSHM flag.  Fill the path.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
This commit is contained in:
Konstantin Belousov 2024-10-07 04:55:16 +03:00
parent a8c641bbcb
commit b0b18b57a5
2 changed files with 6 additions and 0 deletions

View File

@ -582,6 +582,7 @@ struct kinfo_vmentry {
#define kve_obj kve_type_spec._kve_obj
#define KVMO_FLAG_SYSVSHM 0x0001
#define KVMO_FLAG_POSIXSHM 0x0002
/*
* The "vm.objects" sysctl provides a list of all VM objects in the system

View File

@ -2601,6 +2601,11 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only)
kvo->kvo_vn_fileid = key;
kvo->kvo_vn_fsid_freebsd11 = seq;
}
if ((obj->flags & OBJ_POSIXSHM) != 0) {
kvo->kvo_flags |= KVMO_FLAG_POSIXSHM;
shm_get_path(obj, kvo->kvo_path,
sizeof(kvo->kvo_path));
}
if (vp != NULL) {
vn_fullpath(vp, &fullpath, &freepath);
vn_lock(vp, LK_SHARED | LK_RETRY);