diff options
author | phk <phk@FreeBSD.org> | 2000-04-02 15:24:56 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-04-02 15:24:56 +0000 |
commit | 8ee11d587fcf66a50146b00f04bb5db7b955b795 (patch) | |
tree | c184bd0e6c7538049e6b3655c28f4556a7c1a465 /sys/dev | |
parent | 090fde9a7695bc804b6a26eb67cb706fd805231a (diff) | |
download | FreeBSD-src-8ee11d587fcf66a50146b00f04bb5db7b955b795.zip FreeBSD-src-8ee11d587fcf66a50146b00f04bb5db7b955b795.tar.gz |
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.
(Much of this done by script)
Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.
Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.
Add bio_queue field for struct bio aware disksort.
Address a lot of stylistic issues brought up by bde.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/amr/amr.c | 2 | ||||
-rw-r--r-- | sys/dev/amr/amr_disk.c | 4 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 4 | ||||
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 4 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 8 | ||||
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 6 | ||||
-rw-r--r-- | sys/dev/ccd/ccd.c | 13 | ||||
-rw-r--r-- | sys/dev/fdc/fdc.c | 14 | ||||
-rw-r--r-- | sys/dev/ida/ida.c | 2 | ||||
-rw-r--r-- | sys/dev/ida/ida_disk.c | 4 | ||||
-rw-r--r-- | sys/dev/mcd/mcd.c | 6 | ||||
-rw-r--r-- | sys/dev/mlx/mlx.c | 2 | ||||
-rw-r--r-- | sys/dev/mlx/mlx_disk.c | 4 | ||||
-rw-r--r-- | sys/dev/scd/scd.c | 6 | ||||
-rw-r--r-- | sys/dev/vinum/vinuminterrupt.c | 8 | ||||
-rw-r--r-- | sys/dev/vinum/vinumio.c | 4 | ||||
-rw-r--r-- | sys/dev/vinum/vinumraid5.c | 2 | ||||
-rw-r--r-- | sys/dev/vinum/vinumrequest.c | 35 | ||||
-rw-r--r-- | sys/dev/vinum/vinumrevive.c | 26 | ||||
-rw-r--r-- | sys/dev/vn/vn.c | 15 |
20 files changed, 87 insertions, 82 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index c38f1d1..54ab85a 100644 --- a/sys/dev/amr/amr.c +++ b/sys/dev/amr/amr.c @@ -976,7 +976,7 @@ amr_completeio(struct amr_command *ac) if (ac->ac_status != AMR_STATUS_SUCCESS) { /* could be more verbose here? */ bp->b_error = EIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; switch(ac->ac_status) { /* XXX need more information on I/O error reasons */ diff --git a/sys/dev/amr/amr_disk.c b/sys/dev/amr/amr_disk.c index 6ce523d..10cf0d6 100644 --- a/sys/dev/amr/amr_disk.c +++ b/sys/dev/amr/amr_disk.c @@ -202,7 +202,7 @@ amrd_strategy(struct buf *bp) return; bad: - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; done: /* @@ -221,7 +221,7 @@ amrd_intr(void *data) debug("called"); - if (bp->b_flags & B_ERROR) { + if (bp->b_ioflags & BIO_ERROR) { bp->b_error = EIO; debug("i/o error\n"); } else { diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index cba36c9..b830046 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -539,7 +539,7 @@ oops: /* finish up transfer */ if (request->flags & ADR_F_ERROR) { request->bp->b_error = EIO; - request->bp->b_flags |= B_ERROR; + request->bp->b_ioflags |= BIO_ERROR; } else { request->bytecount -= request->currentsize; @@ -599,7 +599,7 @@ ad_timeout(struct ad_request *request) else { /* retries all used up, return error */ request->bp->b_error = EIO; - request->bp->b_flags |= B_ERROR; + request->bp->b_ioflags |= BIO_ERROR; devstat_end_transaction_buf(&adp->stats, request->bp); biodone(request->bp); free(request, M_AD); diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index cf4e645..61c1795 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -1139,7 +1139,7 @@ acd_start(struct atapi_softc *atp) /* reject all queued entries if media changed */ if (cdp->atp->flags & ATAPI_F_MEDIA_CHANGED) { bp->b_error = EIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -1193,7 +1193,7 @@ acd_done(struct atapi_request *request) if (request->error) { bp->b_error = request->error; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } else { bp->b_resid = bp->b_bcount - request->donecount; diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index c0a8cc4..1b7e177 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -309,7 +309,7 @@ afd_start(struct atapi_softc *atp) /* should reject all queued entries if media have changed. */ if (fdp->atp->flags & ATAPI_F_MEDIA_CHANGED) { bp->b_error = EIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -364,7 +364,7 @@ afd_partial_done(struct atapi_request *request) if (request->error) { bp->b_error = request->error; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } bp->b_resid += request->bytecount; return 0; @@ -376,9 +376,9 @@ afd_done(struct atapi_request *request) struct buf *bp = request->driver; struct afd_softc *fdp = request->device->driver; - if (request->error || (bp->b_flags & B_ERROR)) { + if (request->error || (bp->b_ioflags & BIO_ERROR)) { bp->b_error = request->error; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } else bp->b_resid += (bp->b_bcount - request->donecount); diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index fc7bee4..ff895d2 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -423,7 +423,7 @@ aststrategy(struct buf *bp) } if (!(bp->b_iocmd == BIO_READ) && stp->flags & F_WRITEPROTECT) { bp->b_error = EPERM; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -433,7 +433,7 @@ aststrategy(struct buf *bp) printf("ast%d: bad request, must be multiple of %d\n", stp->lun, stp->blksize); bp->b_error = EIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -493,7 +493,7 @@ ast_done(struct atapi_request *request) if (request->error) { bp->b_error = request->error; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } else { if (!(bp->b_iocmd == BIO_READ)) diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index dcab05e..760734d 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -779,7 +779,7 @@ ccdstrategy(bp) #endif if ((cs->sc_flags & CCDF_INITED) == 0) { bp->b_error = ENXIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto done; } @@ -813,7 +813,8 @@ ccdstrategy(bp) bp->b_resid = bp->b_bcount; if (pbn != cs->sc_size) { bp->b_error = EINVAL; - bp->b_flags |= B_ERROR | B_INVAL; + bp->b_flags |= B_INVAL; + bp->b_ioflags |= BIO_ERROR; } goto done; } @@ -1108,7 +1109,7 @@ ccdintr(cs, bp) /* * Request is done for better or worse, wakeup the top half. */ - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) bp->b_resid = bp->b_bcount; devstat_end_transaction_buf(&cs->device_stats, bp); biodone(bp); @@ -1148,7 +1149,7 @@ ccdiodone(ibp) * succeed. */ - if (cbp->cb_buf.b_flags & B_ERROR) { + if (cbp->cb_buf.b_ioflags & BIO_ERROR) { const char *msg = ""; if ((ccd_softc[unit].sc_cflags & CCDF_MIRROR) && @@ -1166,7 +1167,7 @@ ccdiodone(ibp) cs->sc_pick = 1 - cs->sc_pick; cs->sc_blk[cs->sc_pick] = bp->b_blkno; } else { - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = cbp->cb_buf.b_error ? cbp->cb_buf.b_error : EIO; } @@ -1204,7 +1205,7 @@ ccdiodone(ibp) * occured with this one. */ if ((cbp->cb_pflags & CCDPF_MIRROR_DONE) == 0) { - if (cbp->cb_buf.b_flags & B_ERROR) { + if (cbp->cb_buf.b_ioflags & BIO_ERROR) { cbp->cb_mirror->cb_pflags |= CCDPF_MIRROR_DONE; BUF_STRATEGY(&cbp->cb_mirror->cb_buf); diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 1d59f3f..948142c 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -1464,7 +1464,7 @@ fdstrategy(struct buf *bp) fdc = fd->fdc; if (fd->type == NO_TYPE) { bp->b_error = ENXIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; }; @@ -1475,12 +1475,12 @@ fdstrategy(struct buf *bp) "fd%d: fdstrat: bad request blkno = %lu, bcount = %ld\n", fdu, (u_long)bp->b_blkno, bp->b_bcount); bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; } if ((bp->b_bcount % fdblk) != 0) { bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; } } @@ -1494,7 +1494,7 @@ fdstrategy(struct buf *bp) * multiplication below from overflowing. */ bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; } blknum = (unsigned) bp->b_blkno * DEV_BSIZE/fdblk; @@ -1508,7 +1508,7 @@ fdstrategy(struct buf *bp) goto bad; /* not actually bad but EOF */ } else { bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; } } @@ -2185,7 +2185,7 @@ retrier(struct fdc_data *fdc) else printf(" (No status)\n"); } - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = EIO; bp->b_resid += bp->b_bcount - fdc->fd->skip; fdc->bp = NULL; @@ -2263,7 +2263,7 @@ fdformat(dev, finfo, p) device_unbusy(fd->dev); biodone(bp); } - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) rv = bp->b_error; /* * allow the process to be swapped diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index c9e924e..447ed46 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -519,7 +519,7 @@ ida_done(struct ida_softc *ida, struct ida_qcb *qcb) wakeup(qcb); } else { if (error) - qcb->buf->b_flags |= B_ERROR; + qcb->buf->b_ioflags |= BIO_ERROR; id_intr(qcb->buf); } diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c index ee1c157..64a8dac 100644 --- a/sys/dev/ida/ida_disk.c +++ b/sys/dev/ida/ida_disk.c @@ -182,7 +182,7 @@ idstrategy(struct buf *bp) return; bad: - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; done: /* @@ -198,7 +198,7 @@ id_intr(struct buf *bp) { struct id_softc *drv = (struct id_softc *)bp->b_driver1; - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) bp->b_error = EIO; else bp->b_resid = 0; diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index 8b41449..70614d7 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -402,7 +402,7 @@ mcdstrategy(struct buf *bp) unit, (long)bp->b_blkno, bp->b_bcount); printf("mcd: mcdstratregy failure"); bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; } @@ -448,7 +448,7 @@ MCD_TRACE("strategy: drive not valid\n"); return; bad: - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; done: bp->b_resid = bp->b_bcount; biodone(bp); @@ -1184,7 +1184,7 @@ readerr: } harderr: /* invalidate the buffer */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_resid = bp->b_bcount; biodone(bp); diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 94e2863..7ec3da4 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -1722,7 +1722,7 @@ mlx_completeio(struct mlx_command *mc) if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ bp->b_error = EIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; switch(mc->mc_status) { case MLX_STATUS_RDWROFFLINE: /* system drive has gone offline */ diff --git a/sys/dev/mlx/mlx_disk.c b/sys/dev/mlx/mlx_disk.c index 1dcf93b..22328ba 100644 --- a/sys/dev/mlx/mlx_disk.c +++ b/sys/dev/mlx/mlx_disk.c @@ -193,7 +193,7 @@ mlxd_strategy(struct buf *bp) return; bad: - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; done: /* @@ -212,7 +212,7 @@ mlxd_intr(void *data) debug_called(1); - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) bp->b_error = EIO; else bp->b_resid = 0; diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c index 836dbc9..6863bf6 100644 --- a/sys/dev/scd/scd.c +++ b/sys/dev/scd/scd.c @@ -325,7 +325,7 @@ scdstrategy(struct buf *bp) printf("scd%d: strategy failure: blkno = %ld, bcount = %ld\n", unit, (long)bp->b_blkno, bp->b_bcount); bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; goto bad; } @@ -367,7 +367,7 @@ scdstrategy(struct buf *bp) return; bad: - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; done: bp->b_resid = bp->b_bcount; biodone(bp); @@ -1043,7 +1043,7 @@ readerr: harderr: /* invalidate the buffer */ bp->b_error = EIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_resid = bp->b_bcount; biodone(bp); diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/dev/vinum/vinuminterrupt.c index d473e91..dee1bbe 100644 --- a/sys/dev/vinum/vinuminterrupt.c +++ b/sys/dev/vinum/vinuminterrupt.c @@ -83,7 +83,7 @@ complete_rqe(struct buf *bp) if ((drive->active == (DRIVE_MAXACTIVE - 1)) /* we were at the drive limit */ ||(vinum_conf.active == VINUM_MAXACTIVE)) /* or the global limit */ wakeup(&launch_requests); /* let another one at it */ - if ((bp->b_flags & B_ERROR) != 0) { /* transfer in error */ + if ((bp->b_ioflags & BIO_ERROR) != 0) { /* transfer in error */ if (bp->b_error != 0) /* did it return a number? */ rq->error = bp->b_error; /* yes, put it in. */ else if (rq->error == 0) /* no: do we have one already? */ @@ -174,7 +174,7 @@ complete_rqe(struct buf *bp) if (rq->error) { /* did we have an error? */ if (rq->isplex) { /* plex operation, */ - ubp->b_flags |= B_ERROR; /* yes, propagate to user */ + ubp->b_ioflags |= BIO_ERROR; /* yes, propagate to user */ ubp->b_error = rq->error; } else /* try to recover */ queue_daemon_request(daemonrq_ioerror, (union daemoninfo) rq); /* let the daemon complete */ @@ -216,8 +216,8 @@ sdio_done(struct buf *bp) struct sdbuf *sbp; sbp = (struct sdbuf *) bp; - if (sbp->b.b_flags & B_ERROR) { /* had an error */ - sbp->bp->b_flags |= B_ERROR; /* propagate upwards */ + if (sbp->b.b_ioflags & BIO_ERROR) { /* had an error */ + sbp->bp->b_ioflags |= BIO_ERROR; /* propagate upwards */ sbp->bp->b_error = sbp->b.b_error; } #ifdef VINUMDEBUG diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c index 74a3053..b1de69a 100644 --- a/sys/dev/vinum/vinumio.c +++ b/sys/dev/vinum/vinumio.c @@ -308,7 +308,7 @@ driveio(struct drive *drive, char *buf, size_t length, off_t offset, int flag) error = biowait(bp); bp->b_data = bp->b_saveaddr; bp->b_flags |= B_INVAL | B_AGE; - bp->b_flags &= ~B_ERROR; + bp->b_ioflags &= ~BIO_ERROR; brelse(bp); if (error) break; @@ -767,7 +767,7 @@ write_volume_label(int volno) DEV_STRATEGY(bp, 0); error = biowait(bp); bp->b_flags |= B_INVAL | B_AGE; - bp->b_flags &= ~B_ERROR; + bp->b_ioflags &= ~BIO_ERROR; brelse(bp); return error; } diff --git a/sys/dev/vinum/vinumraid5.c b/sys/dev/vinum/vinumraid5.c index bbddff2..41b9999 100644 --- a/sys/dev/vinum/vinumraid5.c +++ b/sys/dev/vinum/vinumraid5.c @@ -467,7 +467,7 @@ bre5(struct request *rq, /* Part C: build the requests */ rqg = allocrqg(rq, m.rqcount); /* get a request group */ if (rqg == NULL) { /* malloc failed */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = ENOMEM; biodone(bp); return REQUEST_ENOMEM; diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c index 3d9d8c2..41dfa5d 100644 --- a/sys/dev/vinum/vinumrequest.c +++ b/sys/dev/vinum/vinumrequest.c @@ -135,7 +135,7 @@ vinumstrategy(struct buf *bp) case VINUM_DRIVE_TYPE: default: bp->b_error = EIO; /* I/O error */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; @@ -144,7 +144,7 @@ vinumstrategy(struct buf *bp) vol = &VOL[volno]; if (vol->state != volume_up) { /* can't access this volume */ bp->b_error = EIO; /* I/O error */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -192,14 +192,14 @@ vinumstart(struct buf *bp, int reviveok) if ((bp->b_bcount % DEV_BSIZE) != 0) { /* bad length */ bp->b_error = EINVAL; /* invalid size */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return -1; } rq = (struct request *) Malloc(sizeof(struct request)); /* allocate a request struct */ if (rq == NULL) { /* can't do it */ bp->b_error = ENOMEM; /* can't get memory */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return -1; } @@ -257,7 +257,7 @@ vinumstart(struct buf *bp, int reviveok) ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */ if (status == REQUEST_DOWN) { /* not enough subdisks */ bp->b_error = EIO; /* I/O error */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } biodone(bp); freerq(rq); @@ -286,7 +286,7 @@ vinumstart(struct buf *bp, int reviveok) ||(bp->b_flags & B_DONE)) { /* XXX shouldn't get this without bad status */ if (status == REQUEST_DOWN) { /* not enough subdisks */ bp->b_error = EIO; /* I/O error */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } if ((bp->b_flags & B_DONE) == 0) biodone(bp); @@ -480,7 +480,7 @@ bre(struct request *rq, if (*diskaddr < (sd->plexoffset + sd->sectors)) { /* the request starts in this subdisk */ rqg = allocrqg(rq, 1); /* space for the request */ if (rqg == NULL) { /* malloc failed */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = ENOMEM; biodone(bp); return REQUEST_ENOMEM; @@ -519,7 +519,7 @@ bre(struct request *rq, *diskaddr += rqe->datalen; /* bump the address */ if (build_rq_buffer(rqe, plex)) { /* build the buffer */ deallocrqg(rqg); - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = ENOMEM; biodone(bp); return REQUEST_ENOMEM; /* can't do it */ @@ -564,7 +564,7 @@ bre(struct request *rq, sd = &SD[plex->sdnos[sdno]]; /* the subdisk in question */ rqg = allocrqg(rq, 1); /* space for the request */ if (rqg == NULL) { /* malloc failed */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = ENOMEM; biodone(bp); return REQUEST_ENOMEM; @@ -629,7 +629,7 @@ bre(struct request *rq, } if (build_rq_buffer(rqe, plex)) { /* build the buffer */ deallocrqg(rqg); - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = ENOMEM; biodone(bp); return REQUEST_ENOMEM; /* can't do it */ @@ -791,7 +791,8 @@ build_rq_buffer(struct rqelement *rqe, struct plex *plex) /* Initialize the buf struct */ /* copy these flags from user bp */ - bp->b_flags = ubp->b_flags & (B_ORDERED | B_NOCACHE | B_ASYNC); + bp->b_flags = ubp->b_flags & (B_NOCACHE | B_ASYNC); + bp->b_ioflags = ubp->b_ioflags & BIO_ORDERED; bp->b_iocmd = ubp->b_iocmd; BUF_LOCKINIT(bp); /* get a lock for the buffer */ BUF_LOCK(bp, LK_EXCLUSIVE); /* and lock it */ @@ -853,7 +854,7 @@ abortrequest(struct request *rq, int error) { struct buf *bp = rq->bp; /* user buffer */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = error; freerq(rq); /* free everything we're doing */ biodone(bp); @@ -896,7 +897,7 @@ sdio(struct buf *bp) else if (bp->b_iocmd == BIO_WRITE) /* writing, */ set_sd_state(sd->sdno, sd_stale, setstate_force); } - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = EIO; biodone(bp); return; @@ -906,7 +907,7 @@ sdio(struct buf *bp) * to get the I/O performed. */ if (sd->state < sd_empty) { /* nothing to talk to, */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = EIO; biodone(bp); return; @@ -914,7 +915,7 @@ sdio(struct buf *bp) /* Get a buffer */ sbp = (struct sdbuf *) Malloc(sizeof(struct sdbuf)); if (sbp == NULL) { - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = ENOMEM; biodone(bp); return; @@ -996,7 +997,7 @@ vinum_bounds_check(struct buf *bp, struct volume *vol) && (bp->b_iocmd == BIO_WRITE) /* and it's a write */ && (!vol->flags & (VF_WLABEL | VF_LABELLING))) { /* and we're not allowed to write the label */ bp->b_error = EROFS; /* read-only */ - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; return -1; } if (size == 0) /* no transfer specified, */ @@ -1013,7 +1014,7 @@ vinum_bounds_check(struct buf *bp, struct volume *vol) size = maxsize - bp->b_blkno; if (size <= 0) { /* nothing to transfer */ bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; return -1; } bp->b_bcount = size << DEV_BSHIFT; diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c index 72ea732..8399adb 100644 --- a/sys/dev/vinum/vinumrevive.c +++ b/sys/dev/vinum/vinumrevive.c @@ -176,13 +176,13 @@ revive_block(int sdno) biowait(bp); } - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) error = bp->b_error; else /* Now write to the subdisk */ { bp->b_dev = VINUM_SD(sdno); /* create the device number */ - bp->b_flags = B_ORDERED; /* and make this an ordered write */ + bp->b_ioflags = BIO_ORDERED; /* and make this an ordered write */ bp->b_iocmd = BIO_WRITE; /* and make this an ordered write */ BUF_LOCKINIT(bp); /* get a lock for the buffer */ BUF_LOCK(bp, LK_EXCLUSIVE); /* and lock it */ @@ -190,7 +190,7 @@ revive_block(int sdno) bp->b_blkno = sd->revived; /* write it to here */ sdio(bp); /* perform the I/O */ biowait(bp); - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) error = bp->b_error; else { sd->revived += bp->b_bcount >> DEV_BSHIFT; /* moved this much further down */ @@ -225,7 +225,7 @@ revive_block(int sdno) } if (bp->b_qindex == 0) { /* not on a queue, */ bp->b_flags |= B_INVAL; - bp->b_flags &= ~B_ERROR; + bp->b_ioflags &= ~BIO_ERROR; brelse(bp); /* is this kosher? */ } return error; @@ -294,7 +294,7 @@ parityops(struct vinum_ioctl_msg *data, enum parityop op) * the parity buffer header, which we have kept. * Decide what to do with it. */ - if ((pbp->b_flags & B_ERROR) == 0) { /* no error */ + if ((pbp->b_ioflags & BIO_ERROR) == 0) { /* no error */ if (op == checkparity) { int *parity_buf; int isize; @@ -326,10 +326,10 @@ parityops(struct vinum_ioctl_msg *data, enum parityop op) reply->error = 0; } } - if (pbp->b_flags & B_ERROR) + if (pbp->b_ioflags & BIO_ERROR) reply->error = pbp->b_error; pbp->b_flags |= B_INVAL; - pbp->b_flags &= ~B_ERROR; + pbp->b_ioflags &= ~BIO_ERROR; brelse(pbp); } @@ -445,7 +445,7 @@ parityrebuild(struct plex *plex, for (sdno = 0; sdno < plex->subdisks; sdno++) { /* for each subdisk */ if ((sdno != psd) || check) { biowait(bpp[sdno]); - if (bpp[sdno]->b_flags & B_ERROR) /* can't read, */ + if (bpp[sdno]->b_ioflags & BIO_ERROR) /* can't read, */ error = bpp[sdno]->b_error; } } @@ -475,7 +475,7 @@ parityrebuild(struct plex *plex, /* release our resources */ Free(bpp); if (error) { - pbp->b_flags |= B_ERROR; + pbp->b_ioflags |= BIO_ERROR; pbp->b_error = error; } return pbp; @@ -541,11 +541,11 @@ initsd(int sdno, int verify) BUF_LOCK(bp, LK_EXCLUSIVE); /* and lock it */ sdio(bp); /* perform the I/O */ biowait(bp); - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) error = bp->b_error; if (bp->b_qindex == 0) { /* not on a queue, */ bp->b_flags |= B_INVAL; - bp->b_flags &= ~B_ERROR; + bp->b_ioflags &= ~BIO_ERROR; brelse(bp); /* is this kosher? */ } if ((error == 0) && verify) { /* check that it got there */ @@ -569,7 +569,7 @@ initsd(int sdno, int verify) * XXX Bug fix code. This is hopefully no * longer needed (21 February 2000). */ - if (bp->b_flags & B_ERROR) + if (bp->b_ioflags & BIO_ERROR) error = bp->b_error; else if ((*bp->b_data != 0) /* first word spammed */ ||(bcmp(bp->b_data, &bp->b_data[1], bp->b_bcount - 1))) { /* or one of the others */ @@ -581,7 +581,7 @@ initsd(int sdno, int verify) verified = 1; if (bp->b_qindex == 0) { /* not on a queue, */ bp->b_flags |= B_INVAL; - bp->b_flags &= ~B_ERROR; + bp->b_ioflags &= ~BIO_ERROR; brelse(bp); /* is this kosher? */ } } diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index ba0caad..8acdeb7 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -294,7 +294,7 @@ vnstrategy(struct buf *bp) if ((vn->sc_flags & VNF_INITED) == 0) { bp->b_error = ENXIO; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -303,6 +303,7 @@ vnstrategy(struct buf *bp) IFOPT(vn, VN_LABELS) { if (vn->sc_slices != NULL && dscheck(bp, vn->sc_slices) <= 0) { + /* XXX: Normal B_ERROR processing, instead ? */ bp->b_flags |= B_INVAL; biodone(bp); return; @@ -318,7 +319,8 @@ vnstrategy(struct buf *bp) if (bp->b_bcount % vn->sc_secsize != 0 || bp->b_blkno % (vn->sc_secsize / DEV_BSIZE) != 0) { bp->b_error = EINVAL; - bp->b_flags |= B_ERROR | B_INVAL; + bp->b_flags |= B_INVAL; + bp->b_ioflags |= BIO_ERROR; biodone(bp); return; } @@ -333,7 +335,8 @@ vnstrategy(struct buf *bp) if (pbn < 0 || pbn >= vn->sc_size) { if (pbn != vn->sc_size) { bp->b_error = EINVAL; - bp->b_flags |= B_ERROR | B_INVAL; + bp->b_flags |= B_INVAL; + bp->b_ioflags |= BIO_ERROR; } biodone(bp); return; @@ -358,7 +361,7 @@ vnstrategy(struct buf *bp) /* * VNODE I/O * - * If an error occurs, we set B_ERROR but we do not set + * If an error occurs, we set BIO_ERROR but we do not set * B_INVAL because (for a write anyway), the buffer is * still valid. */ @@ -390,7 +393,7 @@ vnstrategy(struct buf *bp) if (error) { bp->b_error = error; - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; } biodone(bp); } else if (vn->sc_object) { @@ -410,7 +413,7 @@ vnstrategy(struct buf *bp) vm_pager_strategy(vn->sc_object, bp); } } else { - bp->b_flags |= B_ERROR; + bp->b_ioflags |= BIO_ERROR; bp->b_error = EINVAL; biodone(bp); } |