1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-14 14:55:41 +00:00

Simplify loops.

This commit is contained in:
Pawel Jakub Dawidek 2010-03-18 13:11:43 +00:00
parent 0917631f16
commit b0990a1dae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=205279

View File

@ -109,27 +109,17 @@ g_gate_destroy(struct g_gate_softc *sc, boolean_t force)
g_orphan_provider(pp, ENXIO);
callout_drain(&sc->sc_callout);
mtx_lock(&sc->sc_queue_mtx);
for (;;) {
bp = bioq_first(&sc->sc_inqueue);
if (bp != NULL) {
while ((bp = bioq_first(&sc->sc_inqueue)) != NULL) {
bioq_remove(&sc->sc_inqueue, bp);
sc->sc_queue_count--;
G_GATE_LOGREQ(1, bp, "Request canceled.");
g_io_deliver(bp, ENXIO);
} else {
break;
}
}
for (;;) {
bp = bioq_first(&sc->sc_outqueue);
if (bp != NULL) {
while ((bp = bioq_first(&sc->sc_outqueue)) != NULL) {
bioq_remove(&sc->sc_outqueue, bp);
sc->sc_queue_count--;
G_GATE_LOGREQ(1, bp, "Request canceled.");
g_io_deliver(bp, ENXIO);
} else {
break;
}
}
mtx_unlock(&sc->sc_queue_mtx);
g_topology_unlock();