FreeBSD/sys/cam/cam_iosched.c
/*
 * Complete a bio. Called before we release the ccb with xpt_release_ccb so we
 * might use notes in the ccb for statistics.
 */
Complete a bio. Called before we release the ccb with xpt_release_ccb so we
might use notes in the ccb for statistics.
Complete a bio . Called before we release the ccb with xpt_release_ccb so we might use notes in the ccb for statistics .
int
cam_iosched_bio_complete(struct cam_iosched_softc *isc, struct bio *bp,
    union ccb *done_ccb)
{
	int retval = 0;
#ifdef CAM_IOSCHED_DYNAMIC
	if (!do_dynamic_iosched)
		return retval;
	if (iosched_debug > 10)
		printf("done: %p %#x\n", bp, bp->bio_cmd);
	if (bp->bio_cmd == BIO_WRITE) {
		retval = cam_iosched_limiter_iodone(&isc->write_stats, bp);
		isc->write_stats.out++;
		isc->write_stats.pending--;
	} else if (bp->bio_cmd == BIO_READ) {
		retval = cam_iosched_limiter_iodone(&isc->read_stats, bp);
		isc->read_stats.out++;
		isc->read_stats.pending--;
	} else if (bp->bio_cmd == BIO_DELETE) {
		isc->trim_stats.out++;
		isc->trim_stats.pending--;
	} else if (bp->bio_cmd != BIO_FLUSH) {
		if (iosched_debug)
			printf("Completing command with bio_cmd == %#x\n", bp->bio_cmd);
	}
	if (!(bp->bio_flags & BIO_ERROR))
		cam_iosched_io_metric_update(isc, done_ccb->ccb_h.qos.sim_data,
		    bp->bio_cmd, bp->bio_bcount);
#endif
	return retval;
}
int cam_iosched_bio_complete ( struct cam_iosched_softc * isc , struct bio * bp , union ccb * done_ccb ) { int retval = 0 ; #ifdef CAM_IOSCHED_DYNAMIC if ( ! do_dynamic_iosched ) return retval ; if ( iosched_debug > 10 ) printf ( " \n " , bp , bp -> bio_cmd ) ; if ( bp -> bio_cmd == BIO_WRITE ) { retval = cam_iosched_limiter_iodone ( & isc -> write_stats , bp ) ; isc -> write_stats . out ++ ; isc -> write_stats . pending -- ; } else if ( bp -> bio_cmd == BIO_READ ) { retval = cam_iosched_limiter_iodone ( & isc -> read_stats , bp ) ; isc -> read_stats . out ++ ; isc -> read_stats . pending -- ; } else if ( bp -> bio_cmd == BIO_DELETE ) { isc -> trim_stats . out ++ ; isc -> trim_stats . pending -- ; } else if ( bp -> bio_cmd != BIO_FLUSH ) { if ( iosched_debug ) printf ( " \n " , bp -> bio_cmd ) ; } if ( ! ( bp -> bio_flags & BIO_ERROR ) ) cam_iosched_io_metric_update ( isc , done_ccb -> ccb_h . qos . sim_data , bp -> bio_cmd , bp -> bio_bcount ) ; #endif return retval ; }
Complete a bio.
Complete a bio .