summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-10-06 09:07:35 +0000
committerphk <phk@FreeBSD.org>2003-10-06 09:07:35 +0000
commitc7d1762ad73e1db84fcf7b90e2e257c1828a0033 (patch)
tree978da971f1dccc39f3d6204c327113c6b30fe73f /sys
parentdc1586f84392512a06c7e3401894f0325677ae3e (diff)
downloadFreeBSD-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')
-rw-r--r--sys/geom/geom_io.c9
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",
OpenPOWER on IntegriCloud