static void ipsd_strategy(struct bio *iobuf) { ipsdisk_softc_t *dsc; dsc = iobuf->bio_disk->d_drv1; DEVICE_PRINTF(8,dsc->dev,"in strategy\n"); iobuf->bio_driver1 = (void *)(uintptr_t)dsc->sc->drives[dsc->disk_number].drivenum; mtx_lock(&dsc->sc->queue_mtx); bioq_insert_tail(&dsc->sc->queue, iobuf); ips_start_io_request(dsc->sc); mtx_unlock(&dsc->sc->queue_mtx); }
/* ipsd_finish is called to clean up and return a completed IO request */ void ipsd_finish(struct bio *iobuf) { ipsdisk_softc_t *dsc; dsc = iobuf->bio_disk->d_drv1; if (iobuf->bio_flags & BIO_ERROR) { ipsdisk_softc_t *dsc; dsc = iobuf->bio_disk->d_drv1; device_printf(dsc->dev, "iobuf error %d\n", iobuf->bio_error); } else iobuf->bio_resid = 0; biodone(iobuf); ips_start_io_request(dsc->sc); }
/* ipsd_finish is called to clean up and return a completed IO request */ void ipsd_finish(struct bio *bio) { struct buf *bp = bio->bio_buf; ipsdisk_softc_t *dsc; dsc = bio->bio_driver_info; if (bp->b_flags & B_ERROR) { device_printf(dsc->dev, "iobuf error %d\n", bp->b_error); } else { bp->b_resid = 0; } devstat_end_transaction_buf(&dsc->stats, bp); biodone(bio); ips_start_io_request(dsc->sc); }
static int ipsd_strategy(struct dev_strategy_args *ap) { cdev_t dev = ap->a_head.a_dev; struct bio *bio = ap->a_bio; ipsdisk_softc_t *dsc; dsc = dev->si_drv1; DEVICE_PRINTF(8, dsc->dev, "in strategy\n"); bio->bio_driver_info = dsc; devstat_start_transaction(&dsc->stats); lockmgr(&dsc->sc->queue_lock, LK_EXCLUSIVE|LK_RETRY); bioqdisksort(&dsc->sc->bio_queue, bio); ips_start_io_request(dsc->sc); lockmgr(&dsc->sc->queue_lock, LK_RELEASE); return(0); }