FreeBSD/sys/cam/cam_iosched.c
/*
 * Reclaim all used resources. This assumes that other folks have
 * drained the requests in the hardware. Maybe an unwise assumption.
 */
Reclaim all used resources. This assumes that other folks have
drained the requests in the hardware. Maybe an unwise assumption.
Reclaim all used resources . This assumes that other folks have drained the requests in the hardware . Maybe an unwise assumption .
void
cam_iosched_fini(struct cam_iosched_softc *isc)
{
	if (isc) {
		cam_iosched_flush(isc, NULL, ENXIO);
#ifdef CAM_IOSCHED_DYNAMIC
		cam_iosched_iop_stats_fini(&isc->read_stats);
		cam_iosched_iop_stats_fini(&isc->write_stats);
		cam_iosched_iop_stats_fini(&isc->trim_stats);
		cam_iosched_cl_sysctl_fini(&isc->cl);
		if (isc->sysctl_tree)
			if (sysctl_ctx_free(&isc->sysctl_ctx) != 0)
				printf("can't remove iosched sysctl stats context\n");
		if (isc->flags & CAM_IOSCHED_FLAG_CALLOUT_ACTIVE) {
			callout_drain(&isc->ticker);
			isc->flags &= ~ CAM_IOSCHED_FLAG_CALLOUT_ACTIVE;
		}
#endif
		free(isc, M_CAMSCHED);
	}
}
void cam_iosched_fini ( struct cam_iosched_softc * isc ) { if ( isc ) { cam_iosched_flush ( isc , NULL , ENXIO ) ; #ifdef CAM_IOSCHED_DYNAMIC cam_iosched_iop_stats_fini ( & isc -> read_stats ) ; cam_iosched_iop_stats_fini ( & isc -> write_stats ) ; cam_iosched_iop_stats_fini ( & isc -> trim_stats ) ; cam_iosched_cl_sysctl_fini ( & isc -> cl ) ; if ( isc -> sysctl_tree ) if ( sysctl_ctx_free ( & isc -> sysctl_ctx ) != 0 ) printf ( " \n " ) ; if ( isc -> flags & CAM_IOSCHED_FLAG_CALLOUT_ACTIVE ) { callout_drain ( & isc -> ticker ) ; isc -> flags &= ~ CAM_IOSCHED_FLAG_CALLOUT_ACTIVE ; } #endif free ( isc , M_CAMSCHED ) ; } }
Reclaim all used resources.
Reclaim all used resources .