diff options
author | Jeff Garzik <jeff@garzik.org> | 2010-11-16 02:10:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-16 16:33:23 -0500 |
commit | f281233d3eba15fb225d21ae2e228fd4553d824a (patch) | |
tree | 51134454ba8acb558735f90be5540f7d756483e3 /drivers/scsi/qla2xxx | |
parent | bdbd01ac444bffb3c9aefed3059d12554059b320 (diff) |
SCSI host lock push-down
Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.
The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.
Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)
Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.
Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1830e6e97315..1644eabaafeb 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -179,8 +179,7 @@ static int qla2xxx_slave_alloc(struct scsi_device *); | |||
179 | static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); | 179 | static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); |
180 | static void qla2xxx_scan_start(struct Scsi_Host *); | 180 | static void qla2xxx_scan_start(struct Scsi_Host *); |
181 | static void qla2xxx_slave_destroy(struct scsi_device *); | 181 | static void qla2xxx_slave_destroy(struct scsi_device *); |
182 | static int qla2xxx_queuecommand(struct scsi_cmnd *cmd, | 182 | static int qla2xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
183 | void (*fn)(struct scsi_cmnd *)); | ||
184 | static int qla2xxx_eh_abort(struct scsi_cmnd *); | 183 | static int qla2xxx_eh_abort(struct scsi_cmnd *); |
185 | static int qla2xxx_eh_device_reset(struct scsi_cmnd *); | 184 | static int qla2xxx_eh_device_reset(struct scsi_cmnd *); |
186 | static int qla2xxx_eh_target_reset(struct scsi_cmnd *); | 185 | static int qla2xxx_eh_target_reset(struct scsi_cmnd *); |
@@ -535,7 +534,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, | |||
535 | } | 534 | } |
536 | 535 | ||
537 | static int | 536 | static int |
538 | qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 537 | qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
539 | { | 538 | { |
540 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); | 539 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); |
541 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; | 540 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; |
@@ -609,6 +608,8 @@ qc24_fail_command: | |||
609 | return 0; | 608 | return 0; |
610 | } | 609 | } |
611 | 610 | ||
611 | static DEF_SCSI_QCMD(qla2xxx_queuecommand) | ||
612 | |||
612 | 613 | ||
613 | /* | 614 | /* |
614 | * qla2x00_eh_wait_on_command | 615 | * qla2x00_eh_wait_on_command |