diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/uvm/uvm_page.c | 14 | ||||
-rw-r--r-- | sys/uvm/uvm_vnode.c | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 0da38fc51ed..ed2a8c6f601 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.37 2001/12/04 23:22:42 art Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.38 2001/12/06 12:43:20 art Exp $ */ /* $NetBSD: uvm_page.c,v 1.66 2001/09/10 21:19:43 chris Exp $ */ /* @@ -197,10 +197,14 @@ uvm_pageremove(pg) simple_unlock(&uvm.hashlock); splx(s); - if (UVM_OBJ_IS_VTEXT(pg->uobject)) { - uvmexp.vtextpages--; - } else if (UVM_OBJ_IS_VNODE(pg->uobject)) { - uvmexp.vnodepages--; + if (UVM_OBJ_IS_VTEXT(pg->uobject) || UVM_OBJ_IS_VNODE(pg->uobject)) { + if (UVM_OBJ_IS_VNODE(pg->uobject)) + uvmexp.vnodepages--; + else + uvmexp.vtextpages--; + s = splbio(); + vholdrele((struct vnode *)pg->uobject); + splx(s); } /* object should be locked */ diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index 180acc16e66..67ccf7d605c 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_vnode.c,v 1.29 2001/12/04 23:22:42 art Exp $ */ +/* $OpenBSD: uvm_vnode.c,v 1.30 2001/12/06 12:43:20 art Exp $ */ /* $NetBSD: uvm_vnode.c,v 1.51 2001/08/17 05:53:02 chs Exp $ */ /* @@ -899,6 +899,7 @@ uvn_findpage(uobj, offset, pgp, flags) int flags; { struct vm_page *pg; + int s; UVMHIST_FUNC("uvn_findpage"); UVMHIST_CALLED(ubchist); UVMHIST_LOG(ubchist, "vp %p off 0x%lx", uobj, offset,0,0); @@ -932,6 +933,9 @@ uvn_findpage(uobj, offset, pgp, flags) } else { uvmexp.vnodepages++; } + s = splbio(); + vhold((struct vnode *)uobj); + splx(s); UVMHIST_LOG(ubchist, "alloced",0,0,0,0); break; } else if (flags & UFP_NOCACHE) { |