diff options
author | alc <alc@FreeBSD.org> | 2004-04-23 06:10:58 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-04-23 06:10:58 +0000 |
commit | 72331bccaff373675b95257bc4cf99fd67e27efd (patch) | |
tree | cc36e44ff563ac16d228b493b6255508b5c7dbe3 /sys/vm | |
parent | 800bba64fe69c02c7b292d0d136953ef3749cdc8 (diff) | |
download | FreeBSD-src-72331bccaff373675b95257bc4cf99fd67e27efd.zip FreeBSD-src-72331bccaff373675b95257bc4cf99fd67e27efd.tar.gz |
Push down Giant into vm_pager_get_pages(). The only get pages methods that
require Giant are in the device and vnode pagers.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/device_pager.c | 3 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 2 |
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; } |