mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: James.Bottomley@steeleye.com, axboe@suse.de,
	Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH scsi-misc-2.6 02/07] scsi: make scsi_retry_command() use scsi_requeue_command()
Date: Tue, 12 Apr 2005 21:52:31 +0900 (KST)	[thread overview]
Message-ID: <20050412125219.9CE3E027@htj.dyndns.org> (raw)
In-Reply-To: <20050412125219.88E5C1F6@htj.dyndns.org>

02_scsi_requeue_use_scsi_requeue_command_in_scsi_retry_command.patch

	scsi_retry_command() orignally used scsi_queue_insert() for
	requeueing.  This patch makes it use scsi_retry_command()
	instead.  Adding a call to scsi_device_unbusy() is sufficient
	and the change also makes scsi_retry_command() symmetric with
	scsi_finish_command() in how it unbusies the command.  Also as
	there's nothing to return, make the function void.

Signed-off-by: Tejun Heo <htejun@gmail.com>

 scsi.c      |    8 ++++++--
 scsi_priv.h |    2 +-
 2 files changed, 7 insertions(+), 3 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
@@ -669,8 +669,12 @@ static void scsi_softirq(struct softirq_
  *              level drivers should not become re-entrant as a result of
  *              this.
  */
-int scsi_retry_command(struct scsi_cmnd *cmd)
+void scsi_retry_command(struct scsi_cmnd *cmd)
 {
+	SCSI_LOG_MLQUEUE(1, printk("Retrying command %p\n", cmd));
+
+	scsi_device_unbusy(cmd->device);
+
 	/*
 	 * Restore the SCSI command state.
 	 */
@@ -682,7 +686,7 @@ int scsi_retry_command(struct scsi_cmnd 
          */
 	memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));
 
-	return scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
+	scsi_requeue_command(cmd);
 }
 
 /*
Index: scsi-reqfn-export/drivers/scsi/scsi_priv.h
===================================================================
--- scsi-reqfn-export.orig/drivers/scsi/scsi_priv.h	2005-04-12 21:50:11.000000000 +0900
+++ scsi-reqfn-export/drivers/scsi/scsi_priv.h	2005-04-12 21:50:11.000000000 +0900
@@ -60,7 +60,7 @@ extern void scsi_exit_hosts(void);
 extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
 extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
 extern void scsi_done(struct scsi_cmnd *cmd);
-extern int scsi_retry_command(struct scsi_cmnd *cmd);
+extern void scsi_retry_command(struct scsi_cmnd *cmd);
 extern int scsi_insert_special_req(struct scsi_request *sreq, int);
 extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
 		struct scsi_request *sreq);


  parent reply	other threads:[~2005-04-12 12:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-12 12:52 [PATCH scsi-misc-2.6 00/07] scsi: requeue path consolidation Tejun Heo
2005-04-12 12:52 ` [PATCH scsi-misc-2.6 01/07] scsi: update and make public scsi_requeue_command() Tejun Heo
2005-04-12 12:52 ` Tejun Heo [this message]
2005-04-12 12:52 ` [PATCH scsi-misc-2.6 03/07] scsi: replace scsi_queue_insert() usages with scsi_retry_command() Tejun Heo
2005-04-12 12:52 ` [PATCH scsi-misc-2.6 04/07] scsi: remove scsi_queue_insert() Tejun Heo
2005-04-12 12:52 ` [PATCH scsi-misc-2.6 05/07] scsi: move scsi_init_cmd_errh() from request_fn to prep_fn Tejun Heo
2005-04-12 12:52 ` [PATCH scsi-misc-2.6 06/07] scsi: add cmd->result clearing Tejun Heo
2005-04-12 12:52 ` [PATCH scsi-misc-2.6 07/07] scsi: consolidate scsi_cmd_retry() calls Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050412125219.9CE3E027@htj.dyndns.org \
    --to=htejun@gmail.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=axboe@suse.de \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®