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/NCR53c406a.c | |
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/NCR53c406a.c')
-rw-r--r-- | drivers/scsi/NCR53c406a.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index 6961f78742ae..c91888a0a23c 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c | |||
@@ -693,7 +693,7 @@ static void wait_intr(void) | |||
693 | } | 693 | } |
694 | #endif | 694 | #endif |
695 | 695 | ||
696 | static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | 696 | static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) |
697 | { | 697 | { |
698 | int i; | 698 | int i; |
699 | 699 | ||
@@ -726,6 +726,8 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | |||
726 | return 0; | 726 | return 0; |
727 | } | 727 | } |
728 | 728 | ||
729 | static DEF_SCSI_QCMD(NCR53c406a_queue) | ||
730 | |||
729 | static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) | 731 | static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) |
730 | { | 732 | { |
731 | DEB(printk("NCR53c406a_reset called\n")); | 733 | DEB(printk("NCR53c406a_reset called\n")); |