aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/mirror
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2006-04-28 12:13:49 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2006-04-28 12:13:49 +0000
commita2fe5c6676fe165b82917db14d61c82e884b364f (patch)
treea16f57648472687b485e21cfc11dc876fcf216d9 /sys/geom/mirror
parent06a99fe36f0aac93e7689da6b3f07b727750691f (diff)
downloadsrc-a2fe5c6676fe165b82917db14d61c82e884b364f.tar.gz
src-a2fe5c6676fe165b82917db14d61c82e884b364f.zip
- 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
Notes
Notes: svn path=/head/; revision=158116
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 80cac3069e13..27c6b8869770 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);