Assert that the vm object is locked on entry to vm_pager_get_pages().

This commit is contained in:
Alan Cox 2003-06-23 06:15:05 +00:00
parent 0183359659
commit f566a0b6ba

View File

@ -119,17 +119,13 @@ vm_pager_get_pages(
int count,
int reqpage
) {
int is_object_locked;
int r;
if (!(is_object_locked = VM_OBJECT_LOCKED(object)))
VM_OBJECT_LOCK(object);
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
r = (*pagertab[object->type]->pgo_getpages)(object, m, count, reqpage);
if (r == VM_PAGER_OK && m[reqpage]->valid != VM_PAGE_BITS_ALL) {
vm_page_zero_invalid(m[reqpage], TRUE);
}
if (!is_object_locked)
VM_OBJECT_UNLOCK(object);
return (r);
}