- Hold the page queues lock around vm_page_hold().

- Assert that the page queues lock rather than Giant is held in
   vm_page_hold().
This commit is contained in:
Alan Cox 2003-01-20 09:24:03 +00:00
parent a5382a0701
commit 28ec30cd9f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109554
2 changed files with 4 additions and 1 deletions

View File

@ -3579,7 +3579,9 @@ vmapbuf(struct buf *bp)
if (pa == 0)
panic("vmapbuf: page not present");
m = PHYS_TO_VM_PAGE(pa);
vm_page_lock_queues();
vm_page_hold(m);
vm_page_unlock_queues();
bp->b_pages[pidx] = m;
}
if (pidx > btoc(MAXPHYS))

View File

@ -358,7 +358,8 @@ vm_page_io_finish(vm_page_t m)
void
vm_page_hold(vm_page_t mem)
{
GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
mem->hold_count++;
}