summaryrefslogtreecommitdiffstats
path: root/sys/geom/mirror
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-04-28 12:13:49 +0000
committerpjd <pjd@FreeBSD.org>2006-04-28 12:13:49 +0000
commitc930d9ab2f78617e95e5e019115a191abfaad141 (patch)
treea16f57648472687b485e21cfc11dc876fcf216d9 /sys/geom/mirror
parente14f1c3b3b31e7f6c28cef5acc87f4c7373d288c (diff)
downloadFreeBSD-src-c930d9ab2f78617e95e5e019115a191abfaad141.zip
FreeBSD-src-c930d9ab2f78617e95e5e019115a191abfaad141.tar.gz
- Remove dead code.
- Comment possible event miss, which isn't critical, but probably can be fixed by replacing the event lock usage with the queue lock. MFC after: 2 weeks
Diffstat (limited to 'sys/geom/mirror')
-rw-r--r--sys/geom/mirror/g_mirror.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 80cac30..27c6b88 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -1784,14 +1784,6 @@ g_mirror_worker(void *arg)
mtx_lock(&sc->sc_queue_mtx);
bp = bioq_first(&sc->sc_queue);
if (bp == NULL) {
- if (ep != NULL) {
- /*
- * We have a pending even, try to serve it
- * again.
- */
- mtx_unlock(&sc->sc_queue_mtx);
- continue;
- }
if ((sc->sc_flags &
G_MIRROR_DEVICE_FLAG_DESTROY) != 0) {
mtx_unlock(&sc->sc_queue_mtx);
@@ -1803,6 +1795,15 @@ g_mirror_worker(void *arg)
mtx_lock(&sc->sc_queue_mtx);
}
sx_xunlock(&sc->sc_lock);
+ /*
+ * XXX: We can miss an event here, because an event
+ * can be added without sx-device-lock and without
+ * mtx-queue-lock. Maybe I should just stop using
+ * dedicated mutex for events synchronization and
+ * stick with the queue lock?
+ * The event will hang here until next I/O request
+ * or next event is received.
+ */
MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "m:w1",
timeout * hz);
sx_xlock(&sc->sc_lock);
OpenPOWER on IntegriCloud