From: Christoph Hellwig <hch@lst.de>
To: James.Bottomley@steeleye.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] kill of ->command
Date: Mon, 9 Jun 2003 18:20:56 +0200 [thread overview]
Message-ID: <20030609162056.GA1857@lst.de> (raw)
It's unused now. Also kill off the stupid = NULL initializations
in usb-storage that made this not compile the first time..
diff -Nru a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
--- a/drivers/scsi/scsi.c Sun Jun 8 20:31:57 2003
+++ b/drivers/scsi/scsi.c Sun Jun 8 20:31:57 2003
@@ -441,29 +441,18 @@
goto out;
}
- if (host->can_queue) {
- SCSI_LOG_MLQUEUE(3, printk("queuecommand : routine at %p\n",
- host->hostt->queuecommand));
+ SCSI_LOG_MLQUEUE(3, printk("queuecommand : routine at %p\n",
+ host->hostt->queuecommand));
- spin_lock_irqsave(host->host_lock, flags);
- rtn = host->hostt->queuecommand(cmd, scsi_done);
- spin_unlock_irqrestore(host->host_lock, flags);
- if (rtn) {
- scsi_queue_insert(cmd,
+ spin_lock_irqsave(host->host_lock, flags);
+ rtn = host->hostt->queuecommand(cmd, scsi_done);
+ spin_unlock_irqrestore(host->host_lock, flags);
+ if (rtn) {
+ scsi_queue_insert(cmd,
(rtn == SCSI_MLQUEUE_DEVICE_BUSY) ?
- rtn : SCSI_MLQUEUE_HOST_BUSY);
- SCSI_LOG_MLQUEUE(3,
- printk("queuecommand : request rejected\n"));
- }
- } else {
- SCSI_LOG_MLQUEUE(3, printk("command() : routine at %p\n",
- host->hostt->command));
-
- spin_lock_irqsave(host->host_lock, flags);
- cmd->result = host->hostt->command(cmd);
- scsi_done(cmd);
- spin_unlock_irqrestore(host->host_lock, flags);
- rtn = 0;
+ rtn : SCSI_MLQUEUE_HOST_BUSY);
+ SCSI_LOG_MLQUEUE(3,
+ printk("queuecommand : request rejected\n"));
}
out:
diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c Sun Jun 8 20:31:57 2003
+++ b/drivers/scsi/scsi_error.c Sun Jun 8 20:31:57 2003
@@ -435,6 +435,7 @@
static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
{
struct Scsi_Host *host = scmd->device->host;
+ DECLARE_MUTEX_LOCKED(sem);
unsigned long flags;
int rtn = SUCCESS;
@@ -448,71 +449,53 @@
scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
(scmd->device->lun << 5 & 0xe0);
- if (host->can_queue) {
- DECLARE_MUTEX_LOCKED(sem);
+ scsi_add_timer(scmd, timeout, scsi_eh_times_out);
- scsi_add_timer(scmd, timeout, scsi_eh_times_out);
+ /*
+ * set up the semaphore so we wait for the command to complete.
+ */
+ scmd->device->host->eh_action = &sem;
+ scmd->request->rq_status = RQ_SCSI_BUSY;
- /*
- * set up the semaphore so we wait for the command to complete.
- */
- scmd->device->host->eh_action = &sem;
- scmd->request->rq_status = RQ_SCSI_BUSY;
+ spin_lock_irqsave(scmd->device->host->host_lock, flags);
+ host->hostt->queuecommand(scmd, scsi_eh_done);
+ spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
- spin_lock_irqsave(scmd->device->host->host_lock, flags);
- host->hostt->queuecommand(scmd, scsi_eh_done);
- spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
+ down(&sem);
- down(&sem);
+ scmd->device->host->eh_action = NULL;
- scmd->device->host->eh_action = NULL;
+ /*
+ * see if timeout. if so, tell the host to forget about it.
+ * in other words, we don't want a callback any more.
+ */
+ if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) {
+ scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT);
+ scmd->owner = SCSI_OWNER_LOWLEVEL;
/*
- * see if timeout. if so, tell the host to forget about it.
- * in other words, we don't want a callback any more.
+ * as far as the low level driver is
+ * concerned, this command is still active, so
+ * we must give the low level driver a chance
+ * to abort it. (db)
+ *
+ * FIXME(eric) - we are not tracking whether we could
+ * abort a timed out command or not. not sure how
+ * we should treat them differently anyways.
*/
- if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) {
- scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT);
- scmd->owner = SCSI_OWNER_LOWLEVEL;
-
- /*
- * as far as the low level driver is
- * concerned, this command is still active, so
- * we must give the low level driver a chance
- * to abort it. (db)
- *
- * FIXME(eric) - we are not tracking whether we could
- * abort a timed out command or not. not sure how
- * we should treat them differently anyways.
- */
- spin_lock_irqsave(scmd->device->host->host_lock, flags);
- if (scmd->device->host->hostt->eh_abort_handler)
- scmd->device->host->hostt->eh_abort_handler(scmd);
- spin_unlock_irqrestore(scmd->device->host->host_lock,
- flags);
+ spin_lock_irqsave(scmd->device->host->host_lock, flags);
+ if (scmd->device->host->hostt->eh_abort_handler)
+ scmd->device->host->hostt->eh_abort_handler(scmd);
+ spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
- scmd->request->rq_status = RQ_SCSI_DONE;
- scmd->owner = SCSI_OWNER_ERROR_HANDLER;
+ scmd->request->rq_status = RQ_SCSI_DONE;
+ scmd->owner = SCSI_OWNER_ERROR_HANDLER;
- rtn = FAILED;
- }
- SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n",
- __FUNCTION__, scmd, rtn));
- } else {
- int temp;
-
- /*
- * we damn well had better never use this code. there is no
- * timeout protection here, since we would end up waiting in
- * the actual low level driver, we don't know how to wake it up.
- */
- spin_lock_irqsave(host->host_lock, flags);
- temp = host->hostt->command(scmd);
- spin_unlock_irqrestore(host->host_lock, flags);
-
- scmd->result = temp;
- /* fall through to code below to examine status. */
+ rtn = FAILED;
}
+
+ SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n",
+ __FUNCTION__, scmd, rtn));
/*
* now examine the actual status codes to see whether the command
diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.c Sun Jun 8 20:31:57 2003
+++ b/drivers/usb/storage/scsiglue.c Sun Jun 8 20:31:57 2003
@@ -365,24 +365,15 @@
.name = "usb-storage",
.proc_name = "usb-storage",
.proc_info = usb_storage_proc_info,
- .proc_dir = NULL,
.info = usb_storage_info,
- .ioctl = NULL,
-
- /* old-style detect and release */
- .detect = NULL,
- .release = NULL,
/* command interface -- queued only */
- .command = NULL,
.queuecommand = usb_storage_queuecommand,
/* error and abort handlers */
.eh_abort_handler = usb_storage_command_abort,
.eh_device_reset_handler = usb_storage_device_reset,
.eh_bus_reset_handler = usb_storage_bus_reset,
- .eh_host_reset_handler = NULL,
- .eh_strategy_handler = NULL,
/* queue commands only, only one command per LUN */
.can_queue = 1,
@@ -391,21 +382,9 @@
/* unknown initiator id */
.this_id = -1,
- /* no limit on commands */
- .max_sectors = 0,
-
- /* pre- and post- device scan functions */
- .slave_alloc = NULL,
- .slave_configure = NULL,
- .slave_destroy = NULL,
-
/* lots of sg segments can be handled */
.sg_tablesize = SG_ALL,
- /* use 32-bit address space for DMA */
- .unchecked_isa_dma = FALSE,
- .highmem_io = FALSE,
-
/* merge commands... this seems to help performance, but
* periodically someone should test to see which setting is more
* optimal.
@@ -414,9 +393,6 @@
/* emulated HBA */
.emulated = TRUE,
-
- /* sorry, no BIOS to help us */
- .bios_param = NULL,
/* module management */
.module = THIS_MODULE
diff -Nru a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
--- a/include/scsi/scsi_host.h Sun Jun 8 20:31:57 2003
+++ b/include/scsi/scsi_host.h Sun Jun 8 20:31:57 2003
@@ -95,24 +95,10 @@
* I/O pressure in the system if there are no other outstanding
* commands.
*
- * STATUS: REQUIRED (for exceptions see below)
+ * STATUS: REQUIRED
*/
int (* queuecommand)(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *));
-
- /*
- * This is used instead of queuecommand if can_queue == 0;
- *
- * The return value has the following meaning:
- * Byte What:
- * 0 SCSI status code
- * 1 SCSI 1 byte message
- * 2 host error return.
- * 3 mid level error return
- *
- * Status: OBSOLETE
- */
- int (* command)(struct scsi_cmnd *);
/*
* This is an error handling strategy routine. You don't need to
next reply other threads:[~2003-06-09 16:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-09 16:20 Christoph Hellwig [this message]
2003-06-09 16:41 ` [PATCH] kill of ->command Patrick Mansfield
2003-06-09 16:51 ` Christoph Hellwig
2003-06-09 18:04 ` Patrick Mansfield
2003-06-09 18:11 ` Christoph Hellwig
2003-06-09 18:15 ` Russell King
2003-06-09 18:19 ` James Bottomley
2003-06-09 18:22 ` Russell King
2003-06-09 18:32 ` Matthew Dharm
2003-06-09 18:34 ` Christoph Hellwig
2003-06-09 18:37 ` Jeff Garzik
2003-06-09 18:45 ` Matthew Dharm
2003-06-09 19:05 ` Jeff Garzik
2003-06-09 19:19 ` Tony Battersby
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=20030609162056.GA1857@lst.de \
--to=hch@lst.de \
--cc=James.Bottomley@steeleye.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.