aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linprocfs/linprocfs.c
diff options
context:
space:
mode:
authorDoug Moore <dougm@FreeBSD.org>2019-10-08 07:14:21 +0000
committerDoug Moore <dougm@FreeBSD.org>2019-10-08 07:14:21 +0000
commit2288078c5eafcfa1905ea32b13c5f30e295f0c6d (patch)
tree19f46dd5e011807e8b7bd0ea7e906d8ae57a261d /sys/compat/linprocfs/linprocfs.c
parentdbef5f71556ebda300912c99b3b02719ca9e28bc (diff)
Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map.
In case the implementation ever changes from using a chain of next pointers, then changing the macro definition will be necessary, but changing all the files that iterate over vm_map entries will not. Drop a counter in vm_object.c that would have an effect only if the vm_map entry count was wrong. Discussed with: alc Reviewed by: markj Tested by: pho (earlier version) Differential Revision: https://reviews.freebsd.org/D21882
Notes
Notes: svn path=/head/; revision=353298
Diffstat (limited to 'sys/compat/linprocfs/linprocfs.c')
-rw-r--r--sys/compat/linprocfs/linprocfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 771579677f1e..8c1f387ca4c0 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -1174,8 +1174,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
l_map_str = l32_map_str;
map = &vm->vm_map;
vm_map_lock_read(map);
- for (entry = map->header.next; entry != &map->header;
- entry = entry->next) {
+ VM_MAP_ENTRY_FOREACH(entry, map) {
name = "";
freename = NULL;
if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)