Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: head/sys/geom/mirror/g_mirror.c 137254 2004-11-05 12:35:21Z pjd $");
---
> __FBSDID("$FreeBSD: head/sys/geom/mirror/g_mirror.c 137259 2004-11-05 17:18:39Z pjd $");
756a757,780
> /*
> * Return 1 if we should check if mirror is idling.
> */
> static int
> g_mirror_check_idle(struct g_mirror_softc *sc)
> {
> struct g_mirror_disk *disk;
>
> if (sc->sc_idle)
> return (0);
> if (sc->sc_provider != NULL && sc->sc_provider->acw == 0)
> return (0);
> /*
> * Check if there are no in-flight requests.
> */
> LIST_FOREACH(disk, &sc->sc_disks, d_next) {
> if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE)
> continue;
> if (disk->d_consumer->index > 0)
> return (0);
> }
> return (1);
> }
>
1509,1520c1533
< #define G_MIRROR_IS_IDLE(sc) ((sc)->sc_idle || \
< ((sc)->sc_provider != NULL && \
< (sc)->sc_provider->acw == 0))
< if (G_MIRROR_IS_IDLE(sc)) {
< /*
< * If we're already in idle state, sleep without
< * a timeout.
< */
< MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP,
< "m:w1", 0);
< G_MIRROR_DEBUG(5, "%s: I'm here 3.", __func__);
< } else {
---
> if (g_mirror_check_idle(sc)) {
1528,1529c1541,1542
< "m:w2", idletime) == EWOULDBLOCK) {
< G_MIRROR_DEBUG(5, "%s: I'm here 4.",
---
> "m:w1", idletime) == EWOULDBLOCK) {
> G_MIRROR_DEBUG(5, "%s: I'm here 3.",
1532,1533c1545,1546
< * No I/O requests in 5 seconds, so mark
< * components as clean.
---
> * No I/O requests in 'idletime' seconds,
> * so mark components as clean.
1536a1550,1553
> G_MIRROR_DEBUG(5, "%s: I'm here 4.", __func__);
> } else {
> MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP,
> "m:w2", 0);