aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
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/hpsa.c
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/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index c5d0606ad097..3759d1199b0c 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -143,8 +143,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
143 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, 143 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr,
144 int cmd_type); 144 int cmd_type);
145 145
146static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 146static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd);
147 void (*done)(struct scsi_cmnd *));
148static void hpsa_scan_start(struct Scsi_Host *); 147static void hpsa_scan_start(struct Scsi_Host *);
149static int hpsa_scan_finished(struct Scsi_Host *sh, 148static int hpsa_scan_finished(struct Scsi_Host *sh,
150 unsigned long elapsed_time); 149 unsigned long elapsed_time);
@@ -1926,7 +1925,7 @@ sglist_finished:
1926} 1925}
1927 1926
1928 1927
1929static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 1928static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd,
1930 void (*done)(struct scsi_cmnd *)) 1929 void (*done)(struct scsi_cmnd *))
1931{ 1930{
1932 struct ctlr_info *h; 1931 struct ctlr_info *h;
@@ -2020,6 +2019,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
2020 return 0; 2019 return 0;
2021} 2020}
2022 2021
2022static DEF_SCSI_QCMD(hpsa_scsi_queue_command)
2023
2023static void hpsa_scan_start(struct Scsi_Host *sh) 2024static void hpsa_scan_start(struct Scsi_Host *sh)
2024{ 2025{
2025 struct ctlr_info *h = shost_to_hba(sh); 2026 struct ctlr_info *h = shost_to_hba(sh);