Maintain the lock on a vm object when calling vm_page_grab().

This commit is contained in:
Alan Cox 2003-06-25 04:53:56 +00:00
parent ba10c47105
commit dd5e55f872

View File

@ -1701,10 +1701,8 @@ swp_pager_force_pagein(struct swblock *swap, int idx)
VM_OBJECT_LOCK(object);
vm_object_pip_add(object, 1);
VM_OBJECT_UNLOCK(object);
m = vm_page_grab(object, pindex + idx, VM_ALLOC_NORMAL|VM_ALLOC_RETRY);
if (m->valid == VM_PAGE_BITS_ALL) {
VM_OBJECT_LOCK(object);
vm_object_pip_subtract(object, 1);
VM_OBJECT_UNLOCK(object);
vm_page_lock_queues();
@ -1719,7 +1717,6 @@ swp_pager_force_pagein(struct swblock *swap, int idx)
if (swap_pager_getpages(object, &m, 1, 0) !=
VM_PAGER_OK)
panic("swap_pager_force_pagein: read from swap failed");/*XXX*/
VM_OBJECT_LOCK(object);
vm_object_pip_subtract(object, 1);
VM_OBJECT_UNLOCK(object);