/* Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) Purpose : remove a specific command from the queues Params : queue - queue to look in SCpnt - command to find Returns : 0 if not found  */
int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
/* Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) Purpose : remove a specific command from the queues Params : queue - queue to look in SCpnt - command to find Returns : 0 if not found  */
int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
{
	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 == SCpnt) {
			__queue_remove(queue, l);
			found = 1;
			break;
		}
	}
	spin_unlock_irqrestore(&queue->queue_lock, flags);
	return found;
}