summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_queue.h
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-04-19 21:26:08 +0000
committergibbs <gibbs@FreeBSD.org>1999-04-19 21:26:08 +0000
commit752ab9a8587b6cc446cde857f5bb2361eed5c846 (patch)
treea534a3da6fa8385d145943dcd7c44a6cd687af4d /sys/cam/cam_queue.h
parent1626101dd4984de63fb4928fa8e59fb6fa5651ff (diff)
downloadFreeBSD-src-752ab9a8587b6cc446cde857f5bb2361eed5c846.zip
FreeBSD-src-752ab9a8587b6cc446cde857f5bb2361eed5c846.tar.gz
cam_periph.c:
Move handling of CAM_AUTOSENSE_FAIL into block dealing with all other scsi status errors. cam_queue.c: cam_queue.h: Fix 'off by one' heap bug in a more efficient manner. Since heap algorithms like to deal with indexes started from 1, offset our heap array pointer at allocation time to make this so for a C environment. This makes the implementation of the algorithm a bit more efficient. cam_xpt.c: Use macros for accessing the head of the heap so that code is isolated from implementation details of the heap.
Diffstat (limited to 'sys/cam/cam_queue.h')
-rw-r--r--sys/cam/cam_queue.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/cam_queue.h b/sys/cam/cam_queue.h
index c9135b7..3668525 100644
--- a/sys/cam/cam_queue.h
+++ b/sys/cam/cam_queue.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_queue.h,v 1.2 1998/12/15 08:12:03 gibbs Exp $
+ * $Id: cam_queue.h,v 1.3 1999/04/07 22:57:48 gibbs Exp $
*/
#ifndef _CAM_CAM_QUEUE_H
@@ -136,6 +136,10 @@ void camq_insert(struct camq *queue, cam_pinfo *new_entry);
* queue order.
*/
cam_pinfo *camq_remove(struct camq *queue, int index);
+#define CAMQ_HEAD 1 /* Head of queue index */
+
+/* Index the first element in the heap */
+#define CAMQ_GET_HEAD(camq) ((camq)->queue_array[CAMQ_HEAD])
/*
* camq_change_priority: Raise or lower the priority of an entry
OpenPOWER on IntegriCloud