[Midnightbsd-cvs] src [8748] trunk/sys/cam: Remove priority enforcement from xpt_ation()

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 22:29:23 EDT 2016


Revision: 8748
          http://svnweb.midnightbsd.org/src/?rev=8748
Author:   laffer1
Date:     2016-09-25 22:29:23 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
Remove priority enforcement from xpt_ation()

Modified Paths:
--------------
    trunk/sys/cam/cam.h
    trunk/sys/cam/cam_xpt.c
    trunk/sys/cam/scsi/scsi_pass.c

Modified: trunk/sys/cam/cam.h
===================================================================
--- trunk/sys/cam/cam.h	2016-09-26 02:28:47 UTC (rev 8747)
+++ trunk/sys/cam/cam.h	2016-09-26 02:29:23 UTC (rev 8748)
@@ -83,6 +83,7 @@
 #define CAM_PRIORITY_NORMAL	((CAM_RL_NORMAL << 8) + 0x80)
 #define CAM_PRIORITY_NONE	(u_int32_t)-1
 #define CAM_PRIORITY_TO_RL(x)	((x) >> 8)
+#define CAM_RL_TO_PRIORITY(x)	((x) << 8)
 	u_int32_t generation;
 	int       index;
 #define CAM_UNQUEUED_INDEX	-1

Modified: trunk/sys/cam/cam_xpt.c
===================================================================
--- trunk/sys/cam/cam_xpt.c	2016-09-26 02:28:47 UTC (rev 8747)
+++ trunk/sys/cam/cam_xpt.c	2016-09-26 02:29:23 UTC (rev 8748)
@@ -2466,9 +2466,6 @@
 	CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n"));
 
 	start_ccb->ccb_h.status = CAM_REQ_INPROG;
-	/* Compatibility for RL-unaware code. */
-	if (CAM_PRIORITY_TO_RL(start_ccb->ccb_h.pinfo.priority) == 0)
-	    start_ccb->ccb_h.pinfo.priority += CAM_PRIORITY_NORMAL - 1;
 	(*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb);
 }
 

Modified: trunk/sys/cam/scsi/scsi_pass.c
===================================================================
--- trunk/sys/cam/scsi/scsi_pass.c	2016-09-26 02:28:47 UTC (rev 8747)
+++ trunk/sys/cam/scsi/scsi_pass.c	2016-09-26 02:29:23 UTC (rev 8748)
@@ -521,6 +521,7 @@
 	struct	cam_periph *periph;
 	struct	pass_softc *softc;
 	int	error;
+	uint32_t priority;
 
 	periph = (struct cam_periph *)dev->si_drv1;
 	if (periph == NULL)
@@ -553,6 +554,11 @@
 			break;
 		}
 
+		/* Compatibility for RL/priority-unaware code. */
+		priority = inccb->ccb_h.pinfo.priority;
+		if (priority < CAM_RL_TO_PRIORITY(CAM_RL_NORMAL))
+		    priority += CAM_RL_TO_PRIORITY(CAM_RL_NORMAL);
+
 		/*
 		 * Non-immediate CCBs need a CCB from the per-device pool
 		 * of CCBs, which is scheduled by the transport layer.
@@ -561,8 +567,7 @@
 		 */
 		if ((inccb->ccb_h.func_code & XPT_FC_QUEUED)
 		 && ((inccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0)) {
-			ccb = cam_periph_getccb(periph,
-						inccb->ccb_h.pinfo.priority);
+			ccb = cam_periph_getccb(periph, priority);
 			ccb_malloced = 0;
 		} else {
 			ccb = xpt_alloc_ccb_nowait();
@@ -569,7 +574,7 @@
 
 			if (ccb != NULL)
 				xpt_setup_ccb(&ccb->ccb_h, periph->path,
-					      inccb->ccb_h.pinfo.priority);
+					      priority);
 			ccb_malloced = 1;
 		}
 



More information about the Midnightbsd-cvs mailing list