diff options
Diffstat (limited to 'sys/dev/amr')
-rw-r--r-- | sys/dev/amr/amr.c | 36 | ||||
-rw-r--r-- | sys/dev/amr/amr_disk.c | 30 | ||||
-rw-r--r-- | sys/dev/amr/amrvar.h | 4 |
3 files changed, 35 insertions, 35 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index 54ab85a..de6f965 100644 --- a/sys/dev/amr/amr.c +++ b/sys/dev/amr/amr.c @@ -337,7 +337,7 @@ amr_attach(struct amr_softc *sc) */ TAILQ_INIT(&sc->amr_work); TAILQ_INIT(&sc->amr_freecmds); - bufq_init(&sc->amr_bufq); + bioq_init(&sc->amr_bioq); /* * Configure for this controller type. @@ -503,7 +503,7 @@ amr_detach(device_t dev) * an operation which may add or delete system disks. (Call amr_startup to * resume normal operation.) * - * Note that we can assume that the bufq on the controller is empty, as we won't + * Note that we can assume that the bioq on the controller is empty, as we won't * allow shutdown if any device is open. */ int @@ -608,14 +608,14 @@ amr_intr(void *arg) * disk resource, then poke the disk resource to start as much work as it can. */ int -amr_submit_buf(struct amr_softc *sc, struct buf *bp) +amr_submit_buf(struct amr_softc *sc, struct bio *bp) { int s; debug("called"); s = splbio(); - bufq_insert_tail(&sc->amr_bufq, bp); + bioq_insert_tail(&sc->amr_bioq, bp); splx(s); sc->amr_waitbufs++; amr_startio(sc); @@ -884,7 +884,7 @@ amr_startio(struct amr_softc *sc) { struct amr_command *ac; struct amrd_softc *amrd; - struct buf *bp; + struct bio *bp; int blkcount; int driveno; int cmd; @@ -899,7 +899,7 @@ amr_startio(struct amr_softc *sc) for (;;) { /* see if there's work to be done */ - if ((bp = bufq_first(&sc->amr_bufq)) == NULL) + if ((bp = bioq_first(&sc->amr_bioq)) == NULL) break; /* get a command */ if ((ac = amr_alloccmd(sc)) == NULL) @@ -910,16 +910,16 @@ amr_startio(struct amr_softc *sc) break; } /* get the buf containing our work */ - bufq_remove(&sc->amr_bufq, bp); + bioq_remove(&sc->amr_bioq, bp); sc->amr_waitbufs--; splx(s); /* connect the buf to the command */ ac->ac_complete = amr_completeio; ac->ac_private = bp; - ac->ac_data = bp->b_data; - ac->ac_length = bp->b_bcount; - if (bp->b_iocmd == BIO_READ) { + ac->ac_data = bp->bio_data; + ac->ac_length = bp->bio_bcount; + if (bp->bio_cmd == BIO_READ) { ac->ac_flags |= AMR_CMD_DATAIN; cmd = AMR_CMD_LREAD; } else { @@ -931,20 +931,20 @@ amr_startio(struct amr_softc *sc) amr_mapcmd(ac); /* build a suitable I/O command (assumes 512-byte rounded transfers) */ - amrd = (struct amrd_softc *)bp->b_dev->si_drv1; + amrd = (struct amrd_softc *)bp->bio_dev->si_drv1; driveno = amrd->amrd_drive - sc->amr_drive; - blkcount = (bp->b_bcount + AMR_BLKSIZE - 1) / AMR_BLKSIZE; + blkcount = (bp->bio_bcount + AMR_BLKSIZE - 1) / AMR_BLKSIZE; - if ((bp->b_pblkno + blkcount) > sc->amr_drive[driveno].al_size) + if ((bp->bio_pblkno + blkcount) > sc->amr_drive[driveno].al_size) device_printf(sc->amr_dev, "I/O beyond end of unit (%u,%d > %u)\n", - bp->b_pblkno, blkcount, sc->amr_drive[driveno].al_size); + bp->bio_pblkno, blkcount, sc->amr_drive[driveno].al_size); /* * Build the I/O command. */ ac->ac_mailbox.mb_command = cmd; ac->ac_mailbox.mb_blkcount = blkcount; - ac->ac_mailbox.mb_lba = bp->b_pblkno; + ac->ac_mailbox.mb_lba = bp->bio_pblkno; ac->ac_mailbox.mb_physaddr = ac->ac_sgphys; ac->ac_mailbox.mb_drive = driveno; ac->ac_mailbox.mb_nsgelem = ac->ac_nsgent; @@ -968,15 +968,15 @@ static void amr_completeio(struct amr_command *ac) { struct amr_softc *sc = ac->ac_sc; - struct buf *bp = (struct buf *)ac->ac_private; + struct bio *bp = (struct bio *)ac->ac_private; int notify, release; notify = 1; release = 1; if (ac->ac_status != AMR_STATUS_SUCCESS) { /* could be more verbose here? */ - bp->b_error = EIO; - bp->b_ioflags |= BIO_ERROR; + bp->bio_error = EIO; + bp->bio_flags |= 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 10cf0d6..3fd566b 100644 --- a/sys/dev/amr/amr_disk.c +++ b/sys/dev/amr/amr_disk.c @@ -172,29 +172,29 @@ amrd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) * be a multiple of a sector in length. */ static void -amrd_strategy(struct buf *bp) +amrd_strategy(struct bio *bp) { - struct amrd_softc *sc = (struct amrd_softc *)bp->b_dev->si_drv1; + struct amrd_softc *sc = (struct amrd_softc *)bp->bio_dev->si_drv1; debug("called to %s %d bytes at b_blkno 0x%x b_pblkno 0x%x", - (bp->b_flags & B_READ) ? "read" : "write", bp->b_bcount, bp->b_blkno, bp->b_pblkno); + (bp->b_flags & B_READ) ? "read" : "write", bp->bio_bcount, bp->bio_blkno, bp->bio_pblkno); /* bogus disk? */ if (sc == NULL) { - bp->b_error = EINVAL; + bp->bio_error = EINVAL; goto bad; } #if 0 /* XXX may only be temporarily offline - sleep? */ if (sc->amrd_drive->ld_state == AMR_SYSD_OFFLINE) { - bp->b_error = ENXIO; + bp->bio_error = ENXIO; goto bad; } #endif /* do-nothing operation */ - if (bp->b_bcount == 0) + if (bp->bio_bcount == 0) goto done; devstat_start_transaction(&sc->amrd_stats); @@ -202,13 +202,13 @@ amrd_strategy(struct buf *bp) return; bad: - bp->b_ioflags |= BIO_ERROR; + bp->bio_flags |= BIO_ERROR; done: /* * Correctly set the buf to indicate a completed transfer */ - bp->b_resid = bp->b_bcount; + bp->bio_resid = bp->bio_bcount; biodone(bp); return; } @@ -216,24 +216,24 @@ amrd_strategy(struct buf *bp) void amrd_intr(void *data) { - struct buf *bp = (struct buf *)data; - struct amrd_softc *sc = (struct amrd_softc *)bp->b_dev->si_drv1; + struct bio *bp = (struct bio *)data; + struct amrd_softc *sc = (struct amrd_softc *)bp->bio_dev->si_drv1; debug("called"); - if (bp->b_ioflags & BIO_ERROR) { - bp->b_error = EIO; + if (bp->bio_flags & BIO_ERROR) { + bp->bio_error = EIO; debug("i/o error\n"); } else { #if 0 int i; for (i = 0; i < 512; i += 16) - debug(" %04x %16D", i, bp->b_data + i, " "); + debug(" %04x %16D", i, bp->bio_data + i, " "); #endif - bp->b_resid = 0; + bp->bio_resid = 0; } - devstat_end_transaction_buf(&sc->amrd_stats, bp); + devstat_end_transaction_bio(&sc->amrd_stats, bp); biodone(bp); } diff --git a/sys/dev/amr/amrvar.h b/sys/dev/amr/amrvar.h index 84777b5..5edfb1f 100644 --- a/sys/dev/amr/amrvar.h +++ b/sys/dev/amr/amrvar.h @@ -136,7 +136,7 @@ struct amr_softc struct callout_handle amr_timeout; /* periodic status check */ /* per-controller queues */ - struct buf_queue_head amr_bufq; /* pending I/O */ + struct bio_queue_head amr_bioq; /* pending I/O */ int amr_waitbufs; struct amr_command *amr_busycmd[AMR_MAXCMD]; int amr_busycmdcount; @@ -239,7 +239,7 @@ struct amrd_softc /* * Interface between driver core and disk driver (should be using a bus?) */ -extern int amr_submit_buf(struct amr_softc *sc, struct buf *bp); +extern int amr_submit_buf(struct amr_softc *sc, struct bio *bp); extern int amr_submit_ioctl(struct amr_softc *sc, struct amr_logdrive *drive, u_long cmd, caddr_t addr, int32_t flag, struct proc *p); extern void amrd_intr(void *data); |