summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_amap_i.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/uvm/uvm_amap_i.h')
-rw-r--r--sys/uvm/uvm_amap_i.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/uvm/uvm_amap_i.h b/sys/uvm/uvm_amap_i.h
index 68cdc428b62..a290527b378 100644
--- a/sys/uvm/uvm_amap_i.h
+++ b/sys/uvm/uvm_amap_i.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_amap_i.h,v 1.13 2006/06/21 16:20:05 mickey Exp $ */
+/* $OpenBSD: uvm_amap_i.h,v 1.14 2006/07/13 22:51:26 deraadt Exp $ */
/* $NetBSD: uvm_amap_i.h,v 1.15 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -135,9 +135,9 @@ amap_add(aref, offset, anon, replace)
if (amap->am_anon[slot] == NULL)
panic("amap_add: replacing null anon");
- if (amap->am_anon[slot]->an_page != NULL &&
+ if (amap->am_anon[slot]->u.an_page != NULL &&
(amap->am_flags & AMAP_SHARED) != 0) {
- pmap_page_protect(amap->am_anon[slot]->an_page,
+ pmap_page_protect(amap->am_anon[slot]->u.an_page,
VM_PROT_NONE);
/*
* XXX: suppose page is supposed to be wired somewhere?
@@ -255,7 +255,7 @@ amap_unref(amap, offset, len, all)
* if we are the last reference, free the amap and return.
*/
- if (amap->am_ref-- == 1) {
+ if (amap->am_ref == 1) {
amap_wipeout(amap); /* drops final ref and frees */
UVMHIST_LOG(maphist,"<- done (was last ref)!", 0, 0, 0, 0);
return; /* no need to unlock */
@@ -264,6 +264,8 @@ amap_unref(amap, offset, len, all)
/*
* otherwise just drop the reference count(s)
*/
+
+ amap->am_ref--;
if (amap->am_ref == 1 && (amap->am_flags & AMAP_SHARED) != 0)
amap->am_flags &= ~AMAP_SHARED; /* clear shared flag */
#ifdef UVM_AMAP_PPREF