FreeBSD/sys/cam/ctl/ctl.c
/*
 * Check for blockage or overlaps against the OOA (Order Of Arrival) queue.
 * Assumptions:
 * - pending_io is generally either incoming, or on the blocked queue
 * - starting I/O is the I/O we want to start the check with.
 */
Check for blockage or overlaps against the OOA (Order Of Arrival) queue.
Assumptions:
- pending_io is generally either incoming, or on the blocked queue
- starting I/O is the I/O we want to start the check with.
Check for blockage or overlaps against the OOA ( Order Of Arrival ) queue . Assumptions : - pending_io is generally either incoming or on the blocked queue - starting I / O is the I / O we want to start the check with .
static ctl_action
ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io,
	      union ctl_io *starting_io)
{
	union ctl_io *ooa_io;
	ctl_action action;
	mtx_assert(&lun->lun_lock, MA_OWNED);
	for (ooa_io = starting_io; ooa_io != NULL;
	     ooa_io = (union ctl_io *)TAILQ_PREV(&ooa_io->io_hdr, ctl_ooaq,
	     ooa_links)){
		action = ctl_check_for_blockage(lun, pending_io, ooa_io);
		switch (action) {
		case CTL_ACTION_BLOCK:
		case CTL_ACTION_OVERLAP:
		case CTL_ACTION_OVERLAP_TAG:
		case CTL_ACTION_SKIP:
		case CTL_ACTION_ERROR:
			return (action);
			break; 
		case CTL_ACTION_PASS:
			break;
		default:
			panic("%s: Invalid action %d\n", __func__, action);
		}
	}
	return (CTL_ACTION_PASS);
}
static ctl_action ctl_check_ooa ( struct ctl_lun * lun , union ctl_io * pending_io , union ctl_io * starting_io ) { union ctl_io * ooa_io ; ctl_action action ; mtx_assert ( & lun -> lun_lock , MA_OWNED ) ; for ( ooa_io = starting_io ; ooa_io != NULL ; ooa_io = ( union ctl_io * ) TAILQ_PREV ( & ooa_io -> io_hdr , ctl_ooaq , ooa_links ) ) { action = ctl_check_for_blockage ( lun , pending_io , ooa_io ) ; switch ( action ) { case CTL_ACTION_BLOCK : case CTL_ACTION_OVERLAP : case CTL_ACTION_OVERLAP_TAG : case CTL_ACTION_SKIP : case CTL_ACTION_ERROR : return ( action ) ; break ; case CTL_ACTION_PASS : break ; default : panic ( " \n " , __func__ , action ) ; } } return ( CTL_ACTION_PASS ) ; }
Check for blockage or overlaps against the OOA (Order Of Arrival) queue.
Check for blockage or overlaps against the OOA ( Order Of Arrival ) queue .
/*
	 * Run back along the OOA queue, starting with the current
	 * blocked I/O and going through every I/O before it on the
	 * queue.  If starting_io is NULL, we'll just end up returning
	 * CTL_ACTION_PASS.
	 */ /*
		 * This routine just checks to see whether
		 * cur_blocked is blocked by ooa_io, which is ahead
		 * of it in the queue.  It doesn't queue/dequeue
		 * cur_blocked.
		 */ /* NOTREACHED */