patch-2.4.22 linux-2.4.22/drivers/acorn/scsi/queue.c

Next file: linux-2.4.22/drivers/acorn/scsi/queue.h
Previous file: linux-2.4.22/drivers/acorn/scsi/powertec.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/acorn/scsi/queue.c linux-2.4.22/drivers/acorn/scsi/queue.c
@@ -229,6 +229,27 @@
 }
 
 /*
+ * Function: queue_remove_all_target(queue, target)
+ * Purpose : remove all SCSI commands from the queue for a specified target
+ * Params  : queue  - queue to remove command from
+ *           target - target device id
+ * Returns : nothing
+ */
+void queue_remove_all_target(Queue_t *queue, int target)
+{
+	unsigned long flags;
+	struct list_head *l;
+
+	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->target == target)
+			__queue_remove(queue, l);
+	}
+	spin_unlock_irqrestore(&queue->queue_lock, flags);
+}
+
+/*
  * Function: int queue_probetgtlun (queue, target, lun)
  * Purpose : check to see if we have a command in the queue for the specified
  *	     target/lun.
@@ -290,6 +311,7 @@
 EXPORT_SYMBOL(queue_remove_exclude);
 EXPORT_SYMBOL(queue_remove_tgtluntag);
 EXPORT_SYMBOL(queue_remove_cmd);
+EXPORT_SYMBOL(queue_remove_all_target);
 EXPORT_SYMBOL(queue_probetgtlun);
 
 MODULE_AUTHOR("Russell King");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)