summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-06-08 19:00:40 +0000
committeralc <alc@FreeBSD.org>2002-06-08 19:00:40 +0000
commit564b5ce4573a9f47bb561cd01270f3fcc1d9497a (patch)
treeb1b1276b89bd552c6123646209e6e366bd1b6ae2 /sys
parent21588aac50c3ed9cc68164e5f31e1f63dfb093aa (diff)
downloadFreeBSD-src-564b5ce4573a9f47bb561cd01270f3fcc1d9497a.zip
FreeBSD-src-564b5ce4573a9f47bb561cd01270f3fcc1d9497a.tar.gz
o Simplify vm_map_unwire() by merging the second and third passes
over the caller-specified region.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_map.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index c784ff5..1a43963 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -1576,23 +1576,6 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end,
}
entry = entry->next;
}
- if (first_entry == NULL) {
- result = vm_map_lookup_entry(map, start, &first_entry);
- KASSERT(result, ("vm_map_unwire: lookup failed"));
- }
- entry = first_entry;
- while (entry != &map->header && entry->start < end) {
- if (user_unwire)
- entry->eflags &= ~MAP_ENTRY_USER_WIRED;
- entry->wired_count--;
- if (entry->wired_count == 0) {
- /*
- * Retain the map lock.
- */
- vm_fault_unwire(map, entry->start, entry->end);
- }
- entry = entry->next;
- }
rv = KERN_SUCCESS;
done:
need_wakeup = FALSE;
@@ -1602,6 +1585,17 @@ done:
}
entry = first_entry;
while (entry != &map->header && entry->start < end) {
+ if (rv == KERN_SUCCESS) {
+ if (user_unwire)
+ entry->eflags &= ~MAP_ENTRY_USER_WIRED;
+ entry->wired_count--;
+ if (entry->wired_count == 0) {
+ /*
+ * Retain the map lock.
+ */
+ vm_fault_unwire(map, entry->start, entry->end);
+ }
+ }
KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION,
("vm_map_unwire: in-transition flag missing"));
entry->eflags &= ~MAP_ENTRY_IN_TRANSITION;
OpenPOWER on IntegriCloud