diff options
author | phk <phk@FreeBSD.org> | 2003-10-06 09:07:35 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-06 09:07:35 +0000 |
commit | c7d1762ad73e1db84fcf7b90e2e257c1828a0033 (patch) | |
tree | 978da971f1dccc39f3d6204c327113c6b30fe73f /sys/geom/geom_io.c | |
parent | dc1586f84392512a06c7e3401894f0325677ae3e (diff) | |
download | FreeBSD-src-c7d1762ad73e1db84fcf7b90e2e257c1828a0033.zip FreeBSD-src-c7d1762ad73e1db84fcf7b90e2e257c1828a0033.tar.gz |
Allow our bio tools to be used for local bio-chopping by not mandating
a bio_from value. bio_to is still mandated (mostly for debuggign) and
shall be copied from the parent bio.
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r-- | sys/geom/geom_io.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index b3cf82b..31d2296 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -268,11 +268,16 @@ g_io_deliver(struct bio *bp, int error) struct g_provider *pp; KASSERT(bp != NULL, ("NULL bp in g_io_deliver")); - cp = bp->bio_from; pp = bp->bio_to; + KASSERT(pp != NULL, ("NULL bio_to in g_io_deliver")); + cp = bp->bio_from; + if (cp == NULL) { + bp->bio_error = error; + bp->bio_done(bp); + return; + } KASSERT(cp != NULL, ("NULL bio_from in g_io_deliver")); KASSERT(cp->geom != NULL, ("NULL bio_from->geom in g_io_deliver")); - KASSERT(pp != NULL, ("NULL bio_to in g_io_deliver")); g_trace(G_T_BIO, "g_io_deliver(%p) from %p(%s) to %p(%s) cmd %d error %d off %jd len %jd", |