Re: [PATCH scsi-misc-2.6 03/07] scsi: replace scsi_queue_insert() usages with scsi_retry_command()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



03_scsi_requeue_use_scsi_retry_command_instead_of_scsi_queue_insert.patch

	There are two users of scsi_queue_insert() left now.  One in
	scsi_softirq() and the other in scsi_eh_flush_done_q().  The
	only additional functionality of scsi_queue_insert() used is
	setting device_blocked on ADD_TO_MLQUEUE case in
	scsi_softirq().

	Open code device_blocked setting and replace
	scsi_queue_insert() with scsi_retry_command() in both cases.

Signed-off-by: Tejun Heo <[email protected]>

 scsi.c       |    7 ++++---
 scsi_error.c |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

Index: scsi-reqfn-export/drivers/scsi/scsi.c
===================================================================
--- scsi-reqfn-export.orig/drivers/scsi/scsi.c	2005-04-12 21:50:11.000000000 +0900
+++ scsi-reqfn-export/drivers/scsi/scsi.c	2005-04-12 21:50:11.000000000 +0900
@@ -638,6 +638,7 @@ static void scsi_softirq(struct softirq_
 	while (!list_empty(&local_q)) {
 		struct scsi_cmnd *cmd = list_entry(local_q.next,
 						   struct scsi_cmnd, eh_entry);
+		struct scsi_device *sdev = cmd->device;
 		list_del_init(&cmd->eh_entry);
 
 		disposition = scsi_decide_disposition(cmd);
@@ -646,12 +647,12 @@ static void scsi_softirq(struct softirq_
 		case SUCCESS:
 			scsi_finish_command(cmd);
 			break;
+		case ADD_TO_MLQUEUE:
+			sdev->device_blocked = sdev->max_device_blocked;
+			/* fall through */
 		case NEEDS_RETRY:
 			scsi_retry_command(cmd);
 			break;
-		case ADD_TO_MLQUEUE:
-			scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
-			break;
 		default:
 			if (!scsi_eh_scmd_add(cmd, 0))
 				scsi_finish_command(cmd);
Index: scsi-reqfn-export/drivers/scsi/scsi_error.c
===================================================================
--- scsi-reqfn-export.orig/drivers/scsi/scsi_error.c	2005-04-12 21:50:10.000000000 +0900
+++ scsi-reqfn-export/drivers/scsi/scsi_error.c	2005-04-12 21:50:11.000000000 +0900
@@ -1522,7 +1522,7 @@ static void scsi_eh_flush_done_q(struct 
 							  " retry cmd: %p\n",
 							  current->comm,
 							  scmd));
-				scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
+			scsi_retry_command(scmd);
 		} else {
 			if (!scmd->result)
 				scmd->result |= (DRIVER_TIMEOUT << 24);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux