aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vnode_pager.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r--sys/vm/vnode_pager.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 69fd5d101c71..cfe9f994e0e3 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -948,8 +948,6 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
nextoff = tfoff + PAGE_SIZE;
mt = m[i];
- vm_page_lock(mt);
- vm_page_lock_queues();
if (nextoff <= object->un_pager.vnp.vnp_size) {
/*
* Read filled up entire page.
@@ -992,17 +990,22 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
* now tell them that it is ok to use
*/
if (!error) {
- if (mt->oflags & VPO_WANTED)
+ if (mt->oflags & VPO_WANTED) {
+ vm_page_lock(mt);
vm_page_activate(mt);
- else
+ vm_page_unlock(mt);
+ } else {
+ vm_page_lock(mt);
vm_page_deactivate(mt);
+ vm_page_unlock(mt);
+ }
vm_page_wakeup(mt);
} else {
+ vm_page_lock(mt);
vm_page_free(mt);
+ vm_page_unlock(mt);
}
}
- vm_page_unlock_queues();
- vm_page_unlock(mt);
}
VM_OBJECT_UNLOCK(object);
if (error) {