summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-03-14 00:24:30 +0000
committeralc <alc@FreeBSD.org>2004-03-14 00:24:30 +0000
commit10b8b458736ddef67818a121bb7ccb73be0882bf (patch)
tree092abcd4bfcfbe3750f068b019f3fb3e29e422f5
parent9a2f75f5676ee4b8f53a05a48def0e31f8fc2cbf (diff)
downloadFreeBSD-src-10b8b458736ddef67818a121bb7ccb73be0882bf.zip
FreeBSD-src-10b8b458736ddef67818a121bb7ccb73be0882bf.tar.gz
Allow swap-backed devices to run without Giant.
-rw-r--r--sys/dev/md/md.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 6e345da..006f07f 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -542,7 +542,6 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
lastp = (bp->bio_offset + bp->bio_length - 1) / PAGE_SIZE;
lastend = (bp->bio_offset + bp->bio_length - 1) % PAGE_SIZE + 1;
- mtx_lock(&Giant);
kva = kmem_alloc_nofault(kernel_map, PAGE_SIZE);
VM_OBJECT_LOCK(sc->object);
@@ -602,7 +601,6 @@ printf("wire_count %d busy %d flags %x hold_count %d act_count %d queue %d valid
vm_object_set_writeable_dirty(sc->object);
VM_OBJECT_UNLOCK(sc->object);
kmem_free(kernel_map, kva, sc->secsize);
- mtx_unlock(&Giant);
return (0);
}
}
@@ -618,13 +616,13 @@ md_kthread(void *arg)
curthread->td_base_pri = PRIBIO;
switch (sc->type) {
- case MD_SWAP:
case MD_VNODE:
mtx_lock(&Giant);
hasgiant = 1;
break;
case MD_MALLOC:
case MD_PRELOAD:
+ case MD_SWAP:
default:
hasgiant = 0;
break;
OpenPOWER on IntegriCloud