Esempio n. 1
0
/********************************************************************************
 * Handle an I/O request.
 */
static void
twed_strategy(twe_bio *bp)
{
    struct twed_softc	*sc = (struct twed_softc *)TWE_BIO_SOFTC(bp);

    debug_called(4);

    TWED_BIO_IN;

    /* bogus disk? */
    if (sc == NULL) {
	TWE_BIO_SET_ERROR(bp, EINVAL);
	printf("twe: bio for invalid disk!\n");
	TWE_BIO_DONE(bp);
	TWED_BIO_OUT;
	return;
    }

    /* perform accounting */
    TWE_BIO_STATS_START(bp);

    /* queue the bio on the controller */
    twe_enqueue_bio(sc->twed_controller, bp);

    /* poke the controller to start I/O */
    twe_startio(sc->twed_controller);
    return;
}
Esempio n. 2
0
/********************************************************************************
 * Handle an I/O request.
 */
static void
twed_strategy(struct bio *bp)
{
    struct twed_softc	*sc = bp->bio_disk->d_drv1;

    debug_called(4);

    bp->bio_driver1 = &sc->twed_drive->td_twe_unit;
    TWED_BIO_IN;

    /* bogus disk? */
    if (sc == NULL || sc->twed_drive->td_disk == NULL) {
	bp->bio_error = EINVAL;
	bp->bio_flags |= BIO_ERROR;
	printf("twe: bio for invalid disk!\n");
	biodone(bp);
	TWED_BIO_OUT;
	return;
    }

    /* queue the bio on the controller */
    TWE_IO_LOCK(sc->twed_controller);
    twe_enqueue_bio(sc->twed_controller, bp);

    /* poke the controller to start I/O */
    twe_startio(sc->twed_controller);
    TWE_IO_UNLOCK(sc->twed_controller);
    return;
}