diff options
| author | Alan Cox <alc@FreeBSD.org> | 2004-05-25 05:51:17 +0000 |
|---|---|---|
| committer | Alan Cox <alc@FreeBSD.org> | 2004-05-25 05:51:17 +0000 |
| commit | 3ffbc0cd8e31bf6acb7028d76eee81dffb6575fc (patch) | |
| tree | 5f91f20ee19b40225e097d4e3a3f25808e3abc69 | |
| parent | 09a98d8ce9d5f71eeb579c23ca1751d741489f71 (diff) | |
Notes
| -rw-r--r-- | sys/vm/vm_map.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 53244004ea4b..d27df6f51b38 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1696,10 +1696,10 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, goto done; } /* - * Require that the entry is wired. + * If system unwiring, require that the entry is system wired. */ - if (entry->wired_count == 0 || (user_unwire && - (entry->eflags & MAP_ENTRY_USER_WIRED) == 0)) { + if (!user_unwire && entry->wired_count < ((entry->eflags & + MAP_ENTRY_USER_WIRED) ? 2 : 1)) { end = entry->end; rv = KERN_INVALID_ARGUMENT; goto done; @@ -1718,7 +1718,8 @@ done: } entry = first_entry; while (entry != &map->header && entry->start < end) { - if (rv == KERN_SUCCESS) { + if (rv == KERN_SUCCESS && (!user_unwire || + (entry->eflags & MAP_ENTRY_USER_WIRED))) { if (user_unwire) entry->eflags &= ~MAP_ENTRY_USER_WIRED; entry->wired_count--; |
