summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx/mlx_disk.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-09-26 14:17:14 +0000
committerjhb <jhb@FreeBSD.org>2012-09-26 14:17:14 +0000
commit0f201020a966762713f1270123010d0f9914a19e (patch)
treeea88c9af16e6a884041165d247f6895d37d5214d /sys/dev/mlx/mlx_disk.c
parent05997f4f4428797447c8d46dbbf17f2bf9b47cce (diff)
downloadFreeBSD-src-0f201020a966762713f1270123010d0f9914a19e.zip
FreeBSD-src-0f201020a966762713f1270123010d0f9914a19e.tar.gz
Remove FreeBSD 4.x compat shims. Verified by md5.
Diffstat (limited to 'sys/dev/mlx/mlx_disk.c')
-rw-r--r--sys/dev/mlx/mlx_disk.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/dev/mlx/mlx_disk.c b/sys/dev/mlx/mlx_disk.c
index 8276a4a..3b86665 100644
--- a/sys/dev/mlx/mlx_disk.c
+++ b/sys/dev/mlx/mlx_disk.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/bio.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/module.h>
@@ -48,7 +49,6 @@ __FBSDID("$FreeBSD$");
#include <geom/geom_disk.h>
-#include <dev/mlx/mlx_compat.h>
#include <dev/mlx/mlxio.h>
#include <dev/mlx/mlxvar.h>
#include <dev/mlx/mlxreg.h>
@@ -142,15 +142,16 @@ mlxd_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td)
* be a multiple of a sector in length.
*/
static void
-mlxd_strategy(mlx_bio *bp)
+mlxd_strategy(struct bio *bp)
{
- struct mlxd_softc *sc = (struct mlxd_softc *)MLX_BIO_SOFTC(bp);
+ struct mlxd_softc *sc = bp->bio_disk->d_drv1;
debug_called(1);
/* bogus disk? */
if (sc == NULL) {
- MLX_BIO_SET_ERROR(bp, EINVAL);
+ bp->bio_error = EINVAL;
+ bp->bio_flags |= BIO_ERROR;
goto bad;
}
@@ -158,11 +159,11 @@ mlxd_strategy(mlx_bio *bp)
MLX_IO_LOCK(sc->mlxd_controller);
if (sc->mlxd_drive->ms_state == MLX_SYSD_OFFLINE) {
MLX_IO_UNLOCK(sc->mlxd_controller);
- MLX_BIO_SET_ERROR(bp, ENXIO);
+ bp->bio_error = ENXIO;
+ bp->bio_flags |= BIO_ERROR;
goto bad;
}
- MLX_BIO_STATS_START(bp);
mlx_submit_buf(sc->mlxd_controller, bp);
MLX_IO_UNLOCK(sc->mlxd_controller);
return;
@@ -171,25 +172,23 @@ mlxd_strategy(mlx_bio *bp)
/*
* Correctly set the bio to indicate a failed tranfer.
*/
- MLX_BIO_RESID(bp) = MLX_BIO_LENGTH(bp);
- MLX_BIO_DONE(bp);
+ bp->bio_resid = bp->bio_bcount;
+ biodone(bp);
return;
}
void
-mlxd_intr(void *data)
+mlxd_intr(struct bio *bp)
{
- mlx_bio *bp = (mlx_bio *)data;
debug_called(1);
- if (MLX_BIO_HAS_ERROR(bp))
- MLX_BIO_SET_ERROR(bp, EIO);
+ if (bp->bio_flags & BIO_ERROR)
+ bp->bio_error = EIO;
else
- MLX_BIO_RESID(bp) = 0;
+ bp->bio_resid = 0;
- MLX_BIO_STATS_END(bp);
- MLX_BIO_DONE(bp);
+ biodone(bp);
}
static int
OpenPOWER on IntegriCloud