diff options
author | pjd <pjd@FreeBSD.org> | 2006-04-28 12:13:49 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-04-28 12:13:49 +0000 |
commit | c930d9ab2f78617e95e5e019115a191abfaad141 (patch) | |
tree | a16f57648472687b485e21cfc11dc876fcf216d9 /sys/geom | |
parent | e14f1c3b3b31e7f6c28cef5acc87f4c7373d288c (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 17 | ||||
-rw-r--r-- | sys/geom/raid3/g_raid3.c | 18 |
2 files changed, 18 insertions, 17 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); diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index 3efa279..bb4f042 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -2005,15 +2005,6 @@ g_raid3_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); - tsleep(ep, PRIBIO, "r3:top1", hz / 5); - continue; - } if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROY) != 0) { mtx_unlock(&sc->sc_queue_mtx); @@ -2025,6 +2016,15 @@ g_raid3_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, "r3:w1", timeout * hz); sx_xlock(&sc->sc_lock); |