diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-05-08 09:10:27 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-05-08 09:10:27 +0000 |
| commit | 724682d2331ecf9a5fcd7cfcbabcc13efe8bc0f3 (patch) | |
| tree | 5ff6dee983e1bffcf792cf9cebe80a96bbf3fc82 | |
| parent | d4e6d409ca0492aff26438a88824c3cf2ba2bd89 (diff) | |
Notes
| -rw-r--r-- | sys/dev/ccd/ccd.c | 29 | ||||
| -rw-r--r-- | sys/geom/geom_ccd.c | 29 |
2 files changed, 30 insertions, 28 deletions
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index 4addc2e90d10..1fe46f5b9118 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/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 diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index 4addc2e90d10..1fe46f5b9118 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 |
