summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-10-31 05:18:45 +0000
committeralc <alc@FreeBSD.org>2003-10-31 05:18:45 +0000
commit2a6ec0ca670ecd9fe07027def7afe3b818e3c674 (patch)
tree4e332bcf4670178770637445542949c4b04e0db3
parentfa2d8db5b830a979690f5ae175d23f8c675216d1 (diff)
downloadFreeBSD-src-2a6ec0ca670ecd9fe07027def7afe3b818e3c674.zip
FreeBSD-src-2a6ec0ca670ecd9fe07027def7afe3b818e3c674.tar.gz
- Synchronize access to the swdevt's sw_flags with sw_dev_mtx.
- Remove several instances of GIANT_REQUIRED.
-rw-r--r--sys/vm/swap_pager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index e03321e..74597b3 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1896,7 +1896,7 @@ done:
static void
swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count)
{
- GIANT_REQUIRED;
+
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
if (object->type != OBJT_SWAP)
return;
@@ -1945,7 +1945,6 @@ swp_pager_meta_free_all(vm_object_t object)
{
daddr_t index = 0;
- GIANT_REQUIRED;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
if (object->type != OBJT_SWAP)
return;
@@ -2259,11 +2258,13 @@ found:
/*
* Prevent further allocations on this device.
*/
+ mtx_lock(&sw_dev_mtx);
sp->sw_flags |= SW_CLOSING;
for (dvbase = 0; dvbase < sp->sw_end; dvbase += dmmax) {
swap_pager_avail -= blist_fill(sp->sw_blist,
dvbase, dmmax);
}
+ mtx_unlock(&sw_dev_mtx);
/*
* Page in the contents of the device and close it.
OpenPOWER on IntegriCloud