diff options
Diffstat (limited to 'sys/dev/mlx')
-rw-r--r-- | sys/dev/mlx/mlx.c | 44 | ||||
-rw-r--r-- | sys/dev/mlx/mlx_disk.c | 26 | ||||
-rw-r--r-- | sys/dev/mlx/mlxvar.h | 4 |
3 files changed, 37 insertions, 37 deletions
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 4bfc8b5..128576e 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -289,7 +289,7 @@ mlx_attach(struct mlx_softc *sc) */ TAILQ_INIT(&sc->mlx_work); TAILQ_INIT(&sc->mlx_freecmds); - bufq_init(&sc->mlx_bufq); + bioq_init(&sc->mlx_bioq); /* * Select accessor methods based on controller interface type. @@ -587,7 +587,7 @@ mlx_detach(device_t dev) * an operation which may add or delete system disks. (Call mlx_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 @@ -686,14 +686,14 @@ mlx_intr(void *arg) * disk resource, then poke the disk resource to start as much work as it can. */ int -mlx_submit_buf(struct mlx_softc *sc, struct buf *bp) +mlx_submit_buf(struct mlx_softc *sc, struct bio *bp) { int s; debug_called(1); s = splbio(); - bufq_insert_tail(&sc->mlx_bufq, bp); + bioq_insert_tail(&sc->mlx_bioq, bp); sc->mlx_waitbufs++; splx(s); mlx_startio(sc); @@ -1701,14 +1701,14 @@ mlx_poll_command(struct mlx_command *mc) * controller. Leave a couple of slots free for emergencies. * * Must be called at splbio or in an equivalent fashion that prevents - * reentry or activity on the bufq. + * reentry or activity on the bioq. */ static void mlx_startio(struct mlx_softc *sc) { struct mlx_command *mc; struct mlxd_softc *mlxd; - struct buf *bp; + struct bio *bp; int blkcount; int driveno; int cmd; @@ -1723,7 +1723,7 @@ mlx_startio(struct mlx_softc *sc) for (;;) { /* see if there's work to be done */ - if ((bp = bufq_first(&sc->mlx_bufq)) == NULL) + if ((bp = bioq_first(&sc->mlx_bioq)) == NULL) break; /* get a command */ if ((mc = mlx_alloccmd(sc)) == NULL) @@ -1734,16 +1734,16 @@ mlx_startio(struct mlx_softc *sc) break; } /* get the buf containing our work */ - bufq_remove(&sc->mlx_bufq, bp); + bioq_remove(&sc->mlx_bioq, bp); sc->mlx_waitbufs--; splx(s); /* connect the buf to the command */ mc->mc_complete = mlx_completeio; mc->mc_private = bp; - mc->mc_data = bp->b_data; - mc->mc_length = bp->b_bcount; - if (bp->b_iocmd == BIO_READ) { + mc->mc_data = bp->bio_data; + mc->mc_length = bp->bio_bcount; + if (bp->bio_cmd == BIO_READ) { mc->mc_flags |= MLX_CMD_DATAIN; cmd = MLX_CMD_READSG; } else { @@ -1755,13 +1755,13 @@ mlx_startio(struct mlx_softc *sc) mlx_mapcmd(mc); /* build a suitable I/O command (assumes 512-byte rounded transfers) */ - mlxd = (struct mlxd_softc *)bp->b_dev->si_drv1; + mlxd = (struct mlxd_softc *)bp->bio_dev->si_drv1; driveno = mlxd->mlxd_drive - sc->mlx_sysdrive; - blkcount = (bp->b_bcount + MLX_BLKSIZE - 1) / MLX_BLKSIZE; + blkcount = (bp->bio_bcount + MLX_BLKSIZE - 1) / MLX_BLKSIZE; - if ((bp->b_pblkno + blkcount) > sc->mlx_sysdrive[driveno].ms_size) + if ((bp->bio_pblkno + blkcount) > sc->mlx_sysdrive[driveno].ms_size) device_printf(sc->mlx_dev, "I/O beyond end of unit (%u,%d > %u)\n", - bp->b_pblkno, blkcount, sc->mlx_sysdrive[driveno].ms_size); + bp->bio_pblkno, blkcount, sc->mlx_sysdrive[driveno].ms_size); /* * Build the I/O command. Note that the SG list type bits are set to zero, @@ -1770,7 +1770,7 @@ mlx_startio(struct mlx_softc *sc) if (sc->mlx_iftype == MLX_IFTYPE_2) { mlx_make_type1(mc, (cmd == MLX_CMD_WRITESG) ? MLX_CMD_WRITESG_OLD : MLX_CMD_READSG_OLD, blkcount & 0xff, /* xfer length low byte */ - bp->b_pblkno, /* physical block number */ + bp->bio_pblkno, /* physical block number */ driveno, /* target drive number */ mc->mc_sgphys, /* location of SG list */ mc->mc_nsgent & 0x3f); /* size of SG list (top 3 bits clear) */ @@ -1778,7 +1778,7 @@ mlx_startio(struct mlx_softc *sc) mlx_make_type5(mc, cmd, blkcount & 0xff, /* xfer length low byte */ (driveno << 3) | ((blkcount >> 8) & 0x07), /* target and length high 3 bits */ - bp->b_pblkno, /* physical block number */ + bp->bio_pblkno, /* physical block number */ mc->mc_sgphys, /* location of SG list */ mc->mc_nsgent & 0x3f); /* size of SG list (top 3 bits clear) */ } @@ -1802,12 +1802,12 @@ static void mlx_completeio(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - struct buf *bp = (struct buf *)mc->mc_private; - struct mlxd_softc *mlxd = (struct mlxd_softc *)bp->b_dev->si_drv1; + struct bio *bp = (struct bio *)mc->mc_private; + struct mlxd_softc *mlxd = (struct mlxd_softc *)bp->bio_dev->si_drv1; if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ - bp->b_error = EIO; - bp->b_ioflags |= BIO_ERROR; + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; switch(mc->mc_status) { case MLX_STATUS_RDWROFFLINE: /* system drive has gone offline */ @@ -1820,7 +1820,7 @@ mlx_completeio(struct mlx_command *mc) device_printf(sc->mlx_dev, "I/O error - %s\n", mlx_diagnose_command(mc)); #if 0 device_printf(sc->mlx_dev, " b_bcount %ld blkcount %ld b_pblkno %d\n", - bp->b_bcount, bp->b_bcount / MLX_BLKSIZE, bp->b_pblkno); + bp->bio_bcount, bp->bio_bcount / MLX_BLKSIZE, bp->bio_pblkno); device_printf(sc->mlx_dev, " %13D\n", mc->mc_mailbox, " "); #endif break; diff --git a/sys/dev/mlx/mlx_disk.c b/sys/dev/mlx/mlx_disk.c index 5420326..50f20c5 100644 --- a/sys/dev/mlx/mlx_disk.c +++ b/sys/dev/mlx/mlx_disk.c @@ -165,26 +165,26 @@ mlxd_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 -mlxd_strategy(struct buf *bp) +mlxd_strategy(struct bio *bp) { - struct mlxd_softc *sc = (struct mlxd_softc *)bp->b_dev->si_drv1; + struct mlxd_softc *sc = (struct mlxd_softc *)bp->bio_dev->si_drv1; debug_called(1); /* bogus disk? */ if (sc == NULL) { - bp->b_error = EINVAL; + bp->bio_error = EINVAL; goto bad; } /* XXX may only be temporarily offline - sleep? */ if (sc->mlxd_drive->ms_state == MLX_SYSD_OFFLINE) { - bp->b_error = ENXIO; + bp->bio_error = ENXIO; goto bad; } /* do-nothing operation */ - if (bp->b_bcount == 0) + if (bp->bio_bcount == 0) goto done; devstat_start_transaction(&sc->mlxd_stats); @@ -192,13 +192,13 @@ mlxd_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; } @@ -206,17 +206,17 @@ mlxd_strategy(struct buf *bp) void mlxd_intr(void *data) { - struct buf *bp = (struct buf *)data; - struct mlxd_softc *sc = (struct mlxd_softc *)bp->b_dev->si_drv1; + struct bio *bp = (struct bio *)data; + struct mlxd_softc *sc = (struct mlxd_softc *)bp->bio_dev->si_drv1; debug_called(1); - if (bp->b_ioflags & BIO_ERROR) - bp->b_error = EIO; + if (bp->bio_flags & BIO_ERROR) + bp->bio_error = EIO; else - bp->b_resid = 0; + bp->bio_resid = 0; - devstat_end_transaction_buf(&sc->mlxd_stats, bp); + devstat_end_transaction_bio(&sc->mlxd_stats, bp); biodone(bp); } diff --git a/sys/dev/mlx/mlxvar.h b/sys/dev/mlx/mlxvar.h index cd0cd90..47a5136 100644 --- a/sys/dev/mlx/mlxvar.h +++ b/sys/dev/mlx/mlxvar.h @@ -134,7 +134,7 @@ struct mlx_softc struct mlx_command *mlx_busycmd[MLX_NSLOTS]; /* busy commands */ int mlx_busycmds; /* count of busy commands */ struct mlx_sysdrive mlx_sysdrive[MLX_MAXDRIVES]; /* system drives */ - struct buf_queue_head mlx_bufq; /* outstanding I/O operations */ + struct bio_queue_head mlx_bioq; /* outstanding I/O operations */ int mlx_waitbufs; /* number of bufs awaiting commands */ /* controller status */ @@ -237,7 +237,7 @@ struct mlxd_softc /* * Interface between driver core and disk driver (should be using a bus?) */ -extern int mlx_submit_buf(struct mlx_softc *sc, struct buf *bp); +extern int mlx_submit_buf(struct mlx_softc *sc, struct bio *bp); extern int mlx_submit_ioctl(struct mlx_softc *sc, struct mlx_sysdrive *drive, u_long cmd, caddr_t addr, int32_t flag, struct proc *p); extern void mlxd_intr(void *data); |