summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/vm/device_pager.c3
-rw-r--r--sys/vm/vnode_pager.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index 90913e0..4a4c34a 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -213,6 +213,7 @@ dev_pager_getpages(object, m, count, reqpage)
dev = object->handle;
offset = m[reqpage]->pindex;
VM_OBJECT_UNLOCK(object);
+ mtx_lock(&Giant);
prot = PROT_READ; /* XXX should pass in? */
mapfunc = devsw(dev)->d_mmap;
@@ -221,6 +222,8 @@ dev_pager_getpages(object, m, count, reqpage)
ret = (*mapfunc)(dev, (vm_offset_t)offset << PAGE_SHIFT, &paddr, prot);
KASSERT(ret == 0, ("dev_pager_getpage: map function returns error"));
+ mtx_unlock(&Giant);
+
/*
* Replace the passed in reqpage page with our own fake page and
* free up the all of the original pages.
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 1cce9ab..a85aee2 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -618,9 +618,11 @@ vnode_pager_getpages(object, m, count, reqpage)
vp = object->handle;
VM_OBJECT_UNLOCK(object);
+ mtx_lock(&Giant);
rtval = VOP_GETPAGES(vp, m, bytes, reqpage, 0);
KASSERT(rtval != EOPNOTSUPP,
("vnode_pager: FS getpages not implemented\n"));
+ mtx_unlock(&Giant);
VM_OBJECT_LOCK(object);
return rtval;
}
OpenPOWER on IntegriCloud