- Complete the synchronization of accesses to the swblock hash table.

This commit is contained in:
alc 2003-10-27 05:58:15 +00:00
parent 1c3479f36a
commit bc4efe0cf2

View File

@ -1671,6 +1671,7 @@ swp_pager_force_pagein(struct swblock *swap, int idx)
object = swap->swb_object;
pindex = swap->swb_index;
mtx_unlock(&swhash_mtx);
VM_OBJECT_LOCK(object);
vm_object_pip_add(object, 1);
@ -1732,6 +1733,7 @@ swap_pager_swapoff(struct swdevt *sp, int *sw_used)
for (i = 0; i <= swhash_mask; i++) { /* '<=' is correct here */
restart:
pswap = &swhash[i];
mtx_lock(&swhash_mtx);
while ((swap = *pswap) != NULL) {
for (j = 0; j < SWAP_META_PAGES; ++j) {
v = swap->swb_pages[j];
@ -1748,6 +1750,7 @@ swap_pager_swapoff(struct swdevt *sp, int *sw_used)
}
pswap = &swap->swb_hnext;
}
mtx_unlock(&swhash_mtx);
}
if (waitobj && *sw_used) {
/*