/* Function: struct scsi_cmnd *queue_remove (queue) Purpose : removes first SCSI command from a queue Params : queue - queue to remove command from Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available  */
struct scsi_cmnd* queue_remove(Queue_t *queue)
/* Function: struct scsi_cmnd *queue_remove (queue) Purpose : removes first SCSI command from a queue Params : queue - queue to remove command from Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available  */
struct scsi_cmnd* queue_remove(Queue_t *queue)
{
	unsigned long flags;
	struct scsi_cmnd *SCpnt = NULL;
	spin_lock_irqsave(&queue->queue_lock, flags);
	if (!list_empty(&queue->head))
		SCpnt = __queue_remove(queue, queue->head.next);
	spin_unlock_irqrestore(&queue->queue_lock, flags);
	return SCpnt;
}