diff options
author | phk <phk@FreeBSD.org> | 2001-05-08 09:10:27 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-05-08 09:10:27 +0000 |
commit | 38e4267af012d2f5d815736d6b2641f4c35bbbff (patch) | |
tree | 7980bc13ea805d7d8042c207f8417659160ff507 /sys/geom | |
parent | d084607047e2bd72b7cf1622534a03c90a292ebf (diff) | |
download | FreeBSD-src-38e4267af012d2f5d815736d6b2641f4c35bbbff.zip FreeBSD-src-38e4267af012d2f5d815736d6b2641f4c35bbbff.tar.gz |
Polish error handling with biofinish().
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_ccd.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index 4addc2e..1fe46f5 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -790,14 +790,15 @@ ccdstrategy(bp) printf("ccdstrategy(%p): unit %d\n", bp, unit); #endif if ((cs->sc_flags & CCDF_INITED) == 0) { - bp->bio_error = ENXIO; - bp->bio_flags |= BIO_ERROR; - goto done; + biofinish(bp, NULL, ENXIO); + return; } /* If it's a nil transfer, wake up the top half now. */ - if (bp->bio_bcount == 0) - goto done; + if (bp->bio_bcount == 0) { + biodone(bp); + return; + } lp = &cs->sc_label; @@ -807,8 +808,10 @@ ccdstrategy(bp) */ wlabel = cs->sc_flags & (CCDF_WLABEL|CCDF_LABELLING); if (ccdpart(bp->bio_dev) != RAW_PART) { - if (bounds_check_with_label(bp, lp, wlabel) <= 0) - goto done; + if (bounds_check_with_label(bp, lp, wlabel) <= 0) { + biodone(bp); + return; + } } else { int pbn; /* in sc_secsize chunks */ long sz; /* in sc_secsize chunks */ @@ -823,11 +826,11 @@ ccdstrategy(bp) if (pbn < 0 || pbn >= cs->sc_size) { bp->bio_resid = bp->bio_bcount; - if (pbn != cs->sc_size) { - bp->bio_error = EINVAL; - bp->bio_flags |= BIO_ERROR; - } - goto done; + if (pbn != cs->sc_size) + biofinish(bp, NULL, EINVAL); + else + biodone(bp); + return; } /* @@ -848,8 +851,6 @@ ccdstrategy(bp) ccdstart(cs, bp); splx(s); return; -done: - biodone(bp); } static void |