FreeBSD/sys/cam/cam_iosched.c
/*
 * gets the next trim from the trim queue.
 *
 * Assumes we're called with the periph lock held.  It removes this
 * trim from the queue and the device must explicitly reinstert it
 * should the need arise.
 */
gets the next trim from the trim queue.
Assumes we're called with the periph lock held.  It removes this
trim from the queue and the device must explicitly reinstert it
should the need arise.
gets the next trim from the trim queue . Assumes we ' re called with the periph lock held . It removes this trim from the queue and the device must explicitly reinstert it should the need arise .
struct bio *
cam_iosched_next_trim(struct cam_iosched_softc *isc)
{
	struct bio *bp;
	bp  = bioq_first(&isc->trim_queue);
	if (bp == NULL)
		return NULL;
	bioq_remove(&isc->trim_queue, bp);
#ifdef CAM_IOSCHED_DYNAMIC
	isc->trim_stats.queued--;
	isc->trim_stats.total++;
	isc->trim_stats.pending++;
#endif
	return bp;
}
struct bio * cam_iosched_next_trim ( struct cam_iosched_softc * isc ) { struct bio * bp ; bp = bioq_first ( & isc -> trim_queue ) ; if ( bp == NULL ) return NULL ; bioq_remove ( & isc -> trim_queue , bp ) ; #ifdef CAM_IOSCHED_DYNAMIC isc -> trim_stats . queued -- ; isc -> trim_stats . total ++ ; isc -> trim_stats . pending ++ ; #endif return bp ; }
gets the next trim from the trim queue.
gets the next trim from the trim queue .