Push down Giant into vm_pager_get_pages(). The only get pages methods that

require Giant are in the device and vnode pagers.
This commit is contained in:
Alan Cox 2004-04-23 06:10:58 +00:00
parent 6c92cac930
commit 87aefa499a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128570
2 changed files with 5 additions and 0 deletions

View File

@ -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.

View File

@ -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;
}