PERFORCE change 97345 for review

Scott Long scottl at FreeBSD.org
Wed May 17 16:13:36 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=97345

Change 97345 by scottl at scottl-x64 on 2006/05/17 16:12:33

	Move the highpower variables into the xsoftc.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#29 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#29 (text+ko) ====

@@ -82,7 +82,6 @@
 
 SLIST_HEAD(async_list, async_node);
 SLIST_HEAD(periph_list, cam_periph);
-static STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
 
 /*
  * This is the maximum number of high powered commands (e.g. start unit)
@@ -92,9 +91,6 @@
 #define CAM_MAX_HIGHPOWER  4
 #endif
 
-/* number of high powered commands that can go through right now */
-static int num_highpower = CAM_MAX_HIGHPOWER;
-
 /*
  * Structure for queueing a device in a run queue.
  * There is one run queue for allocating new ccbs,
@@ -243,6 +239,11 @@
 struct xpt_softc {
 	xpt_flags	flags;
 	u_int32_t	generation;
+
+	/* number of high powered commands that can go through right now */
+	int		num_highpower;
+	STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
+
 };
 
 static const char quantum[] = "QUANTUM";
@@ -1369,7 +1370,8 @@
 
 	TAILQ_INIT(&xpt_busses);
 	TAILQ_INIT(&cam_bioq);
-	STAILQ_INIT(&highpowerq);
+	STAILQ_INIT(&xsoftc.highpowerq);
+	xsoftc.num_highpower = CAM_MAX_HIGHPOWER;
 
 	mtx_init(&cam_bioq_lock, "CAM BIOQ lock", NULL, MTX_DEF);
 
@@ -3892,7 +3894,7 @@
 
 		if ((work_ccb->ccb_h.flags & CAM_HIGH_POWER) != 0) {
 
-		 	if (num_highpower <= 0) {
+		 	if (xsoftc.num_highpower <= 0) {
 				/*
 				 * We got a high power command, but we
 				 * don't have any available slots.  Freeze
@@ -3900,7 +3902,7 @@
 				 * available.
 				 */
 				device->qfrozen_cnt++;
-				STAILQ_INSERT_TAIL(&highpowerq, 
+				STAILQ_INSERT_TAIL(&xsoftc.highpowerq, 
 						   &work_ccb->ccb_h, 
 						   xpt_links.stqe);
 
@@ -3911,7 +3913,7 @@
 				 * Consume a high power slot while
 				 * this ccb runs.
 				 */
-				num_highpower--;
+				xsoftc.num_highpower--;
 			}
 		}
 		devq->active_dev = device;
@@ -7122,14 +7124,14 @@
 			struct highpowerlist	*hphead;
 			union ccb		*send_ccb;
 
-			hphead = &highpowerq;
+			hphead = &xsoftc.highpowerq;
 
 			send_ccb = (union ccb *)STAILQ_FIRST(hphead);
 
 			/*
 			 * Increment the count since this command is done.
 			 */
-			num_highpower++;
+			xsoftc.num_highpower++;
 
 			/* 
 			 * Any high powered commands queued up?


More information about the p4-projects mailing list