aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2010-11-16 02:10:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-16 16:33:23 -0500
commitf281233d3eba15fb225d21ae2e228fd4553d824a (patch)
tree51134454ba8acb558735f90be5540f7d756483e3 /drivers/scsi/aic7xxx
parentbdbd01ac444bffb3c9aefed3059d12554059b320 (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/aic7xxx')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c4
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 88ad8482ef59..25d066624476 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host)
573 * Queue an SCB to the controller. 573 * Queue an SCB to the controller.
574 */ 574 */
575static int 575static int
576ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 576ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
577{ 577{
578 struct ahd_softc *ahd; 578 struct ahd_softc *ahd;
579 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); 579 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
@@ -588,6 +588,8 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
588 return rtn; 588 return rtn;
589} 589}
590 590
591static DEF_SCSI_QCMD(ahd_linux_queue)
592
591static struct scsi_target ** 593static struct scsi_target **
592ahd_linux_target_in_softc(struct scsi_target *starget) 594ahd_linux_target_in_softc(struct scsi_target *starget)
593{ 595{
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index aeea7a61478e..4a359bb307c6 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host)
528 * Queue an SCB to the controller. 528 * Queue an SCB to the controller.
529 */ 529 */
530static int 530static int
531ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 531ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
532{ 532{
533 struct ahc_softc *ahc; 533 struct ahc_softc *ahc;
534 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); 534 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
@@ -548,6 +548,8 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
548 return rtn; 548 return rtn;
549} 549}
550 550
551static DEF_SCSI_QCMD(ahc_linux_queue)
552
551static inline struct scsi_target ** 553static inline struct scsi_target **
552ahc_linux_target_in_softc(struct scsi_target *starget) 554ahc_linux_target_in_softc(struct scsi_target *starget)
553{ 555{