From f566a0b6baa2ac4f8539f7a9a10b61edcbd00ea7 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 23 Jun 2003 06:15:05 +0000 Subject: [PATCH] Assert that the vm object is locked on entry to vm_pager_get_pages(). --- sys/vm/vm_pager.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/vm/vm_pager.h b/sys/vm/vm_pager.h index 4f2cf1271428..4aee76ccc1bc 100644 --- a/sys/vm/vm_pager.h +++ b/sys/vm/vm_pager.h @@ -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); }