diff options
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/eli/g_eli.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index d5dfe95..313eddf 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -327,6 +327,7 @@ static void g_eli_start(struct bio *bp) { struct g_eli_softc *sc; + struct g_consumer *cp; struct bio *cbp; sc = bp->bio_to->geom->softc; @@ -338,6 +339,7 @@ g_eli_start(struct bio *bp) switch (bp->bio_cmd) { case BIO_READ: case BIO_WRITE: + case BIO_GETATTR: break; case BIO_DELETE: /* @@ -345,7 +347,6 @@ g_eli_start(struct bio *bp) * It could be done by overwritting requested sector with * random data g_eli_overwrites number of times. */ - case BIO_GETATTR: default: g_io_deliver(bp, EOPNOTSUPP); return; @@ -355,9 +356,8 @@ g_eli_start(struct bio *bp) g_io_deliver(bp, ENOMEM); return; } - if (bp->bio_cmd == BIO_READ) { - struct g_consumer *cp; - + switch (bp->bio_cmd) { + case BIO_READ: cbp->bio_done = g_eli_read_done; cp = LIST_FIRST(&sc->sc_geom->consumer); cbp->bio_to = cp->provider; @@ -366,12 +366,21 @@ g_eli_start(struct bio *bp) * Read encrypted data from provider. */ g_io_request(cbp, cp); - } else /* if (bp->bio_cmd == BIO_WRITE) */ { + break; + case BIO_WRITE: bp->bio_driver1 = cbp; mtx_lock(&sc->sc_queue_mtx); bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); + break; + case BIO_GETATTR: + cbp->bio_done = g_std_done; + cp = LIST_FIRST(&sc->sc_geom->consumer); + cbp->bio_to = cp->provider; + G_ELI_LOGREQ(2, bp, "Sending request."); + g_io_request(cbp, cp); + break; } } |