aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2006-04-12 12:18:44 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2006-04-12 12:18:44 +0000
commitd3a1be900ac5f1d4c5a70244739d63a0ac8ab4ff (patch)
treeb5e3be313ec4d6e0da2fd7f23ec79daf88d8928d /sys/geom
parent00a480ac5c11921f719de292d09b9d1b6541550a (diff)
downloadsrc-d3a1be900ac5f1d4c5a70244739d63a0ac8ab4ff.tar.gz
src-d3a1be900ac5f1d4c5a70244739d63a0ac8ab4ff.zip
Pass BIO_GETATTR requests down.
MFC after: 1 week
Notes
Notes: svn path=/head/; revision=157686
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/eli/g_eli.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index d5dfe95a571a..313eddf0247d 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;
}
}