Pass BIO_GETATTR requests down.

MFC after:	1 week
This commit is contained in:
Pawel Jakub Dawidek 2006-04-12 12:18:44 +00:00
parent 00a480ac5c
commit d3a1be900a

View File

@ -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;
}
}