summaryrefslogtreecommitdiffstats
path: root/sys/geom/gate
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-03-18 13:11:43 +0000
committerpjd <pjd@FreeBSD.org>2010-03-18 13:11:43 +0000
commitcf2b4e13961ec4a3a2103497e3d9111d8a7cc252 (patch)
treedc17b6e42bd2c7b5683d3197fe56fd480dedb4d6 /sys/geom/gate
parent1afdf5764e23446aae43fcbc2a8d90d1142caf2c (diff)
downloadFreeBSD-src-cf2b4e13961ec4a3a2103497e3d9111d8a7cc252.zip
FreeBSD-src-cf2b4e13961ec4a3a2103497e3d9111d8a7cc252.tar.gz
Simplify loops.
Diffstat (limited to 'sys/geom/gate')
-rw-r--r--sys/geom/gate/g_gate.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c
index 952e856..dd69a87 100644
--- a/sys/geom/gate/g_gate.c
+++ b/sys/geom/gate/g_gate.c
@@ -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) {
- bioq_remove(&sc->sc_inqueue, bp);
- sc->sc_queue_count--;
- G_GATE_LOGREQ(1, bp, "Request canceled.");
- g_io_deliver(bp, ENXIO);
- } else {
- break;
- }
+ 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);
}
- for (;;) {
- bp = bioq_first(&sc->sc_outqueue);
- if (bp != 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;
- }
+ 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);
}
mtx_unlock(&sc->sc_queue_mtx);
g_topology_unlock();
OpenPOWER on IntegriCloud