Skip to contentSkip to conversation

scsi_debug: Convert to host_lock less

PATCH In review Nicholas A. Bellinger 1 participant 1 message Nov 17, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 11/11 scsi_debug: Convert to host_lock less

From: Nicholas Bellinger <[email protected]>

This patch converts scsi_debug to run in host_lock less mode with interrupts enabled, as we don't have a underly HW reason to use IRQ_DISABLE_SCSI_QCMD().

---
 drivers/scsi/scsi_debug.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
drivers/scsi/scsi_debug.c +7 -9
index c499eb3..71cd1fa 100644
@@ -3538,7 +3538,7 @@ static void sdebug_remove_adapter(void)
 }
 
 static
-int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
+int scsi_debug_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *SCpnt)
 {
 	unsigned char *cmd = (unsigned char *) SCpnt->cmnd;
 	int len, k;
@@ -3566,17 +3566,17 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
 	if (target == SCpnt->device->host->hostt->this_id) {
 		printk(KERN_INFO "scsi_debug: initiator's id used as "
 		       "target!\n");
-		return schedule_resp(SCpnt, NULL, done,
+		return schedule_resp(SCpnt, NULL, SCpnt->scsi_done,
 				     DID_NO_CONNECT << 16, 0);
 	}
 
 	if ((SCpnt->device->lun >= scsi_debug_max_luns) &&
 	    (SCpnt->device->lun != SAM2_WLUN_REPORT_LUNS))
-		return schedule_resp(SCpnt, NULL, done,
+		return schedule_resp(SCpnt, NULL, SCpnt->scsi_done,
 				     DID_NO_CONNECT << 16, 0);
 	devip = devInfoReg(SCpnt->device);
 	if (NULL == devip)
-		return schedule_resp(SCpnt, NULL, done,
+		return schedule_resp(SCpnt, NULL, SCpnt->scsi_done,
 				     DID_NO_CONNECT << 16, 0);
 
 	if ((scsi_debug_every_nth != 0) &&
@@ -3610,8 +3610,8 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
 			mk_sense_buffer(devip, ILLEGAL_REQUEST,
 					INVALID_OPCODE, 0);
 			errsts = check_condition_result;
-			return schedule_resp(SCpnt, devip, done, errsts,
-					     0);
+			return schedule_resp(SCpnt, devip, SCpnt->scsi_done,
+						errsts, 0);
 		}
 	}
 
@@ -3885,12 +3885,10 @@ xdwrite_read:
 		errsts = check_condition_result;
 		break;
 	}
-	return schedule_resp(SCpnt, devip, done, errsts,
+	return schedule_resp(SCpnt, devip, SCpnt->scsi_done, errsts,
 			     (delay_override ? 0 : scsi_debug_delay));
 }
 
-static DEF_SCSI_QCMD(scsi_debug_queuecommand)
-
 static struct scsi_host_template sdebug_driver_template = {
 	.proc_info =		scsi_debug_proc_info,
 	.proc_name =		sdebug_proc_name,
Signature · 1 line
1.7.2.3