aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/53c700.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/53c700.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/53c700.c')
-rw-r--r--drivers/scsi/53c700.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 89fc1c8af86b..f672491774eb 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -167,7 +167,7 @@ MODULE_LICENSE("GPL");
167#include "53c700_d.h" 167#include "53c700_d.h"
168 168
169 169
170STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 170STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *);
171STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); 171STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt);
172STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); 172STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
173STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); 173STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
@@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id)
1749 return IRQ_RETVAL(handled); 1749 return IRQ_RETVAL(handled);
1750} 1750}
1751 1751
1752STATIC int 1752static int
1753NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) 1753NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
1754{ 1754{
1755 struct NCR_700_Host_Parameters *hostdata = 1755 struct NCR_700_Host_Parameters *hostdata =
1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; 1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
@@ -1904,6 +1904,8 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
1904 return 0; 1904 return 0;
1905} 1905}
1906 1906
1907STATIC DEF_SCSI_QCMD(NCR_700_queuecommand)
1908
1907STATIC int 1909STATIC int
1908NCR_700_abort(struct scsi_cmnd * SCp) 1910NCR_700_abort(struct scsi_cmnd * SCp)
1909{ 1911{