diff options
author | pjd <pjd@FreeBSD.org> | 2006-04-12 12:18:44 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-04-12 12:18:44 +0000 |
commit | dd51e2368bca8a673873f5f77b5a052265ffcde7 (patch) | |
tree | b5e3be313ec4d6e0da2fd7f23ec79daf88d8928d /sys/geom | |
parent | b8538a9381caf696a8625ee98db4f459858a8580 (diff) | |
download | FreeBSD-src-dd51e2368bca8a673873f5f77b5a052265ffcde7.zip FreeBSD-src-dd51e2368bca8a673873f5f77b5a052265ffcde7.tar.gz |
Pass BIO_GETATTR requests down.
MFC after: 1 week
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; } } |