/* Function: int queue_probetgtlun (queue, target, lun) Purpose : check to see if we have a command in the queue for the specified target/lun. Params : queue - queue to look in target - target we want to probe lun - lun on target Returns : 0 if not found, != 0 if found  */
int queue_probetgtlun(Queue_t *queue, int target, int lun)
/* Function: int queue_probetgtlun (queue, target, lun) Purpose : check to see if we have a command in the queue for the specified target/lun. Params : queue - queue to look in target - target we want to probe lun - lun on target Returns : 0 if not found, != 0 if found  */
int queue_probetgtlun(Queue_t *queue, int target, int lun)
{
	unsigned long flags;
	struct list_head *l;
	int found = 0;
	spin_lock_irqsave(&queue->queue_lock, flags);
	list_for_each(l, &queue->head) {
		QE_t *q = list_entry(l, QE_t, list);
		if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun) {
			found = 1;
			break;
		}
	}
	spin_unlock_irqrestore(&queue->queue_lock, flags);
	return found;
}