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:
parent
6c92cac930
commit
87aefa499a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128570
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user