Perform vm_object_lock() and vm_object_unlock() around

vm_object_page_remove().
This commit is contained in:
Alan Cox 2002-12-15 05:41:56 +00:00
parent 70a3c70ad7
commit 475e8011ab
2 changed files with 4 additions and 0 deletions

View File

@ -1171,8 +1171,10 @@ vinvalbuf(vp, flags, cred, td, slpflag, slptimeo)
* Destroy the copy in the VM cache, too.
*/
if (VOP_GETVOBJECT(vp, &object) == 0) {
vm_object_lock(object);
vm_object_page_remove(object, 0, 0,
(flags & V_SAVE) ? TRUE : FALSE);
vm_object_unlock(object);
}
#ifdef INVARIANTS

View File

@ -311,8 +311,10 @@ vnode_pager_setsize(vp, nsize)
vm_freeze_copyopts(object, OFF_TO_IDX(nsize), object->size);
#endif
if (nobjsize < object->size) {
vm_object_lock(object);
vm_object_page_remove(object, nobjsize, object->size,
FALSE);
vm_object_unlock(object);
}
/*
* this gets rid of garbage at the end of a page that is now