SCSI queuecommand API change for 2.6.37-rc1
Subsystems (49)
This patch set contains a single patch modifying the SCSI queuecommand host template API to go from being called with the host lock held to being called locklessly. The transformation is a directly equivalent one (i.e. the locking is simply pushed into each HBA) but will form the basis for optimising locking in the driver patch for the next merge window.
The patch is available here:
master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
The short changelog is:
Jeff Garzik (1):
host lock push-down
and the diffstat
arch/ia64/hp/sim/simscsi.c | 4 +++- drivers/ata/libata-scsi.c | 4 +++- drivers/block/cciss_scsi.c | 4 +++- drivers/firewire/sbp2.c | 4 +++- drivers/infiniband/ulp/srp/ib_srp.c | 4 +++- drivers/message/fusion/mptfc.c | 4 +++- drivers/message/fusion/mptsas.c | 4 +++- drivers/message/fusion/mptspi.c | 4 +++- drivers/message/i2o/i2o_scsi.c | 6 ++++-- drivers/s390/scsi/zfcp_scsi.c | 4 +++- drivers/scsi/3w-9xxx.c | 4 +++- drivers/scsi/3w-sas.c | 4 +++- drivers/scsi/3w-xxxx.c | 4 +++- drivers/scsi/53c700.c | 6 ++++-- drivers/scsi/BusLogic.c | 3 ++- drivers/scsi/NCR5380.c | 3 ++- drivers/scsi/NCR53c406a.c | 4 +++- drivers/scsi/a100u2w.c | 4 +++- drivers/scsi/aacraid/linit.c | 4 +++- drivers/scsi/advansys.c | 4 +++- drivers/scsi/aha152x.c | 4 +++- drivers/scsi/aha1542.c | 4 +++- drivers/scsi/aha1740.c | 4 +++- drivers/scsi/aic7xxx/aic79xx_osm.c | 4 +++- drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 +++- drivers/scsi/aic7xxx_old.c | 4 +++- drivers/scsi/arcmsr/arcmsr_hba.c | 4 +++- drivers/scsi/arm/acornscsi.c | 4 +++- drivers/scsi/arm/fas216.c | 8 ++++++-- drivers/scsi/atari_NCR5380.c | 4 +++- drivers/scsi/atp870u.c | 4 +++- drivers/scsi/bfa/bfad_im.c | 4 +++- drivers/scsi/dc395x.c | 3 ++- drivers/scsi/dpt_i2o.c | 4 +++- drivers/scsi/eata.c | 4 +++- drivers/scsi/eata_pio.c | 4 +++- drivers/scsi/esp_scsi.c | 4 +++- drivers/scsi/fd_mcs.c | 4 +++- drivers/scsi/fdomain.c | 4 +++- drivers/scsi/fnic/fnic_scsi.c | 4 +++- drivers/scsi/gdth.c | 4 +++- drivers/scsi/hpsa.c | 4 +++- drivers/scsi/hptiop.c | 4 +++- drivers/scsi/ibmmca.c | 4 +++- drivers/scsi/ibmvscsi/ibmvfc.c | 4 +++- drivers/scsi/ibmvscsi/ibmvscsi.c | 4 +++- drivers/scsi/imm.c | 4 +++- drivers/scsi/in2000.c | 4 +++- drivers/scsi/initio.c | 4 +++- drivers/scsi/ipr.c | 4 +++- drivers/scsi/ips.c | 4 +++- drivers/scsi/libfc/fc_fcp.c | 4 +++- drivers/scsi/libiscsi.c | 4 +++- drivers/scsi/libsas/sas_scsi_host.c | 4 +++- drivers/scsi/lpfc/lpfc_scsi.c | 4 +++- drivers/scsi/mac53c94.c | 4 +++- drivers/scsi/megaraid.c | 4 +++- drivers/scsi/megaraid/megaraid_mbox.c | 4 +++- drivers/scsi/megaraid/megaraid_sas.c | 4 +++- drivers/scsi/mesh.c | 4 +++- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 4 +++- drivers/scsi/ncr53c8xx.c | 4 +++- drivers/scsi/nsp32.c | 4 +++- drivers/scsi/pcmcia/nsp_cs.c | 4 +++- drivers/scsi/pcmcia/sym53c500_cs.c | 4 +++- drivers/scsi/pmcraid.c | 4 +++- drivers/scsi/ppa.c | 4 +++- drivers/scsi/ps3rom.c | 4 +++- drivers/scsi/qla1280.c | 4 +++- drivers/scsi/qla2xxx/qla_os.c | 4 +++- drivers/scsi/qla4xxx/ql4_os.c | 4 +++- drivers/scsi/qlogicfas408.c | 4 +++- drivers/scsi/qlogicpti.c | 4 +++- drivers/scsi/scsi.c | 15 +++------------ drivers/scsi/scsi_debug.c | 4 +++- drivers/scsi/scsi_error.c | 3 --- drivers/scsi/stex.c | 4 +++- drivers/scsi/sun3_NCR5380.c | 4 +++- drivers/scsi/sym53c416.c | 4 +++- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +++- drivers/scsi/tmscsim.c | 4 +++- drivers/scsi/u14-34f.c | 4 +++- drivers/scsi/ultrastor.c | 4 +++- drivers/scsi/vmw_pvscsi.c | 4 +++- drivers/scsi/wd33c93.c | 6 ++++-- drivers/scsi/wd7000.c | 4 +++- drivers/staging/hv/storvsc_drv.c | 4 +++- drivers/staging/keucr/scsiglue.c | 4 +++- drivers/usb/image/microtek.c | 4 +++- drivers/usb/storage/scsiglue.c | 4 +++- drivers/usb/storage/uas.c | 4 +++- include/scsi/scsi_host.h | 22 ++++++++++++++++++++++ 92 files changed, 295 insertions(+), 108 deletions(-)
The full diff is below. It's been in linux-next for two days now, and has survived on every boot system I've tried, plus I used a script to search for all SCSI drivers and verify they got updated (which they did).
James
---
arch/ia64/hp/sim/simscsi.c +3 -1
@@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) }static int -simscsi_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +simscsi_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {unsigned int target_id = sc->device->id;char fname[MAX_ROOT_LEN +16 ];
@@ -326,6 +326,8 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (simscsi_queuecommand) + static intsimscsi_host_reset (struct scsi_cmnd *sc) {
drivers/ata/libata-scsi.c +3 -1
@@ -3180,7 +3180,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,* Return value from __ata_scsi_queuecmd() if @cmd can be queued, * 0 otherwise. */ -int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int ata_scsi_queuecmd_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ata_port *ap;struct ata_device *dev;
@@ -3208,6 +3208,8 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return rc; } +DEF_SCSI_QCMD (ata_scsi_queuecmd) +/** * ata_scsi_simulate - simulate SCSI command on ATA device * @dev: the target device
drivers/block/cciss_scsi.c +3 -1
@@ -1406,7 +1406,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c,static int -cciss_scsi_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +cciss_scsi_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {ctlr_info_t *h;int rc;
@@ -1504,6 +1504,8 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (cciss_scsi_queue_command) + static void cciss_unregister_scsi(ctlr_info_t *h) {struct cciss_scsi_adapter_data_t *sa;
drivers/firewire/sbp2.c +3 -1
@@ -1468,7 +1468,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb,/* SCSI stack integration */ -static int sbp2_scsi_queuecommand (struct scsi_cmnd *cmd,scsi_done_fn_t done) +static int sbp2_scsi_queuecommand_lck (struct scsi_cmnd *cmd,scsi_done_fn_t done) {struct sbp2_logical_unit *lu = cmd->device->hostdata;struct fw_device *device =target_device (lu->tgt);
@@ -1534,6 +1534,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)return retval; } +static DEF_SCSI_QCMD (sbp2_scsi_queuecommand) + static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) {struct sbp2_logical_unit *lu = sdev->hostdata;
drivers/infiniband/ulp/srp/ib_srp.c +3 -1
@@ -1123,7 +1123,7 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr) } } -static int srp_queuecommand (struct scsi_cmnd *scmnd, +static int srp_queuecommand_lck (struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *)) {struct srp_target_port *target =host_to_target (scmnd->device->host);
@@ -1196,6 +1196,8 @@ err:return SCSI_MLQUEUE_HOST_BUSY ; } +static DEF_SCSI_QCMD (srp_queuecommand) + static int srp_alloc_iu_bufs(struct srp_target_port *target) {int i;
drivers/message/fusion/mptfc.c +3 -1
@@ -650,7 +650,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) }static int -mptfc_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptfc_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {struct mptfc_rport_info *ri;struct fc_rport *rport =starget_to_rport (scsi_target (SCpnt->device));
@@ -681,6 +681,8 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptfc_qcmd) +/* * mptfc_display_port_link_speed - displaying link speed * @ioc: Pointer to MPT_ADAPTER structure
drivers/message/fusion/mptsas.c +3 -1
@@ -1889,7 +1889,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) }static int -mptsas_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptsas_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {MPT_SCSI_HOST *hd;MPT_ADAPTER *ioc;
@@ -1913,6 +1913,8 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptsas_qcmd) +/** * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout * if the device under question is currently in the
drivers/message/fusion/mptspi.c +3 -1
@@ -780,7 +780,7 @@ static int mptspi_slave_configure(struct scsi_device *sdev) }static int -mptspi_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptspi_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {struct _MPT_SCSI_HOST *hd =shost_priv (SCpnt->device->host);VirtDevice *vdevice = SCpnt->device->hostdata;
@@ -805,6 +805,8 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptspi_qcmd) + static void mptspi_slave_destroy(struct scsi_device *sdev) {struct scsi_target *starget =scsi_target (sdev);
drivers/message/i2o/i2o_scsi.c +4 -2
@@ -506,7 +506,7 @@ static struct i2o_driver i2o_scsi_driver = {* Locks: takes the controller lock on error path only */ -static int i2o_scsi_queuecommand (struct scsi_cmnd *SCpnt, +static int i2o_scsi_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct i2o_controller *c;
@@ -688,7 +688,9 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, exit:return rc; -}; +} + +static DEF_SCSI_QCMD (i2o_scsi_queuecommand)/** * i2o_scsi_abort - abort a running command
drivers/s390/scsi/zfcp_scsi.c +3 -1
@@ -76,7 +76,7 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) scpnt->scsi_done (scpnt); } -static int zfcp_scsi_queuecommand (struct scsi_cmnd *scpnt, +static int zfcp_scsi_queuecommand_lck (struct scsi_cmnd *scpnt,void (*done) (struct scsi_cmnd *)) {struct zfcp_scsi_dev *zfcp_sdev =sdev_to_zfcp (scpnt->device);
@@ -127,6 +127,8 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,return ret; } +static DEF_SCSI_QCMD (zfcp_scsi_queuecommand) + static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) {struct fc_rport *rport =starget_to_rport (scsi_target (sdev));
drivers/scsi/3w-9xxx.c +3 -1
@@ -1765,7 +1765,7 @@ out: }/* End twa_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twa_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int twa_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int request_id, retval;TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@@ -1812,6 +1812,8 @@ out:return retval; }/* End twa_scsi_queue() */ +static DEF_SCSI_QCMD (twa_scsi_queue) +/* This function hands scsi cdb's to the firmware */ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg) {
drivers/scsi/3w-sas.c +3 -1
@@ -1501,7 +1501,7 @@ out: }/* End twl_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twl_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int twl_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int request_id, retval;TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@@ -1536,6 +1536,8 @@ out:return retval; }/* End twl_scsi_queue() */ +static DEF_SCSI_QCMD (twl_scsi_queue) +/* This function tells the controller to shut down */ static void __twl_shutdown(TW_Device_Extension *tw_dev) {
drivers/scsi/3w-xxxx.c +3 -1
@@ -1947,7 +1947,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r }/* End tw_scsiop_test_unit_ready_complete() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int tw_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int tw_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {unsigned char *command = SCpnt->cmnd;int request_id =0 ;
@@ -2023,6 +2023,8 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmndreturn retval; }/* End tw_scsi_queue() */ +static DEF_SCSI_QCMD (tw_scsi_queue) +/* This function is the interrupt service routine */ static irqreturn_t tw_interrupt(int irq, void *dev_instance) {
drivers/scsi/53c700.c +4 -2
@@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id)return IRQ_RETVAL (handled); } -STATIC int -NCR_700_queuecommand (struct scsi_cmnd *SCp,void (*done)(struct scsi_cmnd *)) +static int +NCR_700_queuecommand_lck (struct scsi_cmnd *SCp,void (*done)(struct scsi_cmnd *)) {struct NCR_700_Host_Parameters *hostdata = (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 *))return 0 ; } +STATIC DEF_SCSI_QCMD (NCR_700_queuecommand ) +STATIC int NCR_700_abort(struct scsi_cmnd * SCp) {
drivers/scsi/BusLogic.c +2 -1
@@ -2807,7 +2807,7 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt)Outgoing Mailbox for execution by the associated Host Adapter. */ -static int BusLogic_QueueCommand (struct scsi_cmnd *Command,void (*CompletionRoutine) (struct scsi_cmnd *)) +static int BusLogic_QueueCommand_lck (struct scsi_cmnd *Command,void (*CompletionRoutine) (struct scsi_cmnd *)) {struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata;struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id];
@@ -2994,6 +2994,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoureturn 0 ; } +static DEF_SCSI_QCMD(BusLogic_QueueCommand)#if 0 /*
drivers/scsi/NCR5380.c +2 -1
@@ -952,7 +952,7 @@ static void NCR5380_exit(struct Scsi_Host *instance)* Locks: host lock taken by caller */ -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int NCR5380_queue_command_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *instance = cmd->device->host;struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@@ -1021,6 +1021,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command)/** * NCR5380_main - NCR state machines
drivers/scsi/NCR53c406a.c +3 -1
@@ -693,7 +693,7 @@ static void wait_intr(void) }#endif -static int NCR53c406a_queue (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int NCR53c406a_queue_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {int i;
@@ -726,6 +726,8 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR53c406a_queue) + static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) {DEB (printk ("NCR53c406a_reset called\n" ));
drivers/scsi/a100u2w.c +3 -1
@@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc* queue the command down to the controller */ -static int inia100_queue (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) +static int inia100_queue_lck (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) {struct orc_scb *scb;struct orc_host *host;/* Point to Host adapter control block */
@@ -930,6 +930,8 @@ static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (inia100_queue) +/***************************************************************************** Function name : inia100_abort Description : Abort a queued command.
drivers/scsi/aacraid/linit.c +3 -1
@@ -248,7 +248,7 @@ static struct aac_driver_ident aac_drivers[] = {* TODO: unify with aac_scsi_cmd(). */ -static int aac_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int aac_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct aac_dev *dev = (struct aac_dev *)host->hostdata;
@@ -267,6 +267,8 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmndreturn (aac_scsi_cmd (cmd) ?FAILED :0 ); } +static DEF_SCSI_QCMD (aac_queuecommand) +/** * aac_info - Returns the host adapter name * @shost: Scsi host to report on
drivers/scsi/advansys.c +3 -1
@@ -9500,7 +9500,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)* in the 'scp' result field. */ static int -advansys_queuecommand (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) +advansys_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *shost = scp->device->host;int asc_res, result =0 ;
@@ -9525,6 +9525,8 @@ advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))return result; } +static DEF_SCSI_QCMD (advansys_queuecommand) + static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) { PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
drivers/scsi/aha152x.c +3 -1
@@ -1056,7 +1056,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,* queue a command * */ -static int aha152x_queue (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +static int aha152x_queue_lck (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) {#if 0 if (*SCpnt->cmnd ==REQUEST_SENSE ) {
@@ -1070,6 +1070,8 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))return aha152x_internal_queue (SCpnt,NULL ,0 , done); } +static DEF_SCSI_QCMD (aha152x_queue) +/* *
drivers/scsi/aha1542.c +3 -1
@@ -558,7 +558,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) }; } -static int aha1542_queuecommand (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int aha1542_queuecommand_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {unchar ahacmd =CMD_START_SCSI ;unchar direction;
@@ -718,6 +718,8 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (aha1542_queuecommand) +/* Initialize mailboxes */ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) {
drivers/scsi/aha1740.c +3 -1
@@ -331,7 +331,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)return IRQ_RETVAL (handled); } -static int aha1740_queuecommand (Scsi_Cmnd * SCpnt,void (*done)(Scsi_Cmnd *)) +static int aha1740_queuecommand_lck (Scsi_Cmnd * SCpnt,void (*done)(Scsi_Cmnd *)) {unchar direction;unchar *cmd = (unchar *) SCpnt->cmnd;
@@ -503,6 +503,8 @@ static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (aha1740_queuecommand) +/* Query the board for its irq_level and irq_type. Nothing else matters in enhanced mode on an EISA bus. */
drivers/scsi/aic7xxx/aic79xx_osm.c +3 -1
@@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host)* Queue an SCB to the controller. */ static int -ahd_linux_queue (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) +ahd_linux_queue_lck (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) {struct ahd_softc *ahd;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 *))return rtn; } +static DEF_SCSI_QCMD (ahd_linux_queue) + static struct scsi_target **ahd_linux_target_in_softc (struct scsi_target *starget) {
drivers/scsi/aic7xxx/aic7xxx_osm.c +3 -1
@@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host)* Queue an SCB to the controller. */ static int -ahc_linux_queue (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) +ahc_linux_queue_lck (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) {struct ahc_softc *ahc;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 *))return rtn; } +static DEF_SCSI_QCMD (ahc_linux_queue) + static inline struct scsi_target **ahc_linux_target_in_softc (struct scsi_target *starget) {
drivers/scsi/aic7xxx_old.c +3 -1
@@ -10234,7 +10234,7 @@ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,* Description: * Queue a SCB to the controller. *-F*************************************************************************/ -static int aic7xxx_queue (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) +static int aic7xxx_queue_lck (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) {struct aic7xxx_host *p;struct aic7xxx_scb *scb;
@@ -10292,6 +10292,8 @@ static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))return (0 ); } +static DEF_SCSI_QCMD (aic7xxx_queue) +/*+F************************************************************************* * Function: * aic7xxx_bus_device_reset
drivers/scsi/arcmsr/arcmsr_hba.c +3 -1
@@ -2081,7 +2081,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, } } -static int arcmsr_queue_command (struct scsi_cmnd *cmd, +static int arcmsr_queue_command_lck (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;
@@ -2124,6 +2124,8 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (arcmsr_queue_command) + static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) {struct MessageUnit_A __iomem *reg = acb->pmuA;
drivers/scsi/arm/acornscsi.c +3 -1
@@ -2511,7 +2511,7 @@ acornscsi_intr(int irq, void *dev_id)* done - function called on completion, with pointer to command descriptor * Returns : 0, or < 0 on error. */ -int acornscsi_queuecmd (struct scsi_cmnd *SCpnt, +static int acornscsi_queuecmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
@@ -2561,6 +2561,8 @@ int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,return 0 ; } +DEF_SCSI_QCMD (acornscsi_queuecmd) +/* * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2
drivers/scsi/arm/fas216.c +6 -2
@@ -2198,7 +2198,7 @@ no_command:* Returns: 0 on success, else error. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_queue_command (struct scsi_cmnd *SCpnt, +static int fas216_queue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt,return result; } +DEF_SCSI_QCMD (fas216_queue_command) +/** * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command * @SCpnt: Command to wake
@@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)* Returns: scsi result code. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_noqueue_command (struct scsi_cmnd *SCpnt, +static int fas216_noqueue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@@ -2310,6 +2312,8 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,return 0 ; } +DEF_SCSI_QCMD (fas216_noqueue_command) +/* * Error handler timeout function. Indicate that we timed out, * and wake up any error handler process so it can continue.
drivers/scsi/atari_NCR5380.c +3 -1
@@ -910,7 +910,7 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)* */ -static int NCR5380_queue_command (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) +static int NCR5380_queue_command_lck (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) {SETUP_HOSTDATA (cmd->device->host);Scsi_Cmnd *tmp;
@@ -1022,6 +1022,8 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command) +/* * Function : NCR5380_main (void) *
drivers/scsi/atp870u.c +3 -1
@@ -605,7 +605,7 @@ handled:* * Queue a command to the ATP queue. Called with the host lock held. */ -static int atp870u_queuecommand (struct scsi_cmnd * req_p, +static int atp870u_queuecommand_lck (struct scsi_cmnd *req_p,void (*done) (struct scsi_cmnd *)) {unsigned char c;
@@ -694,6 +694,8 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,return 0 ; } +static DEF_SCSI_QCMD (atp870u_queuecommand) +/** * send_s870 - send a command to the controller * @host: host
drivers/scsi/bfa/bfad_im.c +3 -1
@@ -1120,7 +1120,7 @@ bfad_im_itnim_work_handler(struct work_struct *work)* Scsi_Host template entry, queue a SCSI command to the BFAD. */ static int -bfad_im_queuecommand (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) +bfad_im_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) cmnd->device->host->hostdata[0 ];
@@ -1187,6 +1187,8 @@ out_fail_cmd:return 0 ; } +static DEF_SCSI_QCMD (bfad_im_queuecommand) + voidbfad_os_rport_online_wait (struct bfad_s *bfad) {
drivers/scsi/dc395x.c +2 -1
@@ -1080,7 +1080,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,* and is expected to be held on return. * **/ -static int dc395x_queue_command (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int dc395x_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct DeviceCtlBlk *dcb;struct ScsiReqBlk *srb;
@@ -1154,6 +1154,7 @@ complete:return 0 ; } +static DEF_SCSI_QCMD (dc395x_queue_command)/* * Return the disk geometry for the given SCSI device.
drivers/scsi/dpt_i2o.c +3 -1
@@ -423,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device)return 0 ; } -static int adpt_queue (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) +static int adpt_queue_lck (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) {adpt_hba * pHba =NULL ;struct adpt_device * pDev =NULL ;/* dpt per device information */
@@ -491,6 +491,8 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))return adpt_scsi_to_i2o (pHba, cmd, pDev); } +static DEF_SCSI_QCMD (adpt_queue) + static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev,sector_t capacity,int geom[]) {
drivers/scsi/eata.c +3 -1
@@ -1758,7 +1758,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha) } -static int eata2x_queuecommand (struct scsi_cmnd *SCpnt, +static int eata2x_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct Scsi_Host *shost = SCpnt->device->host;
@@ -1843,6 +1843,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (eata2x_queuecommand) + static int eata2x_eh_abort(struct scsi_cmnd *SCarg) {struct Scsi_Host *shost = SCarg->device->host;
drivers/scsi/eata_pio.c +3 -1
@@ -335,7 +335,7 @@ static inline unsigned int eata_pio_send_command(unsigned long base, unsigned chreturn 0 ; } -static int eata_pio_queue (struct scsi_cmnd *cmd, +static int eata_pio_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {unsigned int x, y;
@@ -438,6 +438,8 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (eata_pio_queue) + static int eata_pio_abort(struct scsi_cmnd *cmd) {unsigned int loop =100 ;
drivers/scsi/esp_scsi.c +3 -1
@@ -916,7 +916,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)scsi_track_queue_full (dev, lp->num_tagged -1 ); } -static int esp_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int esp_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *dev = cmd->device;struct esp *esp =shost_priv (dev->host);
@@ -941,6 +941,8 @@ static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (esp_queuecommand) + static int esp_check_gross_error(struct esp *esp) {if (esp->sreg &ESP_STAT_SPAM ) {
drivers/scsi/fd_mcs.c +3 -1
@@ -1072,7 +1072,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt)return 0 ; } -static int fd_mcs_queue (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int fd_mcs_queue_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *shpnt = SCpnt->device->host;
@@ -1122,6 +1122,8 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD(fd_mcs_queue) +#if DEBUG_ABORT ||DEBUG_RESET static void fd_mcs_print_info (Scsi_Cmnd * SCpnt) {
drivers/scsi/fdomain.c +3 -1
@@ -1419,7 +1419,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int fdomain_16x0_queue (struct scsi_cmnd *SCpnt, +static int fdomain_16x0_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {if (in_command) {
@@ -1469,6 +1469,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD(fdomain_16x0_queue) +#if DEBUG_ABORT static void print_info (struct scsi_cmnd *SCpnt) {
drivers/scsi/fnic/fnic_scsi.c +3 -1
@@ -349,7 +349,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,* Routine to send a scsi cdb * Called with host_lock held and interrupts disabled. */ -int fnic_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +static int fnic_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {struct fc_lport *lp;struct fc_rport *rport;
@@ -457,6 +457,8 @@ out:return ret; } +DEF_SCSI_QCMD (fnic_queuecommand) +/* * fnic_fcpio_fw_reset_cmpl_handler * Routine to handle fw reset completion
drivers/scsi/gdth.c +3 -1
@@ -4004,7 +4004,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se } -static int gdth_queuecommand (struct scsi_cmnd *scp, +static int gdth_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {gdth_ha_str *ha =shost_priv (scp->device->host);
@@ -4022,6 +4022,8 @@ static int gdth_queuecommand(struct scsi_cmnd *scp,return __gdth_queuecommand (ha, scp, cmndinfo); } +static DEF_SCSI_QCMD (gdth_queuecommand) + static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo) {
drivers/scsi/hpsa.c +3 -1
@@ -1926,7 +1926,7 @@ sglist_finished: } -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, +static int hpsa_scsi_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ctlr_info *h;
@@ -2020,6 +2020,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (hpsa_scsi_queue_command) + static void hpsa_scan_start(struct Scsi_Host *sh) {struct ctlr_info *h =shost_to_hba (sh);
drivers/scsi/hptiop.c +3 -1
@@ -751,7 +751,7 @@ static void hptiop_post_req_mv(struct hptiop_hba *hba, MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); } -static int hptiop_queuecommand (struct scsi_cmnd *scp, +static int hptiop_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = scp->device->host;
@@ -819,6 +819,8 @@ cmd_done:return 0 ; } +static DEF_SCSI_QCMD (hptiop_queuecommand) + static const char *hptiop_info(struct Scsi_Host *host) {return driver_name_long;
drivers/scsi/ibmmca.c +3 -1
@@ -1691,7 +1691,7 @@ static int __devexit ibmmca_remove(struct device *dev) }/* The following routine is the SCSI command queue for the midlevel driver */ -static int ibmmca_queuecommand (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int ibmmca_queuecommand_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {unsigned int ldn;unsigned int scsi_cmd;
@@ -1996,6 +1996,8 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (ibmmca_queuecommand) + static int __ibmmca_abort(Scsi_Cmnd * cmd) {/* Abort does not work, as the adapter never generates an interrupt on
drivers/scsi/ibmvscsi/ibmvfc.c +3 -1
@@ -1606,7 +1606,7 @@ static inline int ibmvfc_host_chkready(struct ibmvfc_host *vhost)* Returns: * 0 on success / other on failure **/ -static int ibmvfc_queuecommand (struct scsi_cmnd *cmnd, +static int ibmvfc_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct ibmvfc_host *vhost =shost_priv (cmnd->device->host);
@@ -1672,6 +1672,8 @@ static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd,return 0 ; } +static DEF_SCSI_QCMD (ibmvfc_queuecommand) +/** * ibmvfc_sync_completion - Signal that a synchronous command has completed * @evt: ibmvfc event struct
drivers/scsi/ibmvscsi/ibmvscsi.c +3 -1
@@ -713,7 +713,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev)* @cmd: struct scsi_cmnd to be executed * @done: Callback function to be called when cmd is completed */ -static int ibmvscsi_queuecommand (struct scsi_cmnd *cmnd, +static int ibmvscsi_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct srp_cmd *srp_cmd;
@@ -766,6 +766,8 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,return ibmvscsi_send_srp_event (evt_struct, hostdata,0 ); } +static DEF_SCSI_QCMD (ibmvscsi_queuecommand) +/* ------------------------------------------------------------ * Routines for driver initialization */
drivers/scsi/imm.c +3 -1
@@ -926,7 +926,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)return 0 ; } -static int imm_queuecommand (struct scsi_cmnd *cmd, +static int imm_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {imm_struct *dev =imm_dev (cmd->device->host);
@@ -949,6 +949,8 @@ static int imm_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (imm_queuecommand) +/* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really
drivers/scsi/in2000.c +3 -1
@@ -334,7 +334,7 @@ static uchar calc_sync_xfer(unsigned int period, unsigned int offset)static void in2000_execute (struct Scsi_Host *instance); -static int in2000_queuecommand (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int in2000_queuecommand_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *instance;struct IN2000_hostdata *hostdata;
@@ -431,6 +431,8 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (in2000_queuecommand) +/*
drivers/scsi/initio.c +3 -1
@@ -2639,7 +2639,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c* will cause the mid layer to call us again later with the command) */ -static int i91u_queuecommand (struct scsi_cmnd *cmd, +static int i91u_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
@@ -2656,6 +2656,8 @@ static int i91u_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (i91u_queuecommand) +/** * i91u_bus_reset - reset the SCSI bus * @cmnd: Command block we want to trigger the reset for
drivers/scsi/ipr.c +3 -1
@@ -5709,7 +5709,7 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy **/ -static int ipr_queuecommand (struct scsi_cmnd *scsi_cmd, +static int ipr_queuecommand_lck (struct scsi_cmnd *scsi_cmd,void (*done) (struct scsi_cmnd *)) {struct ipr_ioa_cfg *ioa_cfg;
@@ -5792,6 +5792,8 @@ static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd,return 0 ; } +static DEF_SCSI_QCMD (ipr_queuecommand) +/** * ipr_ioctl - IOCTL handler * @sdev: scsi device struct
drivers/scsi/ips.c +3 -1
@@ -1046,7 +1046,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC)/* Linux obtains io_request_lock before calling this function */ /* */ /****************************************************************************/ -static int ips_queue (struct scsi_cmnd *SC ,void (*done) (struct scsi_cmnd *)) +static int ips_queue_lck (struct scsi_cmnd *SC ,void (*done) (struct scsi_cmnd *)) {ips_ha_t *ha;ips_passthru_t *pt;
@@ -1137,6 +1137,8 @@ static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))return (0 ); } +static DEF_SCSI_QCMD (ips_queue) +/****************************************************************************/ /* */ /* Routine Name: ips_biosparam */
drivers/scsi/libfc/fc_fcp.c +3 -1
@@ -1753,7 +1753,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport)* This is the i/o strategy routine, called by the SCSI layer. This routine * is called with the host_lock held. */ -int fc_queuecommand (struct scsi_cmnd *sc_cmd,void (*done)(struct scsi_cmnd *)) +static int fc_queuecommand_lck (struct scsi_cmnd *sc_cmd,void (*done)(struct scsi_cmnd *)) {struct fc_lport *lport;struct fc_rport *rport =starget_to_rport (scsi_target (sc_cmd->device));
@@ -1851,6 +1851,8 @@ out:spin_lock_irq (lport->host->host_lock);return rc; } + +DEF_SCSI_QCMD (fc_queuecommand)EXPORT_SYMBOL (fc_queuecommand);/**
drivers/scsi/libiscsi.c +3 -1
@@ -1599,7 +1599,7 @@ enum { FAILURE_SESSION_NOT_READY, }; -int iscsi_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +static int iscsi_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {struct iscsi_cls_session *cls_session;struct Scsi_Host *host;
@@ -1736,6 +1736,8 @@ fault:spin_lock (host->host_lock);return 0 ; } + +DEF_SCSI_QCMD (iscsi_queuecommand)EXPORT_SYMBOL_GPL (iscsi_queuecommand);int iscsi_change_queue_depth (struct scsi_device *sdev,int depth,int reason)
drivers/scsi/libsas/sas_scsi_host.c +3 -1
@@ -189,7 +189,7 @@ int sas_queue_up(struct sas_task *task)* Note: XXX: Remove the host unlock/lock pair when SCSI Core can * call us without holding an IRQ spinlock... */ -int sas_queuecommand(struct scsi_cmnd *cmd, +static int sas_queuecommand_lck(struct scsi_cmnd *cmd, void (*scsi_done)(struct scsi_cmnd *)) __releases(host->host_lock) __acquires(dev->sata_dev.ap->lock)
@@ -254,6 +254,8 @@ out:return res; } +DEF_SCSI_QCMD (sas_queuecommand) + static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) {struct sas_task *task =TO_SAS_TASK (cmd);
drivers/scsi/lpfc/lpfc_scsi.c +3 -1
@@ -2899,7 +2899,7 @@ void lpfc_poll_timeout(unsigned long ptr)* SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. **/ static int -lpfc_queuecommand (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) +lpfc_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct Scsi_Host *shost = cmnd->device->host;struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
@@ -3060,6 +3060,8 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (lpfc_queuecommand) +/** * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point * @cmnd: Pointer to scsi_cmnd data structure.
drivers/scsi/mac53c94.c +3 -1
@@ -66,7 +66,7 @@ static void cmd_done(struct fsc_state *, int result);static void set_dma_cmds (struct fsc_state *,struct scsi_cmnd *); -static int mac53c94_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int mac53c94_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct fsc_state *state;
@@ -99,6 +99,8 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *return 0 ; } +static DEF_SCSI_QCMD (mac53c94_queue) + static int mac53c94_host_reset(struct scsi_cmnd *cmd) {struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata;
drivers/scsi/megaraid.c +3 -1
@@ -366,7 +366,7 @@ mega_runpendq(adapter_t *adapter)* The command queuing entry point for the mid-layer. */ static int -megaraid_queue (Scsi_Cmnd *scmd,void (*done)(Scsi_Cmnd *)) +megaraid_queue_lck (Scsi_Cmnd *scmd,void (*done)(Scsi_Cmnd *)) {adapter_t *adapter;scb_t *scb;
@@ -409,6 +409,8 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))return busy; } +static DEF_SCSI_QCMD (megaraid_queue) +/** * mega_allocate_scb() * @adapter - pointer to our soft state
drivers/scsi/megaraid/megaraid_mbox.c +3 -1
@@ -1484,7 +1484,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)* Queue entry point for mailbox based controllers. */ static int -megaraid_queue_command (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) +megaraid_queue_command_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {adapter_t *adapter;scb_t *scb;
@@ -1513,6 +1513,8 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))return if_busy; } +static DEF_SCSI_QCMD (megaraid_queue_command) +/** * megaraid_mbox_build_cmd - transform the mid-layer scsi commands * @adapter : controller's soft state
drivers/scsi/megaraid/megaraid_sas.c +3 -1
@@ -1334,7 +1334,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance)* @done: Callback entry point */ static int -megasas_queue_command (struct scsi_cmnd *scmd,void (*done) (struct scsi_cmnd *)) +megasas_queue_command_lck (struct scsi_cmnd *scmd,void (*done) (struct scsi_cmnd *)) {u32 frame_count;struct megasas_cmd *cmd;
@@ -1417,6 +1417,8 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (megasas_queue_command) + static struct megasas_instance *megasas_lookup_instance(u16 host_no) {int i;
drivers/scsi/mesh.c +3 -1
@@ -1627,7 +1627,7 @@ static void cmd_complete(struct mesh_state *ms)* Called by midlayer with host locked to queue a new * request */ -static int mesh_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int mesh_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct mesh_state *ms;
@@ -1648,6 +1648,8 @@ static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (mesh_queue) +/* * Called to handle interrupts, either call by the interrupt * handler (do_mesh_interrupt) or by other functions in
drivers/scsi/mpt2sas/mpt2sas_scsih.c +3 -1
@@ -3315,7 +3315,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)* SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full */ static int -_scsih_qcmd (struct scsi_cmnd *scmd,void (*done)(struct scsi_cmnd *)) +_scsih_qcmd_lck (struct scsi_cmnd *scmd,void (*done)(struct scsi_cmnd *)) {struct MPT2SAS_ADAPTER *ioc =shost_priv (scmd->device->host);struct MPT2SAS_DEVICE *sas_device_priv_data;
@@ -3441,6 +3441,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))return SCSI_MLQUEUE_HOST_BUSY ; } +static DEF_SCSI_QCMD (_scsih_qcmd) +/** * _scsih_normalize_sense - normalize descriptor and fixed format sense data * @sense_buffer: sense data returned by target
drivers/scsi/ncr53c8xx.c +3 -1
@@ -8029,7 +8029,7 @@ static int ncr53c8xx_slave_configure(struct scsi_device *device)return 0 ; } -static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;unsigned long flags;
@@ -8068,6 +8068,8 @@ printk("ncr53c8xx : command successfully queued\n");return sts; } +static DEF_SCSI_QCMD (ncr53c8xx_queue_command) + irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) {unsigned long flags;
drivers/scsi/nsp32.c +3 -1
@@ -909,7 +909,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt)return TRUE; } -static int nsp32_queuecommand (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int nsp32_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;nsp32_target *target;
@@ -1050,6 +1050,8 @@ static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_return 0 ; } +static DEF_SCSI_QCMD (nsp32_queuecommand) +/* initialize asic */ static int nsp32hw_init(nsp32_hw_data *data) {
drivers/scsi/pcmcia/nsp_cs.c +3 -1
@@ -184,7 +184,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt) SCpnt->scsi_done (SCpnt); } -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, +static int nsp_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {#ifdef NSP_DEBUG
@@ -264,6 +264,8 @@ static int nsp_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (nsp_queuecommand) +/* * setup PIO FIFO transfer mode and enable/disable to data out */
drivers/scsi/pcmcia/sym53c500_cs.c +3 -1
@@ -547,7 +547,7 @@ SYM53C500_info(struct Scsi_Host *SChost) }static int -SYM53C500_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +SYM53C500_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int i;int port_base = SCpnt->device->host->io_port;
@@ -583,6 +583,8 @@ SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (SYM53C500_queue) + static intSYM53C500_host_reset (struct scsi_cmnd *SCpnt) {
drivers/scsi/pmcraid.c +3 -1
@@ -3478,7 +3478,7 @@ static int pmcraid_copy_sglist(* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy */ -static int pmcraid_queuecommand ( +static int pmcraid_queuecommand_lck (struct scsi_cmnd *scsi_cmd,void (*done) (struct scsi_cmnd *) )
@@ -3584,6 +3584,8 @@ static int pmcraid_queuecommand(return rc; } +static DEF_SCSI_QCMD (pmcraid_queuecommand) +/** * pmcraid_open -char node "open" entry, allowed only users with admin access */
drivers/scsi/ppa.c +3 -1
@@ -798,7 +798,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)return 0 ; } -static int ppa_queuecommand (struct scsi_cmnd *cmd, +static int ppa_queuecommand_lck (struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *)) {ppa_struct *dev =ppa_dev (cmd->device->host);
@@ -821,6 +821,8 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (ppa_queuecommand) +/* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really
drivers/scsi/ps3rom.c +3 -1
@@ -211,7 +211,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev,return 0 ; } -static int ps3rom_queuecommand (struct scsi_cmnd *cmd, +static int ps3rom_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ps3rom_private *priv =shost_priv (cmd->device->host);
@@ -260,6 +260,8 @@ static int ps3rom_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (ps3rom_queuecommand) + static int decode_lv1_status(u64 status, unsigned char *sense_key,unsigned char *asc,unsigned char *ascq) {
drivers/scsi/qla1280.c +3 -1
@@ -727,7 +727,7 @@ qla1280_info(struct Scsi_Host *host)* context which is a big NO! NO!. **************************************************************************/ static int -qla1280_queuecommand (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) +qla1280_queuecommand_lck (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
@@ -756,6 +756,8 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))return status; } +static DEF_SCSI_QCMD (qla1280_queuecommand) + enum action {ABORT_COMMAND , DEVICE_RESET,
drivers/scsi/qla2xxx/qla_os.c +3 -1
@@ -535,7 +535,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, }static int -qla2xxx_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +qla2xxx_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {scsi_qla_host_t *vha =shost_priv (cmd->device->host);fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
@@ -609,6 +609,8 @@ qc24_fail_command:return 0 ; } +static DEF_SCSI_QCMD (qla2xxx_queuecommand) +/* * qla2x00_eh_wait_on_command
drivers/scsi/qla4xxx/ql4_os.c +3 -1
@@ -464,7 +464,7 @@ void qla4xxx_srb_compl(struct kref *ref)* completion handling). Unfortunely, it sometimes calls the scheduler * in interrupt context which is a big NO! NO!. **/ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, +static int qla4xxx_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_qla_host *ha =to_qla_host (cmd->device->host);
@@ -538,6 +538,8 @@ qc_fail_command:return 0 ; } +static DEF_SCSI_QCMD (qla4xxx_queuecommand) +/** * qla4xxx_mem_free - frees memory allocated to adapter * @ha: Pointer to host adapter structure.
drivers/scsi/qlogicfas408.c +3 -1
@@ -439,7 +439,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)* Queued command */ -int qlogicfas408_queuecommand (struct scsi_cmnd *cmd, +static int qlogicfas408_queuecommand_lck (struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *)) {struct qlogicfas408_priv *priv =get_priv_by_cmd (cmd);
@@ -459,6 +459,8 @@ int qlogicfas408_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +DEF_SCSI_QCMD (qlogicfas408_queuecommand) +/* * Return bios parameters */
drivers/scsi/qlogicpti.c +3 -1
@@ -1003,7 +1003,7 @@ static int qlogicpti_slave_configure(struct scsi_device *sdev)* * "This code must fly." -davem */ -static int qlogicpti_queuecommand (struct scsi_cmnd *Cmnd,void (*done)(struct scsi_cmnd *)) +static int qlogicpti_queuecommand_lck (struct scsi_cmnd *Cmnd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = Cmnd->device->host;struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
@@ -1052,6 +1052,8 @@ toss_command:return 1 ; } +static DEF_SCSI_QCMD (qlogicpti_queuecommand) + static int qlogicpti_return_status(struct Status_Entry *sts, int id) {int host_status =DID_ERROR ;
drivers/scsi/scsi.c +3 -12
@@ -634,12 +634,13 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)* Description: a serial number identifies a request for error recovery * and debugging purposes. Protected by the Host_Lock of host. */ -static inline void scsi_cmd_get_serial (struct Scsi_Host *host,struct scsi_cmnd *cmd) +void scsi_cmd_get_serial (struct Scsi_Host *host,struct scsi_cmnd *cmd) { cmd->serial_number = host->cmd_serial_number++;if (cmd->serial_number ==0 ) cmd->serial_number = host->cmd_serial_number++; } +EXPORT_SYMBOL (scsi_cmd_get_serial);/** * scsi_dispatch_command - Dispatch a command to the low-level driver.
@@ -651,7 +652,6 @@ static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmndint scsi_dispatch_cmd (struct scsi_cmnd *cmd) {struct Scsi_Host *host = cmd->device->host; -unsigned long flags =0 ;unsigned long timeout;int rtn =0 ;
@@ -737,15 +737,6 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) goto out; } -spin_lock_irqsave (host->host_lock, flags); -/* -* AK: unlikely race here: for some reason the timer could -* expire before the serial number is set up below. -* -* TODO: kill serial or move to blk layer -*/ -scsi_cmd_get_serial (host, cmd); -if (unlikely (host->shost_state ==SHOST_DEL )) { cmd->result = (DID_NO_CONNECT <<16 );scsi_done (cmd);
@@ -753,7 +744,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)trace_scsi_dispatch_cmd_start (cmd); rtn = host->hostt->queuecommand (cmd, scsi_done); } -spin_unlock_irqrestore (host->host_lock, flags); +if (rtn) {trace_scsi_dispatch_cmd_error (cmd, rtn); if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
drivers/scsi/scsi_debug.c +3 -1
@@ -3538,7 +3538,7 @@ static void sdebug_remove_adapter(void) }static -int scsi_debug_queuecommand (struct scsi_cmnd *SCpnt,done_funct_t done) +int scsi_debug_queuecommand_lck (struct scsi_cmnd *SCpnt,done_funct_t done) {unsigned char *cmd = (unsigned char *) SCpnt->cmnd;int len, k;
@@ -3884,6 +3884,8 @@ write: (delay_override ? 0 : scsi_debug_delay)); } +static DEF_SCSI_QCMD (scsi_debug_queuecommand) + static struct scsi_host_template sdebug_driver_template = { .proc_info = scsi_debug_proc_info, .proc_name = sdebug_proc_name,
drivers/scsi/scsi_error.c +0 -3
@@ -781,17 +781,14 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,struct Scsi_Host *shost = sdev->host;DECLARE_COMPLETION_ONSTACK (done);unsigned long timeleft; -unsigned long flags;struct scsi_eh_save ses;int rtn;scsi_eh_prep_cmnd (scmd, &ses, cmnd, cmnd_size, sense_bytes); shost->eh_action = &done; -spin_lock_irqsave (shost->host_lock, flags);scsi_log_send (scmd); shost->hostt->queuecommand (scmd, scsi_eh_done); -spin_unlock_irqrestore (shost->host_lock, flags); timeleft =wait_for_completion_timeout (&done, timeout);
drivers/scsi/stex.c +3 -1
@@ -572,7 +572,7 @@ stex_slave_destroy(struct scsi_device *sdev) }static int -stex_queuecommand (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +stex_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct st_hba *hba;struct Scsi_Host *host;
@@ -698,6 +698,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (stex_queuecommand) + static void stex_scsi_done(struct st_ccb *ccb) {struct scsi_cmnd *cmd = ccb->cmd;
drivers/scsi/sun3_NCR5380.c +3 -1
@@ -908,7 +908,7 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags)*/ /* Only make static if a wrapper function is used */ -static int NCR5380_queue_command (struct scsi_cmnd *cmd, +static int NCR5380_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {SETUP_HOSTDATA (cmd->device->host);
@@ -1019,6 +1019,8 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command) +/* * Function : NCR5380_main (void) *
drivers/scsi/sym53c416.c +3 -1
@@ -734,7 +734,7 @@ const char *sym53c416_info(struct Scsi_Host *SChost)return info; } -int sym53c416_queuecommand (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +static int sym53c416_queuecommand_lck (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) {int base;unsigned long flags =0 ;
@@ -761,6 +761,8 @@ int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))return 0 ; } +DEF_SCSI_QCMD (sym53c416_queuecommand) + static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) {int base;
drivers/scsi/sym53c8xx_2/sym_glue.c +3 -1
@@ -505,7 +505,7 @@ void sym_log_bus_error(struct Scsi_Host *shost)* queuecommand method. Entered with the host adapter lock held and * interrupts disabled. */ -static int sym53c8xx_queue_command (struct scsi_cmnd *cmd, +static int sym53c8xx_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct sym_hcb *np =SYM_SOFTC_PTR (cmd);
@@ -536,6 +536,8 @@ static int sym53c8xx_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (sym53c8xx_queue_command) +/* * Linux entry point of the interrupt handler. */
drivers/scsi/tmscsim.c +3 -1
@@ -1883,7 +1883,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB )return ; } -static int DC390_queuecommand (struct scsi_cmnd *cmd, +static int DC390_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *sdev = cmd->device;
@@ -1944,6 +1944,8 @@ static int DC390_queuecommand(struct scsi_cmnd *cmd,return SCSI_MLQUEUE_DEVICE_BUSY ; } +static DEF_SCSI_QCMD (DC390_queuecommand) + static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) {struct pci_dev *pdev;
drivers/scsi/u14-34f.c +3 -1
@@ -1248,7 +1248,7 @@ static void scsi_to_dev_dir(unsigned int i, unsigned int j) { } -static int u14_34f_queuecommand (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) { +static int u14_34f_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {unsigned int i, j, k;struct mscp *cpp;
@@ -1329,6 +1329,8 @@ static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsreturn 0 ; } +static DEF_SCSI_QCMD (u14_34f_queuecommand) + static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) {unsigned int i, j;
drivers/scsi/ultrastor.c +3 -1
@@ -700,7 +700,7 @@ static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) mscp->transfer_data_length = transfer_length; } -static int ultrastor_queuecommand (struct scsi_cmnd *SCpnt, +static int ultrastor_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct mscp *my_mscp;
@@ -825,6 +825,8 @@ retry:return 0 ; } +static DEF_SCSI_QCMD (ultrastor_queuecommand) +/* This code must deal with 2 cases: 1. The command has not been written to the OGM. In this case, set
drivers/scsi/vmw_pvscsi.c +3 -1
@@ -690,7 +690,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,return 0 ; } -static int pvscsi_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int pvscsi_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct pvscsi_adapter *adapter =shost_priv (host);
@@ -719,6 +719,8 @@ static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (pvscsi_queue) + static int pvscsi_abort(struct scsi_cmnd *cmd) {struct pvscsi_adapter *adapter =shost_priv (cmd->device->host);
drivers/scsi/wd33c93.c +4 -2
@@ -371,8 +371,8 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast, msg[1 ] = offset; } -int -wd33c93_queuecommand (struct scsi_cmnd *cmd, +static int +wd33c93_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct WD33C93_hostdata *hostdata;
@@ -468,6 +468,8 @@ wd33c93_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +DEF_SCSI_QCMD (wd33c93_queuecommand) +/* * This routine attempts to start a scsi command. If the host_card is * already connected, we give up immediately. Otherwise, look through
drivers/scsi/wd7000.c +3 -1
@@ -1082,7 +1082,7 @@ static irqreturn_t wd7000_intr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int wd7000_queuecommand (struct scsi_cmnd *SCpnt, +static int wd7000_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {Scb *scb;
@@ -1139,6 +1139,8 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (wd7000_queuecommand) + static int wd7000_diagnostics(Adapter * host, int code) {static IcbDiag icb = {ICB_OP_DIAGNOSTICS };
drivers/staging/hv/storvsc_drv.c +3 -1
@@ -595,7 +595,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl,/* * storvsc_queuecommand - Initiate command processing */ -static int storvsc_queuecommand (struct scsi_cmnd *scmnd, +static int storvsc_queuecommand_lck (struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *)) {int ret;
@@ -783,6 +783,8 @@ retry_request:return ret; } +static DEF_SCSI_QCMD (storvsc_queuecommand) + static int storvsc_merge_bvec(struct request_queue *q,struct bvec_merge_data *bmd,struct bio_vec *bvec) {
drivers/staging/keucr/scsiglue.c +3 -1
@@ -87,7 +87,7 @@ static int slave_configure(struct scsi_device *sdev)/* This is always called with scsi_lock(host) held */ //----- queuecommand() --------------------- -static int queuecommand (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) +static int queuecommand_lck (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) {struct us_data *us =host_to_us (srb->device->host);
@@ -117,6 +117,8 @@ static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (queuecommand) +/*********************************************************************** * Error handling functions ***********************************************************************/
drivers/usb/image/microtek.c +3 -1
@@ -573,7 +573,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)static int -mts_scsi_queuecommand (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback) +mts_scsi_queuecommand_lck (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback) {struct mts_desc * desc = (struct mts_desc *)(srb->device->host->hostdata[0 ]);int err =0 ;
@@ -626,6 +626,8 @@ out:return err; } +static DEF_SCSI_QCMD (mts_scsi_queuecommand) + static struct scsi_host_template mts_scsi_host_template = { .module =THIS_MODULE , .name ="microtekX6" ,
drivers/usb/storage/scsiglue.c +3 -1
@@ -285,7 +285,7 @@ static int slave_configure(struct scsi_device *sdev)/* queue a command */ /* This is always called with scsi_lock(host) held */ -static int queuecommand (struct scsi_cmnd *srb, +static int queuecommand_lck (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) {struct us_data *us =host_to_us (srb->device->host);
@@ -315,6 +315,8 @@ static int queuecommand(struct scsi_cmnd *srb,return 0 ; } +static DEF_SCSI_QCMD (queuecommand) +/*********************************************************************** * Error handling functions ***********************************************************************/
drivers/usb/storage/uas.c +3 -1
@@ -433,7 +433,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,return 0 ; } -static int uas_queuecommand (struct scsi_cmnd *cmnd, +static int uas_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *sdev = cmnd->device;
@@ -491,6 +491,8 @@ static int uas_queuecommand(struct scsi_cmnd *cmnd,return 0 ; } +static DEF_SCSI_QCMD (uas_queuecommand) + static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) {struct scsi_device *sdev = cmnd->device;
include/scsi/scsi_host.h +22 -0
@@ -505,6 +505,27 @@ struct scsi_host_template { };/* +* Temporary #define for host lock push down. Can be removed when all +* drivers have been updated to take advantage of unlocked +* queuecommand. +* +*/ +#define DEF_SCSI_QCMD (func_name) \ + int func_name(struct scsi_cmnd *cmd, \ + void (*done)(struct scsi_cmnd *)) \ + { \ + unsigned long irq_flags; \ + int rc; \ + struct Scsi_Host *shost = cmd->device->host; \ + spin_lock_irqsave(shost->host_lock, irq_flags); \ + scsi_cmd_get_serial(shost, cmd); \ + rc = func_name##_lck (cmd, done); \ + spin_unlock_irqrestore(shost->host_lock, irq_flags); \ + return rc; \ + } + + +/* * shost state: If you alter this, you also need to alter scsi_sysfs.c * (for the ascii descriptions) and the state model enforcer: * scsi_host_set_state()
@@ -752,6 +773,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);extern void scsi_host_put (struct Scsi_Host *t);extern struct Scsi_Host *scsi_host_lookup (unsigned short );extern const char *scsi_host_state_name (enum scsi_host_state ); +extern void scsi_cmd_get_serial (struct Scsi_Host *,struct scsi_cmnd *);extern u64 scsi_calculate_bounce_limit (struct Scsi_Host *);
Quoted 7 lines · James Bottomley
This patch set contains a single patch modifying the SCSI queuecommand host template API to go from being called with the host lock held to being called locklessly. The transformation is a directly equivalent one (i.e. the locking is simply pushed into each HBA) but will form the basis for optimising locking in the driver patch for the next merge window.
Quoted 9 lines
The patch is available here:
master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
The short changelog is:
Jeff Garzik (1):
host lock push-down
Hi James and Co,
Please feel free to add my review signoff for jgarzik's work.
Thanks!
Quoted 7 lines · James Bottomley
This patch set contains a single patch modifying the SCSI queuecommand host template API to go from being called with the host lock held to being called locklessly. The transformation is a directly equivalent one (i.e. the locking is simply pushed into each HBA) but will form the basis for optimising locking in the driver patch for the next merge window.
Ok, so we talked about this patch at the KS, but I never saw it.
And now seeing it, I do detest it.
Why? Because if some driver gets missed for any reason (notably if it's currently out of tree, and gets merged later), afaik there will be ABSOLUTELY ZERO compiler warnings or anything about it, because you kept the "queuecommand" function exactly the same. Whether it's a locked or non-locked one, it always is of type
int func(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
so there is no inherent type safety. Nothing will ever notice. Not the compiler, and probably not the user either, since a missed lock with probably work in many cases.
So it's a flag-day change, but it's a flag-day change which makes it _really_ easy to miss the fact that a big change had actually happened.
And the sad thing is that this could _trivially_ have been fixed while actually making the patch no bigger. Make the new function look like
int func(struct Scsi_Host *shost, struct scsi_cmnd *cmd, void
(*done)(struct scsi_cmnd *));
instead, and that would have made the "DEF_SCSI_QCMD()" macro simpler and cleaner, it would likely make the code better (since the caller really already always has the 'shost' right there, so looking it up agan in cmd->device->shost is just extra work), _and_ it would mean that if some driver didn't get converted, the compiler would automatically have noticed.
And the patch would look 100% the same, except for these three small one-liner changes:
- the additional one-liner change to the 'queuecommand' function
pointer description itself
- the one-liner change to the actual call-site (which would now not
just drop the lock, it would pass in the extra argument)
- DEF_SCSI_QCMD() would drop the "struct Scsi_Host *shost = .." line,
and instead just take the new argument
It wouldn't change the patch wrt any of the low-level drivers at all. But it would add so much inherent safety against mistakes.
It would _also_ make it much clearer when each driver is then starting to remove that use of the wrapper function. When you remove the wrapper function, you'd probably remove the "_lck" thing at the end of the name, but you'd also change the prototype. It would be a very clear visual clue whether this was a properly converted driver, or whether this was a driver that had never seen the whole locking change at all.
So please: when you change the semantics of a function, just change the function prototype (or function name) at the same time. Especially when it comes to a driver interface, so that the drivers don't get taken by surprise.
Type safety and automatic compiler warnings really are our friends. Especially when the patch was presumably mostly auto-generated, and maybe the script missed something, and missing some conversion has such subtle effects.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 19 lines · Linus Torvalds
Quoted 7 lines · James Bottomley
This patch set contains a single patch modifying the SCSI queuecommand host template API to go from being called with the host lock held to being called locklessly. The transformation is a directly equivalent one (i.e. the locking is simply pushed into each HBA) but will form the basis for optimising locking in the driver patch for the next merge window.
Ok, so we talked about this patch at the KS, but I never saw it.
And now seeing it, I do detest it.
Why? Because if some driver gets missed for any reason (notably if it's currently out of tree, and gets merged later), afaik there will be ABSOLUTELY ZERO compiler warnings or anything about it, because you kept the "queuecommand" function exactly the same. Whether it's a locked or non-locked one, it always is of type
[...]
Quoted 9 lines
So please: when you change the semantics of a function, just change the function prototype (or function name) at the same time. Especially when it comes to a driver interface, so that the drivers don't get taken by surprise.
Type safety and automatic compiler warnings really are our friends. Especially when the patch was presumably mostly auto-generated, and maybe the script missed something, and missing some conversion has such subtle effects.
That is precisely what I mentioned in the original patch:
http://marc.info/?l=linux-ide&m=128891665713984&w=2
And brought this up again when James merged my patch:
http://marc.info/?l=linux-scsi&m=128943169802009&w=2
I even volunteer[ed] to do the work to make it happen...
Jeff
P.S. My patch was not auto-generated. One of the two previous attempts at this change was scripted w/ coccinelle, and it created obvious locking problems.
Quoted 5 lines · Jeff Garzik
That [silent breakage issue] is precisely what I mentioned in the original patch:
http://marc.info/?l=linux-ide&m=128891665713984&w=2And brought this up again when James merged my patch:
http://marc.info/?l=linux-scsi&m=128943169802009&w=2
For the record, I prefer a rename to a prototype change.
Jeff
Quoted 2 lines · Jeff Garzik
For the record, I prefer a rename to a prototype change.
I'm certainly ok with a rename in most cases, but in this case I think the prototype change might be better:
- adding something like a "lck" prefix (or postfix) to the function
pointer name is the logical thing to do, but it's only logical right _now_. Once it all becomes historic and the normal way to do things, rather than a flag-day issue, any name change is likely to just be annoying.
So then we' either have to plan to rename it back once all the
flag-day issues are over and everybody is convinced that things have been converted both in and out of tree, or we'd have to live with an odd "lock" thing. We've seen this issue before: now we've finally gotten rid of the BKL, and what do we call our "ioctl()" function? We call it "unlocked_ioctl". It still makes sense today because the BKL is in fresh memory, but I already wince when I look at it.
- it would add another line of change to each driver, just for the
name change. Maybe not a big deal, and maybe it means you could avoid renaming the existing function instead (and add the "lck" postfix to the new _wrapper_ function, since you need to change the line that initializes things anyway)
- in this case, I think the prototype would probably be improved by
passing in the Scsi_Host pointer. Both the caller and the callee _do_ need it, after all. So yes, it's an "artificial" change, but it's one that doesn't make the code look worse.
But really, I don't care deeply. I think changing the name of the "queuecommand" function in scsi_host_template (or whatever) is fine too, and will certainly fix the "silently and happily compile even non-converted code" problem too. That _is_ the more common way of handling this, but as mentioned above, we've had issues with that approach too. So whatever...
Linus
Quoted 5 lines · Linus Torvalds
And the sad thing is that this could _trivially_ have been fixed while actually making the patch no bigger. Make the new function look like
int func(struct
Scsi_Host*shost, structscsi_cmnd*cmd, void
(*done)(structscsi_cmnd*));
Actually, it'd be even better if we took away an argument.
int queuecommand(struct scsi_cmnd *cmd);
Every single driver sets cmd->scsi_done = done;
(some don't do it immediately, but they all do it eventually. Do it in the single caller, and eventually remove the assignments from the drivers).
Signature · 4 lines
Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 5 lines · Matthew Wilcox
Actually, it'd be even better if we took away an argument.
int
queuecommand(struct scsi_cmnd *cmd);Every single driver sets
cmd->scsi_done= done;
.. and i that's all they really ever do with it, I guess that that would indeed be an improvement.
I still do think that passing in shost is actually a good idea, since you'll normally be needing it for locking and other things anyway (looking at the libata-scsi.c one, for example, the very first thing it wants to do is to look up the port from the shost pointer).
Having to inevitably do that silly double dereference ("cmd->device->host") seems bogus. Passing in the host you want to queue something on seems to be natural, and avoids that nasty chain of dereferences, so it really should improve the code.
I don't think there are any drivers that don't want that host pointer pretty much immediately, even if they can elide the locking. But I admit I only looked at two (qla4xxx driver does the exact same thing:
the very first thing in the queuecommand function is "to_qla_host(cmd->device->host)", but it wants that hostdata thing too, so whatever.)
So the shost pointer is certainly a lot more useful than the 'done' function pointer. So yeah, I'd switch them around - pass the 'done' thing indirectly, and the shost directly.
Linus
Quoted 4 lines · Linus Torvalds
Having to inevitably do that silly double dereference ("
cmd->device->host") seems bogus. Passing in the host you want to queue something on seems to be natural, and avoids that nasty chain of dereferences, so it really should improve the code.
As noted in the patch v4, just sent, I agree.
Quoted 3 lines
So the shost pointer is certainly a lot more useful than the 'done' function pointer. So yeah, I'd switch them around - pass the 'done' thing indirectly, and the shost directly.
You bozos would come up with this the _minute_ I sent my patch, eh? :)
IMO, the 'done' removal should be in a separate patch from the host lock push-down.
It should be straightforward, if applied immediately following the push-down patch. bisect remains clean.
Jeff
Quoted 27 lines · Linus Torvalds
Quoted 5 lines · Matthew Wilcox
Actually, it'd be even better if we took away an argument.
int
queuecommand(struct scsi_cmnd *cmd);Every single driver sets
cmd->scsi_done= done;.. and i that's all they really ever do with it, I guess that that would indeed be an improvement.
I still do think that passing in shost is actually a good idea, since you'll normally be needing it for locking and other things anyway (looking at the
libata-scsi.cone, for example, the very first thing it wants to do is to look up the port from the shost pointer).Having to inevitably do that silly double dereference ("
cmd->device->host") seems bogus. Passing in the host you want to queue something on seems to be natural, and avoids that nasty chain of dereferences, so it really should improve the code.I don't think there are any drivers that don't want that host pointer pretty much immediately, even if they can elide the locking. But I admit I only looked at two (qla4xxx driver does the exact same thing:
the very first thing in the queuecommand function is "to_qla_host(cmd->device->host)", but it wants that hostdata thing too, so whatever.)
Quoted 3 lines
So the shost pointer is certainly a lot more useful than the 'done' function pointer. So yeah, I'd switch them around - pass the 'done' thing indirectly, and the shost directly.
I'd like to get rid of done too. I'm ambivalent on whether we pass in the host or not, but I did it anyway.
The patch is reasonably small but there are a few driver prototypes to clean up as well. How does the attached look? If OK, I'll fold it in and resubmit the pull.
I think I picked up all the non-x86 drivers that don't show up under allmodconfig, but it would be nice to incubate this in next for another couple of days to be sure.
James
---
drivers/block/cciss_scsi.c +2 -2
@@ -62,8 +62,8 @@ static int cciss_scsi_proc_info(int length,/* length of data in buffer */ int func); /* 0 == read, 1 == write */ -static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, -void (* done)(struct scsi_cmnd *)); +static int cciss_scsi_queue_command (struct Scsi_Host *h, +struct scsi_cmnd *cmd);static int cciss_eh_device_reset_handler (struct scsi_cmnd *);static int cciss_eh_abort_handler (struct scsi_cmnd *);
drivers/scsi/53c700.c +1 -1
@@ -167,7 +167,7 @@ MODULE_LICENSE("GPL");#include "53c700_d.h" -STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); +STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
drivers/scsi/BusLogic.h +1 -1
@@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co*/ static const char *BusLogic_DriverInfo (struct Scsi_Host *); -static int BusLogic_QueueCommand (struct scsi_cmnd *,void (*CompletionRoutine) (struct scsi_cmnd *)); +static int BusLogic_QueueCommand (struct Scsi_Host *h,struct scsi_cmnd *);static int BusLogic_BIOSDiskParameters (struct scsi_device *,struct block_device *,sector_t ,int *);static int BusLogic_ProcDirectoryInfo (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int BusLogic_SlaveConfigure (struct scsi_device *);
drivers/scsi/NCR5380.h +1 -1
@@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance);#endif static int NCR5380_abort (Scsi_Cmnd * cmd);static int NCR5380_bus_reset (Scsi_Cmnd * cmd); -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)); +static int NCR5380_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int __maybe_unused NCR5380_proc_info (struct Scsi_Host *instance,char *buffer,char **start,off_t offset,int length,int inout);
drivers/scsi/aha1542.h +1 -1
@@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */ };static int aha1542_detect (struct scsi_host_template *); -static int aha1542_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int aha1542_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int aha1542_bus_reset (Scsi_Cmnd * SCpnt);static int aha1542_dev_reset (Scsi_Cmnd * SCpnt);static int aha1542_host_reset (Scsi_Cmnd * SCpnt);
drivers/scsi/arcmsr/arcmsr_hba.c +1 -2
@@ -85,8 +85,7 @@ static int arcmsr_abort(struct scsi_cmnd *);static int arcmsr_bus_reset (struct scsi_cmnd *);static int arcmsr_bios_param (struct scsi_device *sdev,struct block_device *bdev,sector_t capacity,int *info); -static int arcmsr_queue_command (struct scsi_cmnd *cmd, -void (*done) (struct scsi_cmnd *)); +static int arcmsr_queue_command (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int arcmsr_probe (struct pci_dev *pdev,const struct pci_device_id *id);static void arcmsr_remove (struct pci_dev *pdev);
drivers/scsi/arm/fas216.h +8 -10
@@ -331,23 +331,21 @@ extern int fas216_init (struct Scsi_Host *instance);*/ extern int fas216_add (struct Scsi_Host *instance,struct device *dev); -/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) * Purpose : queue a command for adapter to process. -* Params : SCpnt - Command to queue -* done - done function to call once command is complete +* Params : h - host adapter +* : SCpnt - Command to queue * Returns : 0 - success, else error */ -extern int fas216_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +extern int fas216_queue_command (struct Scsi_Host *h,struct scsi_cmnd *SCpnt); -/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) * Purpose : queue a command for adapter to process, and process it to completion. -* Params : SCpnt - Command to queue -* done - done function to call once command is complete +* Params : h - host adapter +* : SCpnt - Command to queue * Returns : 0 - success, else error */ -extern int fas216_noqueue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +extern int fas216_noqueue_command (struct Scsi_Host *,struct scsi_cmnd *)/* Function: irqreturn_t fas216_intr (FAS216_Info *info) * Purpose : handle interrupts from the interface to progress a command
drivers/scsi/bfa/bfad_im.c +1 -2
@@ -30,8 +30,7 @@ DEFINE_IDR(bfad_im_port_index);struct scsi_transport_template *bfad_im_scsi_transport_template;struct scsi_transport_template *bfad_im_scsi_vport_transport_template;static void bfad_im_itnim_work_handler (struct work_struct *work); -static int bfad_im_queuecommand (struct scsi_cmnd *cmnd, -void (*done)(struct scsi_cmnd *)); +static int bfad_im_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmnd);static int bfad_im_slave_alloc (struct scsi_device *sdev);static void bfad_im_fc_rport_add (struct bfad_im_port_s *im_port,struct bfad_itnim_s *itnim);
drivers/scsi/dpti.h +1 -1
@@ -29,7 +29,7 @@*/ static int adpt_detect (struct scsi_host_template * sht); -static int adpt_queue (struct scsi_cmnd * cmd,void (*cmdcomplete) (struct scsi_cmnd *)); +static int adpt_queue (struct Scsi_Host *h,struct scsi_cmnd * cmd);static int adpt_abort (struct scsi_cmnd * cmd);static int adpt_reset (struct scsi_cmnd * cmd);static int adpt_release (struct Scsi_Host *host);
drivers/scsi/dtc.h +1 -1
@@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *);static int dtc_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int dtc_detect (struct scsi_host_template *); -static int dtc_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int dtc_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int dtc_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/eata.c +1 -2
@@ -505,8 +505,7 @@static int eata2x_detect (struct scsi_host_template *);static int eata2x_release (struct Scsi_Host *); -static int eata2x_queuecommand (struct scsi_cmnd *, -void (*done) (struct scsi_cmnd *)); +static int eata2x_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int eata2x_eh_abort (struct scsi_cmnd *);static int eata2x_eh_host_reset (struct scsi_cmnd *); static int eata2x_bios_param(struct scsi_device *, struct block_device *,
drivers/scsi/fnic/fnic.h +1 -1
@@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *);void fnic_update_mac (struct fc_lport *,u8 *new);void fnic_update_mac_locked (struct fnic *,u8 *new); -int fnic_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +int fnic_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int fnic_abort_cmd (struct scsi_cmnd *);int fnic_device_reset (struct scsi_cmnd *);int fnic_host_reset (struct scsi_cmnd *);
drivers/scsi/g_NCR5380.h +1 -1
@@ -46,7 +46,7 @@static int generic_NCR5380_abort (Scsi_Cmnd *);static int generic_NCR5380_detect (struct scsi_host_template *);static int generic_NCR5380_release_resources (struct Scsi_Host *); -static int generic_NCR5380_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int generic_NCR5380_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int generic_NCR5380_bus_reset (Scsi_Cmnd *);static const char *generic_NCR5380_info (struct Scsi_Host *);
drivers/scsi/gdth.c +1 -1
@@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);static void gdth_flush (gdth_ha_str *ha); -static int gdth_queuecommand (Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); +static int gdth_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int __gdth_queuecommand (gdth_ha_str *ha,struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo);static void gdth_scsi_done (struct scsi_cmnd *scp);
drivers/scsi/hpsa.c +1 -2
@@ -143,8 +143,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h, void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, int cmd_type); -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, -void (*done)(struct scsi_cmnd *)); +static int hpsa_scsi_queue_command (struct Scsi_Host *h,struct scsi_cmnd *cmd);static void hpsa_scan_start (struct Scsi_Host *);static int hpsa_scan_finished (struct Scsi_Host *sh,unsigned long elapsed_time);
drivers/scsi/ibmmca.c +1 -1
@@ -39,7 +39,7 @@#include <scsi/scsi_host.h> /* Common forward declarations for all Linux-versions: */ -static int ibmmca_queuecommand (Scsi_Cmnd *,void (*done) (Scsi_Cmnd *)); +static int ibmmca_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int ibmmca_abort (Scsi_Cmnd *);static int ibmmca_host_reset (Scsi_Cmnd *);static int ibmmca_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);
drivers/scsi/in2000.h +1 -1
@@ -396,7 +396,7 @@ struct IN2000_hostdata { flags) static int in2000_detect(struct scsi_host_template *) in2000__INIT; -static int in2000_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int in2000_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int in2000_abort (Scsi_Cmnd *); static void in2000_setup(char *, int *) in2000__INIT; static int in2000_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/ips.c +1 -1
@@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *);static int ips_release (struct Scsi_Host *);static int ips_eh_abort (struct scsi_cmnd *);static int ips_eh_reset (struct scsi_cmnd *); -static int ips_queue (struct scsi_cmnd *,void (*)(struct scsi_cmnd *)); +static int ips_queue (struct Scsi_Host *,struct scsi_cmnd *);static const char *ips_info (struct Scsi_Host *);static irqreturn_t do_ipsintr (int ,void *);static int ips_hainit (ips_ha_t *);
drivers/scsi/megaraid.c +1 -1
@@ -4458,7 +4458,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) scb->idx =CMDID_INT_CMDS ; -megaraid_queue (scmd, mega_internal_done); +megaraid_queue_lck (scmd, mega_internal_done);wait_for_completion (&adapter->int_waitq);
drivers/scsi/megaraid.h +1 -1
@@ -987,7 +987,7 @@ static int mega_query_adapter(adapter_t *);static int issue_scb (adapter_t *,scb_t *);static int mega_setup_mailbox (adapter_t *); -static int megaraid_queue (Scsi_Cmnd *,void (*)(Scsi_Cmnd *)); +static int megaraid_queue (struct Scsi_Host *,struct scsi_cmnd *);static scb_t *mega_build_cmd (adapter_t *,Scsi_Cmnd *,int *);static void __mega_runpendq (adapter_t *);static int issue_scb_block (adapter_t *,u_char *);
drivers/scsi/megaraid/megaraid_mbox.c +1 -2
@@ -113,8 +113,7 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *);static void megaraid_mbox_display_scb (adapter_t *,scb_t *);static void megaraid_mbox_setup_device_map (adapter_t *); -static int megaraid_queue_command (struct scsi_cmnd *, -void (*)(struct scsi_cmnd *)); +static int megaraid_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static scb_t *megaraid_mbox_build_cmd (adapter_t *,struct scsi_cmnd *,int *);static void megaraid_mbox_runpendq (adapter_t *,scb_t *); static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *,
drivers/scsi/pas16.h +1 -1
@@ -118,7 +118,7 @@ static int pas16_abort(Scsi_Cmnd *);static int pas16_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int pas16_detect (struct scsi_host_template *); -static int pas16_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int pas16_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int pas16_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/pcmcia/nsp_cs.h +1 -2
@@ -299,8 +299,7 @@ static int nsp_proc_info (off_t offset, int length, int inout); -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, -void (* done)(struct scsi_cmnd *SCpnt)); +static int nsp_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *SCpnt);/* Error handler */ /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
drivers/scsi/qla2xxx/qla_os.c +1 -2
@@ -179,8 +179,7 @@ static int qla2xxx_slave_alloc(struct scsi_device *);static int qla2xxx_scan_finished (struct Scsi_Host *,unsigned long time);static void qla2xxx_scan_start (struct Scsi_Host *);static void qla2xxx_slave_destroy (struct scsi_device *); -static int qla2xxx_queuecommand (struct scsi_cmnd *cmd, -void (*fn)(struct scsi_cmnd *)); +static int qla2xxx_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int qla2xxx_eh_abort (struct scsi_cmnd *);static int qla2xxx_eh_device_reset (struct scsi_cmnd *);static int qla2xxx_eh_target_reset (struct scsi_cmnd *);
drivers/scsi/qla4xxx/ql4_os.c +1 -2
@@ -79,8 +79,7 @@ static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc);/* * SCSI host template entry points */ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, -void (*done) (struct scsi_cmnd *)); +static int qla4xxx_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int qla4xxx_eh_abort (struct scsi_cmnd *cmd);static int qla4xxx_eh_device_reset (struct scsi_cmnd *cmd);static int qla4xxx_eh_target_reset (struct scsi_cmnd *cmd);
drivers/scsi/qlogicfas408.h +1 -2
@@ -103,8 +103,7 @@ struct qlogicfas408_priv {#define get_priv_by_host (x) (struct qlogicfas408_priv *)&((x)->hostdata[0])irqreturn_t qlogicfas408_ihandl (int irq,void *dev_id); -int qlogicfas408_queuecommand (struct scsi_cmnd * cmd, -void (*done) (struct scsi_cmnd *)); +int qlogicfas408_queuecommand (struct Scsi_Host *h,struct scsi_cmnd * cmd);int qlogicfas408_biosparam (struct scsi_device * disk,struct block_device *dev,sector_t capacity,int ip[]);
drivers/scsi/scsi.c +2 -1
@@ -742,7 +742,8 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)scsi_done (cmd); }else {trace_scsi_dispatch_cmd_start (cmd); - rtn = host->hostt->queuecommand (cmd, scsi_done); + cmd->scsi_done = scsi_done; + rtn = host->hostt->queuecommand (host, cmd); }if (rtn) {
drivers/scsi/scsi_error.c +2 -1
@@ -788,7 +788,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, shost->eh_action = &done;scsi_log_send (scmd); - shost->hostt->queuecommand (scmd, scsi_eh_done); + scmd->scsi_done = scsi_eh_done; + shost->hostt->queuecommand (shost, scmd); timeleft =wait_for_completion_timeout (&done, timeout);
drivers/scsi/sun3_scsi.h +1 -2
@@ -51,8 +51,7 @@ static int sun3scsi_abort(struct scsi_cmnd *);static int sun3scsi_detect (struct scsi_host_template *);static const char *sun3scsi_info (struct Scsi_Host *);static int sun3scsi_bus_reset (struct scsi_cmnd *); -static int sun3scsi_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int sun3scsi_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int sun3scsi_release (struct Scsi_Host *);#ifndef CMD_PER_LUN
drivers/scsi/sym53c416.h +1 -1
@@ -25,7 +25,7 @@static int sym53c416_detect (struct scsi_host_template *);static const char *sym53c416_info (struct Scsi_Host *);static int sym53c416_release (struct Scsi_Host *); -static int sym53c416_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int sym53c416_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int sym53c416_host_reset (Scsi_Cmnd *);static int sym53c416_bios_param (struct scsi_device *,struct block_device *,sector_t ,int *);
drivers/scsi/t128.h +1 -2
@@ -96,8 +96,7 @@ static int t128_abort(struct scsi_cmnd *);static int t128_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int t128_detect (struct scsi_host_template *); -static int t128_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int t128_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int t128_bus_reset (struct scsi_cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/u14-34f.c +1 -1
@@ -433,7 +433,7 @@static int u14_34f_detect (struct scsi_host_template *);static int u14_34f_release (struct Scsi_Host *); -static int u14_34f_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +static int u14_34f_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int u14_34f_eh_abort (struct scsi_cmnd *);static int u14_34f_eh_host_reset (struct scsi_cmnd *); static int u14_34f_bios_param(struct scsi_device *, struct block_device *,
drivers/scsi/ultrastor.h +1 -2
@@ -15,8 +15,7 @@static int ultrastor_detect (struct scsi_host_template *);static const char *ultrastor_info (struct Scsi_Host *shpnt); -static int ultrastor_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int ultrastor_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int ultrastor_abort (struct scsi_cmnd *);static int ultrastor_host_reset (struct scsi_cmnd *); static int ultrastor_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/wd33c93.h +1 -2
@@ -343,8 +343,7 @@ struct WD33C93_hostdata {void wd33c93_init (struct Scsi_Host *instance,const wd33c93_regs regs,dma_setup_t setup,dma_stop_t stop,int clock_freq);int wd33c93_abort (struct scsi_cmnd *cmd); -int wd33c93_queuecommand (struct scsi_cmnd *cmd, -void (*done)(struct scsi_cmnd *)); +int wd33c93_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);void wd33c93_intr (struct Scsi_Host *instance);int wd33c93_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );int wd33c93_host_reset (struct scsi_cmnd *);
include/linux/libata.h +1 -1
@@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, unsigned long, struct ata_port_operations *);extern int ata_scsi_detect (struct scsi_host_template *sht);extern int ata_scsi_ioctl (struct scsi_device *dev,int cmd,void __user *arg); -extern int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)); +extern int ata_scsi_queuecmd (struct Scsi_Host *h,struct scsi_cmnd *cmd);extern int ata_sas_scsi_ioctl (struct ata_port *ap,struct scsi_device *dev,int cmd,void __user *arg);extern void ata_sas_port_destroy (struct ata_port *);
include/scsi/libfc.h +1 -2
@@ -1006,8 +1006,7 @@ void fc_fcp_destroy(struct fc_lport *);/* * SCSI INTERACTION LAYER *****************************/ -int fc_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +int fc_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int fc_eh_abort (struct scsi_cmnd *);int fc_eh_device_reset (struct scsi_cmnd *);int fc_eh_host_reset (struct scsi_cmnd *);
include/scsi/libiscsi.h +1 -2
@@ -341,8 +341,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);extern int iscsi_eh_recover_target (struct scsi_cmnd *sc);extern int iscsi_eh_session_reset (struct scsi_cmnd *sc);extern int iscsi_eh_device_reset (struct scsi_cmnd *sc); -extern int iscsi_queuecommand (struct scsi_cmnd *sc, -void (*done)(struct scsi_cmnd *)); +extern int iscsi_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *sc);/* * iSCSI host helpers.
include/scsi/libsas.h +1 -2
@@ -621,8 +621,7 @@ int sas_set_phy_speed(struct sas_phy *phy,int sas_phy_enable (struct sas_phy *phy,int enabled);int sas_phy_reset (struct sas_phy *phy,int hard_reset);int sas_queue_up (struct sas_task *task); -extern int sas_queuecommand (struct scsi_cmnd *, -void (*scsi_done)(struct scsi_cmnd *)); +extern int sas_queuecommand (struct Scsi_Host * ,struct scsi_cmnd *);extern int sas_target_alloc (struct scsi_target *);extern int sas_slave_alloc (struct scsi_device *);extern int sas_slave_configure (struct scsi_device *);
include/scsi/scsi_host.h +3 -6
@@ -127,8 +127,7 @@ struct scsi_host_template {* * STATUS: REQUIRED */ -int (* queuecommand)(struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +int (* queuecommand)(struct Scsi_Host *,struct scsi_cmnd *);/* * The transfer functions are used to queue a scsi command to
@@ -511,15 +510,13 @@ struct scsi_host_template {* */ #define DEF_SCSI_QCMD (func_name) \ - int func_name(struct scsi_cmnd *cmd, \ - void (*done)(struct scsi_cmnd *)) \ + int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ { \ unsigned long irq_flags; \ int rc; \ - struct Scsi_Host *shost = cmd->device->host; \ spin_lock_irqsave(shost->host_lock, irq_flags); \ scsi_cmd_get_serial(shost, cmd); \ - rc = func_name##_lck (cmd, done); \ + rc = func_name##_lck (cmd, cmd->scsi_done); \ spin_unlock_irqrestore(shost->host_lock, irq_flags); \ return rc; \ }
Quoted 10 lines · James Bottomley
I'd like to get rid of done too. I'm ambivalent on whether we pass in the host or not, but I did it anyway.
The patch is reasonably small but there are a few driver prototypes to clean up as well. How does the attached look? If OK, I'll fold it in and resubmit the pull.
I think I picked up all the non-x86 drivers that don't show up under allmodconfig, but it would be nice to incubate this in next for another couple of days to be sure.
Looks like you caught the megaraid deadlock, but missed a few others...
I'll rediff mine as incremental as discussed on IRC.
Quoted 8 lines · Jeff Garzik
Quoted 7 lines · James Bottomley
I'd like to get rid of done too. I'm ambivalent on whether we pass in the host or not, but I did it anyway.
The patch is reasonably small but there are a few driver prototypes to clean up as well. How does the attached look? If OK, I'll fold it in and resubmit the pull.
Quoted 6 lines
Quoted 3 lines
I think I picked up all the non-x86 drivers that don't show up under allmodconfig, but it would be nice to incubate this in next for another couple of days to be sure.
Looks like you caught the megaraid deadlock, but missed a few others...
I'll rediff mine as incremental as discussed on IRC.
Great, thanks for jumping on this everyone..
I will await Jeff's v5 pull request to linus and rebase the atomic_t host->cmd_serial_number counter + first round of host_lock-less LLDs conversions patches on this code for the lock_less-LLDs-for-38-v2.
--nab
Quoted 10 lines · James Bottomley
I'd like to get rid of done too. I'm ambivalent on whether we pass in the host or not, but I did it anyway.
The patch is reasonably small but there are a few driver prototypes to clean up as well. How does the attached look? If OK, I'll fold it in and resubmit the pull.
I think I picked up all the non-x86 drivers that don't show up under allmodconfig, but it would be nice to incubate this in next for another couple of days to be sure.
Attached is a diff against scsi-rc-fixes (aka host lock push down v3).
It is basically your incremental patch + fas216 deadlock fix + several more prototype fixes.
drivers/block/cciss_scsi.c | 4 ++-- drivers/message/fusion/mptfc.c | 3 +-- drivers/scsi/53c700.c | 2 +- drivers/scsi/BusLogic.h | 2 +- drivers/scsi/NCR5380.h | 2 +- drivers/scsi/aha1542.h | 2 +- drivers/scsi/arcmsr/arcmsr_hba.c | 3 +-- drivers/scsi/arm/fas216.c | 2 +- drivers/scsi/arm/fas216.h | 18 ++++++++---------- drivers/scsi/atari_scsi.c | 17 ----------------- drivers/scsi/bfa/bfad_im.c | 3 +-- drivers/scsi/dpti.h | 2 +- drivers/scsi/dtc.h | 2 +- drivers/scsi/eata.c | 3 +-- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/g_NCR5380.h | 2 +- drivers/scsi/gdth.c | 2 +- drivers/scsi/hpsa.c | 3 +-- drivers/scsi/ibmmca.c | 2 +- drivers/scsi/in2000.h | 2 +- drivers/scsi/ips.c | 2 +- drivers/scsi/megaraid.c | 2 +- drivers/scsi/megaraid.h | 2 +- drivers/scsi/megaraid/megaraid_mbox.c | 3 +-- drivers/scsi/nsp32.c | 3 +-- drivers/scsi/pas16.h | 2 +- drivers/scsi/pcmcia/nsp_cs.h | 3 +-- drivers/scsi/qla2xxx/qla_os.c | 3 +-- drivers/scsi/qla4xxx/ql4_os.c | 3 +-- drivers/scsi/qlogicfas408.h | 3 +-- drivers/scsi/scsi.c | 3 ++- drivers/scsi/scsi_error.c | 3 ++- drivers/scsi/sun3_scsi.h | 3 +-- drivers/scsi/sym53c416.h | 2 +- drivers/scsi/t128.h | 3 +-- drivers/scsi/u14-34f.c | 2 +- drivers/scsi/ultrastor.h | 3 +-- drivers/scsi/wd33c93.h | 3 +-- drivers/staging/hv/storvsc_drv.c | 3 +-- drivers/usb/image/microtek.c | 2 +- include/linux/libata.h | 2 +- include/scsi/libfc.h | 3 +-- include/scsi/libiscsi.h | 3 +-- include/scsi/libsas.h | 3 +-- include/scsi/scsi_host.h | 9 +++------ 45 files changed, 56 insertions(+), 95 deletions(-)
drivers/block/cciss_scsi.c +2 -2
@@ -62,8 +62,8 @@ static int cciss_scsi_proc_info(int length,/* length of data in buffer */ int func); /* 0 == read, 1 == write */ -static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, -void (* done)(struct scsi_cmnd *)); +static int cciss_scsi_queue_command (struct Scsi_Host *h, +struct scsi_cmnd *cmd);static int cciss_eh_device_reset_handler (struct scsi_cmnd *);static int cciss_eh_abort_handler (struct scsi_cmnd *);
drivers/message/fusion/mptfc.c +1 -2
@@ -97,8 +97,7 @@ static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;static int mptfc_target_alloc (struct scsi_target *starget);static int mptfc_slave_alloc (struct scsi_device *sdev); -static int mptfc_qcmd (struct scsi_cmnd *SCpnt, -void (*done)(struct scsi_cmnd *)); +static int mptfc_qcmd (struct Scsi_Host *shost,struct scsi_cmnd *SCpnt);static void mptfc_target_destroy (struct scsi_target *starget);static void mptfc_set_rport_loss_tmo (struct fc_rport *rport,uint32_t timeout); static void __devexit mptfc_remove(struct pci_dev *pdev);
drivers/scsi/53c700.c +1 -1
@@ -167,7 +167,7 @@ MODULE_LICENSE("GPL");#include "53c700_d.h" -STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); +STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
drivers/scsi/BusLogic.h +1 -1
@@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co*/ static const char *BusLogic_DriverInfo (struct Scsi_Host *); -static int BusLogic_QueueCommand (struct scsi_cmnd *,void (*CompletionRoutine) (struct scsi_cmnd *)); +static int BusLogic_QueueCommand (struct Scsi_Host *h,struct scsi_cmnd *);static int BusLogic_BIOSDiskParameters (struct scsi_device *,struct block_device *,sector_t ,int *);static int BusLogic_ProcDirectoryInfo (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int BusLogic_SlaveConfigure (struct scsi_device *);
drivers/scsi/NCR5380.h +1 -1
@@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance);#endif static int NCR5380_abort (Scsi_Cmnd * cmd);static int NCR5380_bus_reset (Scsi_Cmnd * cmd); -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)); +static int NCR5380_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int __maybe_unused NCR5380_proc_info (struct Scsi_Host *instance,char *buffer,char **start,off_t offset,int length,int inout);
drivers/scsi/aha1542.h +1 -1
@@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */ };static int aha1542_detect (struct scsi_host_template *); -static int aha1542_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int aha1542_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int aha1542_bus_reset (Scsi_Cmnd * SCpnt);static int aha1542_dev_reset (Scsi_Cmnd * SCpnt);static int aha1542_host_reset (Scsi_Cmnd * SCpnt);
drivers/scsi/arcmsr/arcmsr_hba.c +1 -2
@@ -85,8 +85,7 @@ static int arcmsr_abort(struct scsi_cmnd *);static int arcmsr_bus_reset (struct scsi_cmnd *);static int arcmsr_bios_param (struct scsi_device *sdev,struct block_device *bdev,sector_t capacity,int *info); -static int arcmsr_queue_command (struct scsi_cmnd *cmd, -void (*done) (struct scsi_cmnd *)); +static int arcmsr_queue_command (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int arcmsr_probe (struct pci_dev *pdev,const struct pci_device_id *id);static void arcmsr_remove (struct pci_dev *pdev);
drivers/scsi/arm/fas216.c +1 -1
@@ -2279,7 +2279,7 @@ static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt,BUG_ON (info->scsi.irq !=NO_IRQ ); info->internal_done =0 ; -fas216_queue_command (SCpnt, fas216_internal_done); +fas216_queue_command_lck (SCpnt, fas216_internal_done);/* * This wastes time, since we can't return until the command is
drivers/scsi/arm/fas216.h +8 -10
@@ -331,23 +331,21 @@ extern int fas216_init (struct Scsi_Host *instance);*/ extern int fas216_add (struct Scsi_Host *instance,struct device *dev); -/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) * Purpose : queue a command for adapter to process. -* Params : SCpnt - Command to queue -* done - done function to call once command is complete +* Params : h - host adapter +* : SCpnt - Command to queue * Returns : 0 - success, else error */ -extern int fas216_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +extern int fas216_queue_command (struct Scsi_Host *h,struct scsi_cmnd *SCpnt); -/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) * Purpose : queue a command for adapter to process, and process it to completion. -* Params : SCpnt - Command to queue -* done - done function to call once command is complete +* Params : h - host adapter +* : SCpnt - Command to queue * Returns : 0 - success, else error */ -extern int fas216_noqueue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +extern int fas216_noqueue_command (struct Scsi_Host *,struct scsi_cmnd *)/* Function: irqreturn_t fas216_intr (FAS216_Info *info) * Purpose : handle interrupts from the interface to progress a command
drivers/scsi/atari_scsi.c +0 -17
@@ -572,23 +572,6 @@ static void falcon_get_lock(void) } -/* This is the wrapper function for NCR5380_queue_command(). It just -* tries to get the lock on the ST-DMA (see above) and then calls the -* original function. -*/ - -#if 0 -int atari_queue_command (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) -{ -/* falcon_get_lock(); -* ++guenther: moved to NCR5380_queue_command() to prevent -* race condition, see there for an explanation. -*/ -return NCR5380_queue_command (cmd, done); -} -#endif - -int __init atari_scsi_detect (struct scsi_host_template *host) {static int called =0 ;
drivers/scsi/bfa/bfad_im.c +1 -2
@@ -30,8 +30,7 @@ DEFINE_IDR(bfad_im_port_index);struct scsi_transport_template *bfad_im_scsi_transport_template;struct scsi_transport_template *bfad_im_scsi_vport_transport_template;static void bfad_im_itnim_work_handler (struct work_struct *work); -static int bfad_im_queuecommand (struct scsi_cmnd *cmnd, -void (*done)(struct scsi_cmnd *)); +static int bfad_im_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmnd);static int bfad_im_slave_alloc (struct scsi_device *sdev);static void bfad_im_fc_rport_add (struct bfad_im_port_s *im_port,struct bfad_itnim_s *itnim);
drivers/scsi/dpti.h +1 -1
@@ -29,7 +29,7 @@*/ static int adpt_detect (struct scsi_host_template * sht); -static int adpt_queue (struct scsi_cmnd * cmd,void (*cmdcomplete) (struct scsi_cmnd *)); +static int adpt_queue (struct Scsi_Host *h,struct scsi_cmnd * cmd);static int adpt_abort (struct scsi_cmnd * cmd);static int adpt_reset (struct scsi_cmnd * cmd);static int adpt_release (struct Scsi_Host *host);
drivers/scsi/dtc.h +1 -1
@@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *);static int dtc_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int dtc_detect (struct scsi_host_template *); -static int dtc_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int dtc_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int dtc_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/eata.c +1 -2
@@ -505,8 +505,7 @@static int eata2x_detect (struct scsi_host_template *);static int eata2x_release (struct Scsi_Host *); -static int eata2x_queuecommand (struct scsi_cmnd *, -void (*done) (struct scsi_cmnd *)); +static int eata2x_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int eata2x_eh_abort (struct scsi_cmnd *);static int eata2x_eh_host_reset (struct scsi_cmnd *); static int eata2x_bios_param(struct scsi_device *, struct block_device *,
drivers/scsi/fnic/fnic.h +1 -1
@@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *);void fnic_update_mac (struct fc_lport *,u8 *new);void fnic_update_mac_locked (struct fnic *,u8 *new); -int fnic_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +int fnic_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int fnic_abort_cmd (struct scsi_cmnd *);int fnic_device_reset (struct scsi_cmnd *);int fnic_host_reset (struct scsi_cmnd *);
drivers/scsi/g_NCR5380.h +1 -1
@@ -46,7 +46,7 @@static int generic_NCR5380_abort (Scsi_Cmnd *);static int generic_NCR5380_detect (struct scsi_host_template *);static int generic_NCR5380_release_resources (struct Scsi_Host *); -static int generic_NCR5380_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int generic_NCR5380_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int generic_NCR5380_bus_reset (Scsi_Cmnd *);static const char *generic_NCR5380_info (struct Scsi_Host *);
drivers/scsi/gdth.c +1 -1
@@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);static void gdth_flush (gdth_ha_str *ha); -static int gdth_queuecommand (Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); +static int gdth_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int __gdth_queuecommand (gdth_ha_str *ha,struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo);static void gdth_scsi_done (struct scsi_cmnd *scp);
drivers/scsi/hpsa.c +1 -2
@@ -143,8 +143,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h, void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, int cmd_type); -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, -void (*done)(struct scsi_cmnd *)); +static int hpsa_scsi_queue_command (struct Scsi_Host *h,struct scsi_cmnd *cmd);static void hpsa_scan_start (struct Scsi_Host *);static int hpsa_scan_finished (struct Scsi_Host *sh,unsigned long elapsed_time);
drivers/scsi/ibmmca.c +1 -1
@@ -39,7 +39,7 @@#include <scsi/scsi_host.h> /* Common forward declarations for all Linux-versions: */ -static int ibmmca_queuecommand (Scsi_Cmnd *,void (*done) (Scsi_Cmnd *)); +static int ibmmca_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int ibmmca_abort (Scsi_Cmnd *);static int ibmmca_host_reset (Scsi_Cmnd *);static int ibmmca_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);
drivers/scsi/in2000.h +1 -1
@@ -396,7 +396,7 @@ struct IN2000_hostdata { flags) static int in2000_detect(struct scsi_host_template *) in2000__INIT; -static int in2000_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int in2000_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int in2000_abort (Scsi_Cmnd *); static void in2000_setup(char *, int *) in2000__INIT; static int in2000_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/ips.c +1 -1
@@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *);static int ips_release (struct Scsi_Host *);static int ips_eh_abort (struct scsi_cmnd *);static int ips_eh_reset (struct scsi_cmnd *); -static int ips_queue (struct scsi_cmnd *,void (*)(struct scsi_cmnd *)); +static int ips_queue (struct Scsi_Host *,struct scsi_cmnd *);static const char *ips_info (struct Scsi_Host *);static irqreturn_t do_ipsintr (int ,void *);static int ips_hainit (ips_ha_t *);
drivers/scsi/megaraid.c +1 -1
@@ -4458,7 +4458,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) scb->idx =CMDID_INT_CMDS ; -megaraid_queue (scmd, mega_internal_done); +megaraid_queue_lck (scmd, mega_internal_done);wait_for_completion (&adapter->int_waitq);
drivers/scsi/megaraid.h +1 -1
@@ -987,7 +987,7 @@ static int mega_query_adapter(adapter_t *);static int issue_scb (adapter_t *,scb_t *);static int mega_setup_mailbox (adapter_t *); -static int megaraid_queue (Scsi_Cmnd *,void (*)(Scsi_Cmnd *)); +static int megaraid_queue (struct Scsi_Host *,struct scsi_cmnd *);static scb_t *mega_build_cmd (adapter_t *,Scsi_Cmnd *,int *);static void __mega_runpendq (adapter_t *);static int issue_scb_block (adapter_t *,u_char *);
drivers/scsi/megaraid/megaraid_mbox.c +1 -2
@@ -113,8 +113,7 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *);static void megaraid_mbox_display_scb (adapter_t *,scb_t *);static void megaraid_mbox_setup_device_map (adapter_t *); -static int megaraid_queue_command (struct scsi_cmnd *, -void (*)(struct scsi_cmnd *)); +static int megaraid_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static scb_t *megaraid_mbox_build_cmd (adapter_t *,struct scsi_cmnd *,int *);static void megaraid_mbox_runpendq (adapter_t *,scb_t *); static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *,
drivers/scsi/nsp32.c +1 -2
@@ -196,8 +196,7 @@ static void __exit exit_nsp32 (void);static int nsp32_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int nsp32_detect (struct pci_dev *pdev); -static int nsp32_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int nsp32_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static const char *nsp32_info (struct Scsi_Host *);static int nsp32_release (struct Scsi_Host *);
drivers/scsi/pas16.h +1 -1
@@ -118,7 +118,7 @@ static int pas16_abort(Scsi_Cmnd *);static int pas16_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int pas16_detect (struct scsi_host_template *); -static int pas16_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int pas16_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int pas16_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/pcmcia/nsp_cs.h +1 -2
@@ -299,8 +299,7 @@ static int nsp_proc_info (off_t offset, int length, int inout); -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, -void (* done)(struct scsi_cmnd *SCpnt)); +static int nsp_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *SCpnt);/* Error handler */ /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
drivers/scsi/qla2xxx/qla_os.c +1 -2
@@ -179,8 +179,7 @@ static int qla2xxx_slave_alloc(struct scsi_device *);static int qla2xxx_scan_finished (struct Scsi_Host *,unsigned long time);static void qla2xxx_scan_start (struct Scsi_Host *);static void qla2xxx_slave_destroy (struct scsi_device *); -static int qla2xxx_queuecommand (struct scsi_cmnd *cmd, -void (*fn)(struct scsi_cmnd *)); +static int qla2xxx_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int qla2xxx_eh_abort (struct scsi_cmnd *);static int qla2xxx_eh_device_reset (struct scsi_cmnd *);static int qla2xxx_eh_target_reset (struct scsi_cmnd *);
drivers/scsi/qla4xxx/ql4_os.c +1 -2
@@ -79,8 +79,7 @@ static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc);/* * SCSI host template entry points */ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, -void (*done) (struct scsi_cmnd *)); +static int qla4xxx_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int qla4xxx_eh_abort (struct scsi_cmnd *cmd);static int qla4xxx_eh_device_reset (struct scsi_cmnd *cmd);static int qla4xxx_eh_target_reset (struct scsi_cmnd *cmd);
drivers/scsi/qlogicfas408.h +1 -2
@@ -103,8 +103,7 @@ struct qlogicfas408_priv {#define get_priv_by_host (x) (struct qlogicfas408_priv *)&((x)->hostdata[0])irqreturn_t qlogicfas408_ihandl (int irq,void *dev_id); -int qlogicfas408_queuecommand (struct scsi_cmnd * cmd, -void (*done) (struct scsi_cmnd *)); +int qlogicfas408_queuecommand (struct Scsi_Host *h,struct scsi_cmnd * cmd);int qlogicfas408_biosparam (struct scsi_device * disk,struct block_device *dev,sector_t capacity,int ip[]);
drivers/scsi/scsi.c +2 -1
@@ -742,7 +742,8 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)scsi_done (cmd); }else {trace_scsi_dispatch_cmd_start (cmd); - rtn = host->hostt->queuecommand (cmd, scsi_done); + cmd->scsi_done = scsi_done; + rtn = host->hostt->queuecommand (host, cmd); }if (rtn) {
drivers/scsi/scsi_error.c +2 -1
@@ -788,7 +788,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, shost->eh_action = &done;scsi_log_send (scmd); - shost->hostt->queuecommand (scmd, scsi_eh_done); + scmd->scsi_done = scsi_eh_done; + shost->hostt->queuecommand (shost, scmd); timeleft =wait_for_completion_timeout (&done, timeout);
drivers/scsi/sun3_scsi.h +1 -2
@@ -51,8 +51,7 @@ static int sun3scsi_abort(struct scsi_cmnd *);static int sun3scsi_detect (struct scsi_host_template *);static const char *sun3scsi_info (struct Scsi_Host *);static int sun3scsi_bus_reset (struct scsi_cmnd *); -static int sun3scsi_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int sun3scsi_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int sun3scsi_release (struct Scsi_Host *);#ifndef CMD_PER_LUN
drivers/scsi/sym53c416.h +1 -1
@@ -25,7 +25,7 @@static int sym53c416_detect (struct scsi_host_template *);static const char *sym53c416_info (struct Scsi_Host *);static int sym53c416_release (struct Scsi_Host *); -static int sym53c416_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int sym53c416_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int sym53c416_host_reset (Scsi_Cmnd *);static int sym53c416_bios_param (struct scsi_device *,struct block_device *,sector_t ,int *);
drivers/scsi/t128.h +1 -2
@@ -96,8 +96,7 @@ static int t128_abort(struct scsi_cmnd *);static int t128_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int t128_detect (struct scsi_host_template *); -static int t128_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int t128_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int t128_bus_reset (struct scsi_cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/u14-34f.c +1 -1
@@ -433,7 +433,7 @@static int u14_34f_detect (struct scsi_host_template *);static int u14_34f_release (struct Scsi_Host *); -static int u14_34f_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +static int u14_34f_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int u14_34f_eh_abort (struct scsi_cmnd *);static int u14_34f_eh_host_reset (struct scsi_cmnd *); static int u14_34f_bios_param(struct scsi_device *, struct block_device *,
drivers/scsi/ultrastor.h +1 -2
@@ -15,8 +15,7 @@static int ultrastor_detect (struct scsi_host_template *);static const char *ultrastor_info (struct Scsi_Host *shpnt); -static int ultrastor_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int ultrastor_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int ultrastor_abort (struct scsi_cmnd *);static int ultrastor_host_reset (struct scsi_cmnd *); static int ultrastor_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/wd33c93.h +1 -2
@@ -343,8 +343,7 @@ struct WD33C93_hostdata {void wd33c93_init (struct Scsi_Host *instance,const wd33c93_regs regs,dma_setup_t setup,dma_stop_t stop,int clock_freq);int wd33c93_abort (struct scsi_cmnd *cmd); -int wd33c93_queuecommand (struct scsi_cmnd *cmd, -void (*done)(struct scsi_cmnd *)); +int wd33c93_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);void wd33c93_intr (struct Scsi_Host *instance);int wd33c93_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );int wd33c93_host_reset (struct scsi_cmnd *);
drivers/staging/hv/storvsc_drv.c +1 -2
@@ -72,8 +72,7 @@ struct storvsc_driver_context {/* Static decl */ static int storvsc_probe (struct device *dev); -static int storvsc_queuecommand (struct scsi_cmnd *scmnd, -void (*done)(struct scsi_cmnd *)); +static int storvsc_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *scmnd);static int storvsc_device_alloc (struct scsi_device *);static int storvsc_device_configure (struct scsi_device *);static int storvsc_host_reset_handler (struct scsi_cmnd *scmnd);
drivers/usb/image/microtek.c +1 -1
@@ -364,7 +364,7 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb) }static int -mts_scsi_queuecommand (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback); +mts_scsi_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *srb);static void mts_transfer_cleanup (struct urb *transfer );static void mts_do_sg (struct urb * transfer);
include/linux/libata.h +1 -1
@@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, unsigned long, struct ata_port_operations *);extern int ata_scsi_detect (struct scsi_host_template *sht);extern int ata_scsi_ioctl (struct scsi_device *dev,int cmd,void __user *arg); -extern int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)); +extern int ata_scsi_queuecmd (struct Scsi_Host *h,struct scsi_cmnd *cmd);extern int ata_sas_scsi_ioctl (struct ata_port *ap,struct scsi_device *dev,int cmd,void __user *arg);extern void ata_sas_port_destroy (struct ata_port *);
include/scsi/libfc.h +1 -2
@@ -1006,8 +1006,7 @@ void fc_fcp_destroy(struct fc_lport *);/* * SCSI INTERACTION LAYER *****************************/ -int fc_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +int fc_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int fc_eh_abort (struct scsi_cmnd *);int fc_eh_device_reset (struct scsi_cmnd *);int fc_eh_host_reset (struct scsi_cmnd *);
include/scsi/libiscsi.h +1 -2
@@ -341,8 +341,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);extern int iscsi_eh_recover_target (struct scsi_cmnd *sc);extern int iscsi_eh_session_reset (struct scsi_cmnd *sc);extern int iscsi_eh_device_reset (struct scsi_cmnd *sc); -extern int iscsi_queuecommand (struct scsi_cmnd *sc, -void (*done)(struct scsi_cmnd *)); +extern int iscsi_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *sc);/* * iSCSI host helpers.
include/scsi/libsas.h +1 -2
@@ -621,8 +621,7 @@ int sas_set_phy_speed(struct sas_phy *phy,int sas_phy_enable (struct sas_phy *phy,int enabled);int sas_phy_reset (struct sas_phy *phy,int hard_reset);int sas_queue_up (struct sas_task *task); -extern int sas_queuecommand (struct scsi_cmnd *, -void (*scsi_done)(struct scsi_cmnd *)); +extern int sas_queuecommand (struct Scsi_Host * ,struct scsi_cmnd *);extern int sas_target_alloc (struct scsi_target *);extern int sas_slave_alloc (struct scsi_device *);extern int sas_slave_configure (struct scsi_device *);
include/scsi/scsi_host.h +3 -6
@@ -127,8 +127,7 @@ struct scsi_host_template {* * STATUS: REQUIRED */ -int (* queuecommand)(struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +int (* queuecommand)(struct Scsi_Host *,struct scsi_cmnd *);/* * The transfer functions are used to queue a scsi command to
@@ -511,15 +510,13 @@ struct scsi_host_template {* */ #define DEF_SCSI_QCMD (func_name) \ - int func_name(struct scsi_cmnd *cmd, \ - void (*done)(struct scsi_cmnd *)) \ + int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ { \ unsigned long irq_flags; \ int rc; \ - struct Scsi_Host *shost = cmd->device->host; \ spin_lock_irqsave(shost->host_lock, irq_flags); \ scsi_cmd_get_serial(shost, cmd); \ - rc = func_name##_lck (cmd, done); \ + rc = func_name##_lck (cmd, cmd->scsi_done); \ spin_unlock_irqrestore(shost->host_lock, irq_flags); \ return rc; \ }
Quoted 2 lines · Jeff Garzik
It is basically your incremental patch + fas216 deadlock fix + several more prototype fixes.
oh and removed some dead code from atari_scsi that became dead-and-incorrect code.
PATCH v4 1/1 SCSI host lock push-down
In reply to Linus TorvaldsQuoted 10 lines · Linus Torvalds
And the patch would look 100% the same, except for these three small one-liner changes:
- the additional one-liner change to the 'queuecommand' function
pointer description itself
- the one-liner change to the actual call-site (which would now not
just drop the lock, it would pass in the extra argument)
-DEF_SCSI_QCMD()would drop the "structScsi_Host*shost = .." line,
and instead just take the new argumentIt wouldn't change the patch wrt any of the low-level drivers at all.
Except for a load of prototypes that need changing, and a few internal driver direct-calls to their queuecommand. :)
Quoted 1 line
But it would add so much inherent safety against mistakes.
Yes.
The patch below builds on allmodconfig i386 and x86_64, and libata works.
I also grepped for each function listed in .queuecommand, and caught some non-x86 prototypes and direct-calls that wanted changing. However, some non-Intel driver breakage may remain that I did not find.
Having done this, it certainly seems like a better change in two ways:
* compile breaks, if you haven't converted (as discussed, this is a feature)
* it is rather nice to have Scsi_Host passed to queuecommand, as drivers and callsites often want Scsi_Host* anyway.
-----------------------------------------------------------------------------
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.
Minimal code disturbance was attempted with this change. Most drivers needed only two one-line modifications for their host lock push-down.
--- arch/ia64/hp/sim/simscsi.c | 4 +++- drivers/ata/libata-scsi.c | 4 +++- drivers/block/cciss_scsi.c | 8 +++++--- drivers/firewire/sbp2.c | 4 +++- drivers/infiniband/ulp/srp/ib_srp.c | 4 +++- drivers/message/fusion/mptfc.c | 6 ++++-- drivers/message/fusion/mptsas.c | 4 +++- drivers/message/fusion/mptspi.c | 4 +++- drivers/message/i2o/i2o_scsi.c | 6 ++++-- drivers/s390/scsi/zfcp_scsi.c | 4 +++- drivers/scsi/3w-9xxx.c | 4 +++- drivers/scsi/3w-sas.c | 4 +++- drivers/scsi/3w-xxxx.c | 4 +++- drivers/scsi/53c700.c | 8 +++++--- drivers/scsi/BusLogic.c | 3 ++- drivers/scsi/BusLogic.h | 2 +- drivers/scsi/NCR5380.c | 3 ++- drivers/scsi/NCR5380.h | 2 +- drivers/scsi/NCR53c406a.c | 4 +++- drivers/scsi/a100u2w.c | 4 +++- drivers/scsi/aacraid/linit.c | 4 +++- drivers/scsi/advansys.c | 4 +++- drivers/scsi/aha152x.c | 4 +++- drivers/scsi/aha1542.c | 4 +++- drivers/scsi/aha1542.h | 2 +- drivers/scsi/aha1740.c | 4 +++- drivers/scsi/aic7xxx/aic79xx_osm.c | 4 +++- drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 +++- drivers/scsi/aic7xxx_old.c | 4 +++- drivers/scsi/arcmsr/arcmsr_hba.c | 6 ++++-- drivers/scsi/arm/acornscsi.c | 4 +++- drivers/scsi/arm/fas216.c | 10 +++++++--- drivers/scsi/arm/fas216.h | 8 ++++---- drivers/scsi/atari_NCR5380.c | 4 +++- drivers/scsi/atari_scsi.c | 2 +- drivers/scsi/atp870u.c | 4 +++- drivers/scsi/bfa/bfad_im.c | 6 ++++-- drivers/scsi/dc395x.c | 3 ++- drivers/scsi/dpt_i2o.c | 4 +++- drivers/scsi/dpti.h | 2 +- drivers/scsi/dtc.h | 2 +- drivers/scsi/eata.c | 6 ++++-- drivers/scsi/eata_pio.c | 4 +++- drivers/scsi/esp_scsi.c | 4 +++- drivers/scsi/fd_mcs.c | 4 +++- drivers/scsi/fdomain.c | 4 +++- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_scsi.c | 4 +++- drivers/scsi/g_NCR5380.h | 2 +- drivers/scsi/gdth.c | 6 ++++-- drivers/scsi/hpsa.c | 6 ++++-- drivers/scsi/hptiop.c | 4 +++- drivers/scsi/ibmmca.c | 6 ++++-- drivers/scsi/ibmvscsi/ibmvfc.c | 4 +++- drivers/scsi/ibmvscsi/ibmvscsi.c | 4 +++- drivers/scsi/imm.c | 4 +++- drivers/scsi/in2000.c | 4 +++- drivers/scsi/in2000.h | 2 +- drivers/scsi/initio.c | 4 +++- drivers/scsi/ipr.c | 4 +++- drivers/scsi/ips.c | 6 ++++-- drivers/scsi/libfc/fc_fcp.c | 4 +++- drivers/scsi/libiscsi.c | 4 +++- drivers/scsi/libsas/sas_scsi_host.c | 4 +++- drivers/scsi/lpfc/lpfc_scsi.c | 4 +++- drivers/scsi/mac53c94.c | 4 +++- drivers/scsi/megaraid.c | 6 ++++-- drivers/scsi/megaraid.h | 2 +- drivers/scsi/megaraid/megaraid_mbox.c | 6 ++++-- drivers/scsi/megaraid/megaraid_sas.c | 4 +++- drivers/scsi/mesh.c | 4 +++- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 4 +++- drivers/scsi/ncr53c8xx.c | 4 +++- drivers/scsi/nsp32.c | 6 ++++-- drivers/scsi/pas16.h | 2 +- drivers/scsi/pcmcia/nsp_cs.c | 4 +++- drivers/scsi/pcmcia/nsp_cs.h | 2 +- drivers/scsi/pcmcia/sym53c500_cs.c | 4 +++- drivers/scsi/pmcraid.c | 4 +++- drivers/scsi/ppa.c | 4 +++- drivers/scsi/ps3rom.c | 4 +++- drivers/scsi/qla1280.c | 4 +++- drivers/scsi/qla2xxx/qla_os.c | 6 ++++-- drivers/scsi/qla4xxx/ql4_os.c | 6 ++++-- drivers/scsi/qlogicfas408.c | 4 +++- drivers/scsi/qlogicfas408.h | 2 +- drivers/scsi/qlogicpti.c | 4 +++- drivers/scsi/scsi.c | 17 ++++------------- drivers/scsi/scsi_debug.c | 4 +++- drivers/scsi/scsi_error.c | 5 +---- drivers/scsi/stex.c | 4 +++- drivers/scsi/sun3_NCR5380.c | 4 +++- drivers/scsi/sun3_scsi.h | 2 +- drivers/scsi/sym53c416.c | 4 +++- drivers/scsi/sym53c416.h | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +++- drivers/scsi/t128.h | 2 +- drivers/scsi/tmscsim.c | 4 +++- drivers/scsi/u14-34f.c | 6 ++++-- drivers/scsi/ultrastor.c | 4 +++- drivers/scsi/ultrastor.h | 2 +- drivers/scsi/vmw_pvscsi.c | 4 +++- drivers/scsi/wd33c93.c | 6 ++++-- drivers/scsi/wd33c93.h | 2 +- drivers/scsi/wd7000.c | 4 +++- drivers/staging/hv/storvsc_drv.c | 6 ++++-- drivers/staging/keucr/scsiglue.c | 4 +++- drivers/usb/image/microtek.c | 6 ++++-- drivers/usb/storage/scsiglue.c | 4 +++- drivers/usb/storage/uas.c | 4 +++- include/linux/libata.h | 2 +- include/scsi/libfc.h | 2 +- include/scsi/libiscsi.h | 2 +- include/scsi/libsas.h | 2 +- include/scsi/scsi_host.h | 17 ++++++++++++++++- 115 files changed, 337 insertions(+), 157 deletions(-)
arch/ia64/hp/sim/simscsi.c +3 -1
@@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) }static int -simscsi_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +simscsi_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {unsigned int target_id = sc->device->id;char fname[MAX_ROOT_LEN +16 ];
@@ -326,6 +326,8 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (simscsi_queuecommand) + static intsimscsi_host_reset (struct scsi_cmnd *sc) {
drivers/ata/libata-scsi.c +3 -1
@@ -3183,7 +3183,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,* Return value from __ata_scsi_queuecmd() if @cmd can be queued, * 0 otherwise. */ -int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int ata_scsi_queuecmd_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ata_port *ap;struct ata_device *dev;
@@ -3211,6 +3211,8 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return rc; } +DEF_SCSI_QCMD (ata_scsi_queuecmd) +/** * ata_scsi_simulate - simulate SCSI command on ATA device * @dev: the target device
drivers/block/cciss_scsi.c +5 -3
@@ -62,8 +62,8 @@ static int cciss_scsi_proc_info(int length,/* length of data in buffer */ int func); /* 0 == read, 1 == write */ -static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, -void (* done)(struct scsi_cmnd *)); +static int cciss_scsi_queue_command (struct Scsi_Host *shost, +struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *));static int cciss_eh_device_reset_handler (struct scsi_cmnd *);static int cciss_eh_abort_handler (struct scsi_cmnd *);
@@ -1406,7 +1406,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c,static int -cciss_scsi_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +cciss_scsi_queue_command_lck (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {ctlr_info_t *h;int rc;
@@ -1504,6 +1504,8 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (cciss_scsi_queue_command) + static void cciss_unregister_scsi(ctlr_info_t *h) {struct cciss_scsi_adapter_data_t *sa;
drivers/firewire/sbp2.c +3 -1
@@ -1468,7 +1468,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb,/* SCSI stack integration */ -static int sbp2_scsi_queuecommand (struct scsi_cmnd *cmd,scsi_done_fn_t done) +static int sbp2_scsi_queuecommand_lck (struct scsi_cmnd *cmd,scsi_done_fn_t done) {struct sbp2_logical_unit *lu = cmd->device->hostdata;struct fw_device *device =target_device (lu->tgt);
@@ -1534,6 +1534,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)return retval; } +static DEF_SCSI_QCMD (sbp2_scsi_queuecommand) + static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) {struct sbp2_logical_unit *lu = sdev->hostdata;
drivers/infiniband/ulp/srp/ib_srp.c +3 -1
@@ -1123,7 +1123,7 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr) } } -static int srp_queuecommand (struct scsi_cmnd *scmnd, +static int srp_queuecommand_lck (struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *)) {struct srp_target_port *target =host_to_target (scmnd->device->host);
@@ -1196,6 +1196,8 @@ err:return SCSI_MLQUEUE_HOST_BUSY ; } +static DEF_SCSI_QCMD (srp_queuecommand) + static int srp_alloc_iu_bufs(struct srp_target_port *target) {int i;
drivers/message/fusion/mptfc.c +4 -2
@@ -97,7 +97,7 @@ static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;static int mptfc_target_alloc (struct scsi_target *starget);static int mptfc_slave_alloc (struct scsi_device *sdev); -static int mptfc_qcmd (struct scsi_cmnd *SCpnt, +static int mptfc_qcmd (struct Scsi_Host *shost,struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *));static void mptfc_target_destroy (struct scsi_target *starget);static void mptfc_set_rport_loss_tmo (struct fc_rport *rport,uint32_t timeout);
@@ -650,7 +650,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) }static int -mptfc_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptfc_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {struct mptfc_rport_info *ri;struct fc_rport *rport =starget_to_rport (scsi_target (SCpnt->device));
@@ -681,6 +681,8 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptfc_qcmd) +/* * mptfc_display_port_link_speed - displaying link speed * @ioc: Pointer to MPT_ADAPTER structure
drivers/message/fusion/mptsas.c +3 -1
@@ -1889,7 +1889,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) }static int -mptsas_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptsas_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {MPT_SCSI_HOST *hd;MPT_ADAPTER *ioc;
@@ -1913,6 +1913,8 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptsas_qcmd) +/** * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout * if the device under question is currently in the
drivers/message/fusion/mptspi.c +3 -1
@@ -780,7 +780,7 @@ static int mptspi_slave_configure(struct scsi_device *sdev) }static int -mptspi_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptspi_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {struct _MPT_SCSI_HOST *hd =shost_priv (SCpnt->device->host);VirtDevice *vdevice = SCpnt->device->hostdata;
@@ -805,6 +805,8 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptspi_qcmd) + static void mptspi_slave_destroy(struct scsi_device *sdev) {struct scsi_target *starget =scsi_target (sdev);
drivers/message/i2o/i2o_scsi.c +4 -2
@@ -506,7 +506,7 @@ static struct i2o_driver i2o_scsi_driver = {* Locks: takes the controller lock on error path only */ -static int i2o_scsi_queuecommand (struct scsi_cmnd *SCpnt, +static int i2o_scsi_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct i2o_controller *c;
@@ -688,7 +688,9 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, exit:return rc; -}; +} + +static DEF_SCSI_QCMD (i2o_scsi_queuecommand)/** * i2o_scsi_abort - abort a running command
drivers/s390/scsi/zfcp_scsi.c +3 -1
@@ -76,7 +76,7 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) scpnt->scsi_done (scpnt); } -static int zfcp_scsi_queuecommand (struct scsi_cmnd *scpnt, +static int zfcp_scsi_queuecommand_lck (struct scsi_cmnd *scpnt,void (*done) (struct scsi_cmnd *)) {struct zfcp_scsi_dev *zfcp_sdev =sdev_to_zfcp (scpnt->device);
@@ -127,6 +127,8 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,return ret; } +static DEF_SCSI_QCMD (zfcp_scsi_queuecommand) + static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) {struct fc_rport *rport =starget_to_rport (scsi_target (sdev));
drivers/scsi/3w-9xxx.c +3 -1
@@ -1765,7 +1765,7 @@ out: }/* End twa_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twa_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int twa_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int request_id, retval;TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@@ -1812,6 +1812,8 @@ out:return retval; }/* End twa_scsi_queue() */ +static DEF_SCSI_QCMD (twa_scsi_queue) +/* This function hands scsi cdb's to the firmware */ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg) {
drivers/scsi/3w-sas.c +3 -1
@@ -1501,7 +1501,7 @@ out: }/* End twl_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twl_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int twl_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int request_id, retval;TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@@ -1536,6 +1536,8 @@ out:return retval; }/* End twl_scsi_queue() */ +static DEF_SCSI_QCMD (twl_scsi_queue) +/* This function tells the controller to shut down */ static void __twl_shutdown(TW_Device_Extension *tw_dev) {
drivers/scsi/3w-xxxx.c +3 -1
@@ -1947,7 +1947,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r }/* End tw_scsiop_test_unit_ready_complete() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int tw_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int tw_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {unsigned char *command = SCpnt->cmnd;int request_id =0 ;
@@ -2023,6 +2023,8 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmndreturn retval; }/* End tw_scsi_queue() */ +static DEF_SCSI_QCMD (tw_scsi_queue) +/* This function is the interrupt service routine */ static irqreturn_t tw_interrupt(int irq, void *dev_instance) {
drivers/scsi/53c700.c +5 -3
@@ -167,7 +167,7 @@ MODULE_LICENSE("GPL");#include "53c700_d.h" -STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); +STATIC int NCR_700_queuecommand(struct Scsi_Host *, struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
@@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id)return IRQ_RETVAL (handled); } -STATIC int -NCR_700_queuecommand (struct scsi_cmnd *SCp,void (*done)(struct scsi_cmnd *)) +static int +NCR_700_queuecommand_lck (struct scsi_cmnd *SCp,void (*done)(struct scsi_cmnd *)) {struct NCR_700_Host_Parameters *hostdata = (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 *))return 0 ; } +STATIC DEF_SCSI_QCMD (NCR_700_queuecommand ) +STATIC int NCR_700_abort(struct scsi_cmnd * SCp) {
drivers/scsi/BusLogic.c +2 -1
@@ -2807,7 +2807,7 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt)Outgoing Mailbox for execution by the associated Host Adapter. */ -static int BusLogic_QueueCommand (struct scsi_cmnd *Command,void (*CompletionRoutine) (struct scsi_cmnd *)) +static int BusLogic_QueueCommand_lck (struct scsi_cmnd *Command,void (*CompletionRoutine) (struct scsi_cmnd *)) {struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata;struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id];
@@ -2994,6 +2994,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoureturn 0 ; } +static DEF_SCSI_QCMD(BusLogic_QueueCommand)#if 0 /*
drivers/scsi/BusLogic.h +1 -1
@@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co*/ static const char *BusLogic_DriverInfo (struct Scsi_Host *); -static int BusLogic_QueueCommand (struct scsi_cmnd *,void (*CompletionRoutine) (struct scsi_cmnd *)); +static int BusLogic_QueueCommand (struct Scsi_Host *,struct scsi_cmnd *,void (*CompletionRoutine) (struct scsi_cmnd *));static int BusLogic_BIOSDiskParameters (struct scsi_device *,struct block_device *,sector_t ,int *);static int BusLogic_ProcDirectoryInfo (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int BusLogic_SlaveConfigure (struct scsi_device *);
drivers/scsi/NCR5380.c +2 -1
@@ -952,7 +952,7 @@ static void NCR5380_exit(struct Scsi_Host *instance)* Locks: host lock taken by caller */ -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int NCR5380_queue_command_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *instance = cmd->device->host;struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@@ -1021,6 +1021,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command)/** * NCR5380_main - NCR state machines
drivers/scsi/NCR5380.h +1 -1
@@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance);#endif static int NCR5380_abort (Scsi_Cmnd * cmd);static int NCR5380_bus_reset (Scsi_Cmnd * cmd); -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)); +static int NCR5380_queue_command (struct Scsi_Host *shost,Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *));static int __maybe_unused NCR5380_proc_info (struct Scsi_Host *instance,char *buffer,char **start,off_t offset,int length,int inout);
drivers/scsi/NCR53c406a.c +3 -1
@@ -693,7 +693,7 @@ static void wait_intr(void) }#endif -static int NCR53c406a_queue (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int NCR53c406a_queue_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {int i;
@@ -726,6 +726,8 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR53c406a_queue) + static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) {DEB (printk ("NCR53c406a_reset called\n" ));
drivers/scsi/a100u2w.c +3 -1
@@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc* queue the command down to the controller */ -static int inia100_queue (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) +static int inia100_queue_lck (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) {struct orc_scb *scb;struct orc_host *host;/* Point to Host adapter control block */
@@ -930,6 +930,8 @@ static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (inia100_queue) +/***************************************************************************** Function name : inia100_abort Description : Abort a queued command.
drivers/scsi/aacraid/linit.c +3 -1
@@ -248,7 +248,7 @@ static struct aac_driver_ident aac_drivers[] = {* TODO: unify with aac_scsi_cmd(). */ -static int aac_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int aac_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct aac_dev *dev = (struct aac_dev *)host->hostdata;
@@ -267,6 +267,8 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmndreturn (aac_scsi_cmd (cmd) ?FAILED :0 ); } +static DEF_SCSI_QCMD (aac_queuecommand) +/** * aac_info - Returns the host adapter name * @shost: Scsi host to report on
drivers/scsi/advansys.c +3 -1
@@ -9500,7 +9500,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)* in the 'scp' result field. */ static int -advansys_queuecommand (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) +advansys_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *shost = scp->device->host;int asc_res, result =0 ;
@@ -9525,6 +9525,8 @@ advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))return result; } +static DEF_SCSI_QCMD (advansys_queuecommand) + static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) { PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
drivers/scsi/aha152x.c +3 -1
@@ -1056,7 +1056,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,* queue a command * */ -static int aha152x_queue (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +static int aha152x_queue_lck (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) {#if 0 if (*SCpnt->cmnd ==REQUEST_SENSE ) {
@@ -1070,6 +1070,8 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))return aha152x_internal_queue (SCpnt,NULL ,0 , done); } +static DEF_SCSI_QCMD (aha152x_queue) +/* *
drivers/scsi/aha1542.c +3 -1
@@ -558,7 +558,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) }; } -static int aha1542_queuecommand (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int aha1542_queuecommand_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {unchar ahacmd =CMD_START_SCSI ;unchar direction;
@@ -718,6 +718,8 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (aha1542_queuecommand) +/* Initialize mailboxes */ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) {
drivers/scsi/aha1542.h +1 -1
@@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */ };static int aha1542_detect (struct scsi_host_template *); -static int aha1542_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int aha1542_queuecommand (struct Scsi_Host *,Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));static int aha1542_bus_reset (Scsi_Cmnd * SCpnt);static int aha1542_dev_reset (Scsi_Cmnd * SCpnt);static int aha1542_host_reset (Scsi_Cmnd * SCpnt);
drivers/scsi/aha1740.c +3 -1
@@ -331,7 +331,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)return IRQ_RETVAL (handled); } -static int aha1740_queuecommand (Scsi_Cmnd * SCpnt,void (*done)(Scsi_Cmnd *)) +static int aha1740_queuecommand_lck (Scsi_Cmnd * SCpnt,void (*done)(Scsi_Cmnd *)) {unchar direction;unchar *cmd = (unchar *) SCpnt->cmnd;
@@ -503,6 +503,8 @@ static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (aha1740_queuecommand) +/* Query the board for its irq_level and irq_type. Nothing else matters in enhanced mode on an EISA bus. */
drivers/scsi/aic7xxx/aic79xx_osm.c +3 -1
@@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host)* Queue an SCB to the controller. */ static int -ahd_linux_queue (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) +ahd_linux_queue_lck (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) {struct ahd_softc *ahd;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 *))return rtn; } +static DEF_SCSI_QCMD (ahd_linux_queue) + static struct scsi_target **ahd_linux_target_in_softc (struct scsi_target *starget) {
drivers/scsi/aic7xxx/aic7xxx_osm.c +3 -1
@@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host)* Queue an SCB to the controller. */ static int -ahc_linux_queue (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) +ahc_linux_queue_lck (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) {struct ahc_softc *ahc;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 *))return rtn; } +static DEF_SCSI_QCMD (ahc_linux_queue) + static inline struct scsi_target **ahc_linux_target_in_softc (struct scsi_target *starget) {
drivers/scsi/aic7xxx_old.c +3 -1
@@ -10234,7 +10234,7 @@ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,* Description: * Queue a SCB to the controller. *-F*************************************************************************/ -static int aic7xxx_queue (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) +static int aic7xxx_queue_lck (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) {struct aic7xxx_host *p;struct aic7xxx_scb *scb;
@@ -10292,6 +10292,8 @@ static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))return (0 ); } +static DEF_SCSI_QCMD (aic7xxx_queue) +/*+F************************************************************************* * Function: * aic7xxx_bus_device_reset
drivers/scsi/arcmsr/arcmsr_hba.c +4 -2
@@ -85,7 +85,7 @@ static int arcmsr_abort(struct scsi_cmnd *);static int arcmsr_bus_reset (struct scsi_cmnd *);static int arcmsr_bios_param (struct scsi_device *sdev,struct block_device *bdev,sector_t capacity,int *info); -static int arcmsr_queue_command (struct scsi_cmnd *cmd, +static int arcmsr_queue_command (struct Scsi_Host *shost,struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *));static int arcmsr_probe (struct pci_dev *pdev,const struct pci_device_id *id);
@@ -2081,7 +2081,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, } } -static int arcmsr_queue_command (struct scsi_cmnd *cmd, +static int arcmsr_queue_command_lck (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;
@@ -2124,6 +2124,8 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (arcmsr_queue_command) + static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) {struct MessageUnit_A __iomem *reg = acb->pmuA;
drivers/scsi/arm/acornscsi.c +3 -1
@@ -2511,7 +2511,7 @@ acornscsi_intr(int irq, void *dev_id)* done - function called on completion, with pointer to command descriptor * Returns : 0, or < 0 on error. */ -int acornscsi_queuecmd (struct scsi_cmnd *SCpnt, +static int acornscsi_queuecmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
@@ -2561,6 +2561,8 @@ int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,return 0 ; } +DEF_SCSI_QCMD (acornscsi_queuecmd) +/* * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2
drivers/scsi/arm/fas216.c +7 -3
@@ -2198,7 +2198,7 @@ no_command:* Returns: 0 on success, else error. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_queue_command (struct scsi_cmnd *SCpnt, +static int fas216_queue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt,return result; } +DEF_SCSI_QCMD (fas216_queue_command) +/** * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command * @SCpnt: Command to wake
@@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)* Returns: scsi result code. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_noqueue_command (struct scsi_cmnd *SCpnt, +static int fas216_noqueue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@@ -2277,7 +2279,7 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,BUG_ON (info->scsi.irq !=NO_IRQ ); info->internal_done =0 ; -fas216_queue_command (SCpnt, fas216_internal_done); +fas216_queue_command (SCpnt->device->host, SCpnt, fas216_internal_done);/* * This wastes time, since we can't return until the command is
@@ -2310,6 +2312,8 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,return 0 ; } +DEF_SCSI_QCMD (fas216_noqueue_command) +/* * Error handler timeout function. Indicate that we timed out, * and wake up any error handler process so it can continue.
drivers/scsi/arm/fas216.h +4 -4
@@ -331,22 +331,22 @@ extern int fas216_init (struct Scsi_Host *instance);*/ extern int fas216_add (struct Scsi_Host *instance,struct device *dev); -/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) * Purpose : queue a command for adapter to process. * Params : SCpnt - Command to queue * done - done function to call once command is complete * Returns : 0 - success, else error */ -extern int fas216_queue_command (struct scsi_cmnd *, +extern int fas216_queue_command (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); -/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_noqueue_command(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) * Purpose : queue a command for adapter to process, and process it to completion. * Params : SCpnt - Command to queue * done - done function to call once command is complete * Returns : 0 - success, else error */ -extern int fas216_noqueue_command (struct scsi_cmnd *, +extern int fas216_noqueue_command (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));/* Function: irqreturn_t fas216_intr (FAS216_Info *info)
drivers/scsi/atari_NCR5380.c +3 -1
@@ -910,7 +910,7 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)* */ -static int NCR5380_queue_command (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) +static int NCR5380_queue_command_lck (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) {SETUP_HOSTDATA (cmd->device->host);Scsi_Cmnd *tmp;
@@ -1022,6 +1022,8 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command) +/* * Function : NCR5380_main (void) *
drivers/scsi/atari_scsi.c +1 -1
@@ -584,7 +584,7 @@ int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))* ++guenther: moved to NCR5380_queue_command() to prevent * race condition, see there for an explanation. */ - return NCR5380_queue_command(cmd, done); + return NCR5380_queue_command(cmd->device->host, cmd, done); }#endif
drivers/scsi/atp870u.c +3 -1
@@ -605,7 +605,7 @@ handled:* * Queue a command to the ATP queue. Called with the host lock held. */ -static int atp870u_queuecommand (struct scsi_cmnd * req_p, +static int atp870u_queuecommand_lck (struct scsi_cmnd * req_p,void (*done) (struct scsi_cmnd *)) {unsigned char c;
@@ -694,6 +694,8 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,return 0 ; } +static DEF_SCSI_QCMD (atp870u_queuecommand) +/** * send_s870 - send a command to the controller * @host: host
drivers/scsi/bfa/bfad_im.c +4 -2
@@ -30,7 +30,7 @@ DEFINE_IDR(bfad_im_port_index);struct scsi_transport_template *bfad_im_scsi_transport_template;struct scsi_transport_template *bfad_im_scsi_vport_transport_template;static void bfad_im_itnim_work_handler (struct work_struct *work); -static int bfad_im_queuecommand (struct scsi_cmnd *cmnd, +static int bfad_im_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *cmnd,void (*done)(struct scsi_cmnd *));static int bfad_im_slave_alloc (struct scsi_device *sdev); static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port,
@@ -1120,7 +1120,7 @@ bfad_im_itnim_work_handler(struct work_struct *work)* Scsi_Host template entry, queue a SCSI command to the BFAD. */ static int -bfad_im_queuecommand (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) +bfad_im_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) cmnd->device->host->hostdata[0 ];
@@ -1187,6 +1187,8 @@ out_fail_cmd:return 0 ; } +static DEF_SCSI_QCMD (bfad_im_queuecommand) + voidbfad_os_rport_online_wait (struct bfad_s *bfad) {
drivers/scsi/dc395x.c +2 -1
@@ -1080,7 +1080,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,* and is expected to be held on return. * **/ -static int dc395x_queue_command (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int dc395x_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct DeviceCtlBlk *dcb;struct ScsiReqBlk *srb;
@@ -1154,6 +1154,7 @@ complete:return 0 ; } +static DEF_SCSI_QCMD (dc395x_queue_command)/* * Return the disk geometry for the given SCSI device.
drivers/scsi/dpt_i2o.c +3 -1
@@ -423,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device)return 0 ; } -static int adpt_queue (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) +static int adpt_queue_lck (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) {adpt_hba * pHba =NULL ;struct adpt_device * pDev =NULL ;/* dpt per device information */
@@ -491,6 +491,8 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))return adpt_scsi_to_i2o (pHba, cmd, pDev); } +static DEF_SCSI_QCMD (adpt_queue) + static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev,sector_t capacity,int geom[]) {
drivers/scsi/dpti.h +1 -1
@@ -29,7 +29,7 @@*/ static int adpt_detect (struct scsi_host_template * sht); -static int adpt_queue (struct scsi_cmnd * cmd,void (*cmdcomplete) (struct scsi_cmnd *)); +static int adpt_queue (struct Scsi_Host * shost,struct scsi_cmnd * cmd,void (*cmdcomplete) (struct scsi_cmnd *));static int adpt_abort (struct scsi_cmnd * cmd);static int adpt_reset (struct scsi_cmnd * cmd);static int adpt_release (struct Scsi_Host *host);
drivers/scsi/dtc.h +1 -1
@@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *);static int dtc_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int dtc_detect (struct scsi_host_template *); -static int dtc_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int dtc_queue_command (struct Scsi_Host *,Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));static int dtc_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/eata.c +4 -2
@@ -505,7 +505,7 @@static int eata2x_detect (struct scsi_host_template *);static int eata2x_release (struct Scsi_Host *); -static int eata2x_queuecommand (struct scsi_cmnd *, +static int eata2x_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*done) (struct scsi_cmnd *));static int eata2x_eh_abort (struct scsi_cmnd *);static int eata2x_eh_host_reset (struct scsi_cmnd *);
@@ -1758,7 +1758,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha) } -static int eata2x_queuecommand (struct scsi_cmnd *SCpnt, +static int eata2x_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct Scsi_Host *shost = SCpnt->device->host;
@@ -1843,6 +1843,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (eata2x_queuecommand) + static int eata2x_eh_abort(struct scsi_cmnd *SCarg) {struct Scsi_Host *shost = SCarg->device->host;
drivers/scsi/eata_pio.c +3 -1
@@ -335,7 +335,7 @@ static inline unsigned int eata_pio_send_command(unsigned long base, unsigned chreturn 0 ; } -static int eata_pio_queue (struct scsi_cmnd *cmd, +static int eata_pio_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {unsigned int x, y;
@@ -438,6 +438,8 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (eata_pio_queue) + static int eata_pio_abort(struct scsi_cmnd *cmd) {unsigned int loop =100 ;
drivers/scsi/esp_scsi.c +3 -1
@@ -916,7 +916,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)scsi_track_queue_full (dev, lp->num_tagged -1 ); } -static int esp_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int esp_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *dev = cmd->device;struct esp *esp =shost_priv (dev->host);
@@ -941,6 +941,8 @@ static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (esp_queuecommand) + static int esp_check_gross_error(struct esp *esp) {if (esp->sreg &ESP_STAT_SPAM ) {
drivers/scsi/fd_mcs.c +3 -1
@@ -1072,7 +1072,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt)return 0 ; } -static int fd_mcs_queue (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int fd_mcs_queue_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *shpnt = SCpnt->device->host;
@@ -1122,6 +1122,8 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD(fd_mcs_queue) +#if DEBUG_ABORT ||DEBUG_RESET static void fd_mcs_print_info (Scsi_Cmnd * SCpnt) {
drivers/scsi/fdomain.c +3 -1
@@ -1419,7 +1419,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int fdomain_16x0_queue (struct scsi_cmnd *SCpnt, +static int fdomain_16x0_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {if (in_command) {
@@ -1469,6 +1469,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD(fdomain_16x0_queue) +#if DEBUG_ABORT static void print_info (struct scsi_cmnd *SCpnt) {
drivers/scsi/fnic/fnic.h +1 -1
@@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *);void fnic_update_mac (struct fc_lport *,u8 *new);void fnic_update_mac_locked (struct fnic *,u8 *new); -int fnic_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +int fnic_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));int fnic_abort_cmd (struct scsi_cmnd *);int fnic_device_reset (struct scsi_cmnd *);int fnic_host_reset (struct scsi_cmnd *);
drivers/scsi/fnic/fnic_scsi.c +3 -1
@@ -349,7 +349,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,* Routine to send a scsi cdb * Called with host_lock held and interrupts disabled. */ -int fnic_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +static int fnic_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {struct fc_lport *lp;struct fc_rport *rport;
@@ -457,6 +457,8 @@ out:return ret; } +DEF_SCSI_QCMD (fnic_queuecommand) +/* * fnic_fcpio_fw_reset_cmpl_handler * Routine to handle fw reset completion
drivers/scsi/g_NCR5380.h +1 -1
@@ -46,7 +46,7 @@static int generic_NCR5380_abort (Scsi_Cmnd *);static int generic_NCR5380_detect (struct scsi_host_template *);static int generic_NCR5380_release_resources (struct Scsi_Host *); -static int generic_NCR5380_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int generic_NCR5380_queue_command (struct Scsi_Host *,Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));static int generic_NCR5380_bus_reset (Scsi_Cmnd *);static const char *generic_NCR5380_info (struct Scsi_Host *);
drivers/scsi/gdth.c +4 -2
@@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);static void gdth_flush (gdth_ha_str *ha); -static int gdth_queuecommand (Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); +static int gdth_queuecommand (struct Scsi_Host *shost,Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));static int __gdth_queuecommand (gdth_ha_str *ha,struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo);static void gdth_scsi_done (struct scsi_cmnd *scp);
@@ -4004,7 +4004,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se } -static int gdth_queuecommand (struct scsi_cmnd *scp, +static int gdth_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {gdth_ha_str *ha =shost_priv (scp->device->host);
@@ -4022,6 +4022,8 @@ static int gdth_queuecommand(struct scsi_cmnd *scp,return __gdth_queuecommand (ha, scp, cmndinfo); } +static DEF_SCSI_QCMD (gdth_queuecommand) + static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo) {
drivers/scsi/hpsa.c +4 -2
@@ -143,7 +143,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h, void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, int cmd_type); -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, +static int hpsa_scsi_queue_command (struct Scsi_Host *shost,struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *));static void hpsa_scan_start (struct Scsi_Host *); static int hpsa_scan_finished(struct Scsi_Host *sh,
@@ -1926,7 +1926,7 @@ sglist_finished: } -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, +static int hpsa_scsi_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ctlr_info *h;
@@ -2020,6 +2020,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (hpsa_scsi_queue_command) + static void hpsa_scan_start(struct Scsi_Host *sh) {struct ctlr_info *h =shost_to_hba (sh);
drivers/scsi/hptiop.c +3 -1
@@ -751,7 +751,7 @@ static void hptiop_post_req_mv(struct hptiop_hba *hba, MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); } -static int hptiop_queuecommand (struct scsi_cmnd *scp, +static int hptiop_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = scp->device->host;
@@ -819,6 +819,8 @@ cmd_done:return 0 ; } +static DEF_SCSI_QCMD (hptiop_queuecommand) + static const char *hptiop_info(struct Scsi_Host *host) {return driver_name_long;
drivers/scsi/ibmmca.c +4 -2
@@ -39,7 +39,7 @@#include <scsi/scsi_host.h> /* Common forward declarations for all Linux-versions: */ -static int ibmmca_queuecommand (Scsi_Cmnd *,void (*done) (Scsi_Cmnd *)); +static int ibmmca_queuecommand (struct Scsi_Host *,Scsi_Cmnd *,void (*done) (Scsi_Cmnd *));static int ibmmca_abort (Scsi_Cmnd *);static int ibmmca_host_reset (Scsi_Cmnd *);static int ibmmca_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);
@@ -1691,7 +1691,7 @@ static int __devexit ibmmca_remove(struct device *dev) }/* The following routine is the SCSI command queue for the midlevel driver */ -static int ibmmca_queuecommand (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int ibmmca_queuecommand_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {unsigned int ldn;unsigned int scsi_cmd;
@@ -1996,6 +1996,8 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (ibmmca_queuecommand) + static int __ibmmca_abort(Scsi_Cmnd * cmd) {/* Abort does not work, as the adapter never generates an interrupt on
drivers/scsi/ibmvscsi/ibmvfc.c +3 -1
@@ -1606,7 +1606,7 @@ static inline int ibmvfc_host_chkready(struct ibmvfc_host *vhost)* Returns: * 0 on success / other on failure **/ -static int ibmvfc_queuecommand (struct scsi_cmnd *cmnd, +static int ibmvfc_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct ibmvfc_host *vhost =shost_priv (cmnd->device->host);
@@ -1672,6 +1672,8 @@ static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd,return 0 ; } +static DEF_SCSI_QCMD (ibmvfc_queuecommand) +/** * ibmvfc_sync_completion - Signal that a synchronous command has completed * @evt: ibmvfc event struct
drivers/scsi/ibmvscsi/ibmvscsi.c +3 -1
@@ -713,7 +713,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev)* @cmd: struct scsi_cmnd to be executed * @done: Callback function to be called when cmd is completed */ -static int ibmvscsi_queuecommand (struct scsi_cmnd *cmnd, +static int ibmvscsi_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct srp_cmd *srp_cmd;
@@ -766,6 +766,8 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,return ibmvscsi_send_srp_event (evt_struct, hostdata,0 ); } +static DEF_SCSI_QCMD (ibmvscsi_queuecommand) +/* ------------------------------------------------------------ * Routines for driver initialization */
drivers/scsi/imm.c +3 -1
@@ -926,7 +926,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)return 0 ; } -static int imm_queuecommand (struct scsi_cmnd *cmd, +static int imm_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {imm_struct *dev =imm_dev (cmd->device->host);
@@ -949,6 +949,8 @@ static int imm_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (imm_queuecommand) +/* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really
drivers/scsi/in2000.c +3 -1
@@ -334,7 +334,7 @@ static uchar calc_sync_xfer(unsigned int period, unsigned int offset)static void in2000_execute (struct Scsi_Host *instance); -static int in2000_queuecommand (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int in2000_queuecommand_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *instance;struct IN2000_hostdata *hostdata;
@@ -431,6 +431,8 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (in2000_queuecommand) +/*
drivers/scsi/in2000.h +1 -1
@@ -396,7 +396,7 @@ struct IN2000_hostdata { flags) static int in2000_detect(struct scsi_host_template *) in2000__INIT; -static int in2000_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int in2000_queuecommand (struct Scsi_Host *,Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));static int in2000_abort (Scsi_Cmnd *); static void in2000_setup(char *, int *) in2000__INIT; static int in2000_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/initio.c +3 -1
@@ -2639,7 +2639,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c* will cause the mid layer to call us again later with the command) */ -static int i91u_queuecommand (struct scsi_cmnd *cmd, +static int i91u_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
@@ -2656,6 +2656,8 @@ static int i91u_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (i91u_queuecommand) +/** * i91u_bus_reset - reset the SCSI bus * @cmnd: Command block we want to trigger the reset for
drivers/scsi/ipr.c +3 -1
@@ -5709,7 +5709,7 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy **/ -static int ipr_queuecommand (struct scsi_cmnd *scsi_cmd, +static int ipr_queuecommand_lck (struct scsi_cmnd *scsi_cmd,void (*done) (struct scsi_cmnd *)) {struct ipr_ioa_cfg *ioa_cfg;
@@ -5792,6 +5792,8 @@ static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd,return 0 ; } +static DEF_SCSI_QCMD (ipr_queuecommand) +/** * ipr_ioctl - IOCTL handler * @sdev: scsi device struct
drivers/scsi/ips.c +4 -2
@@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *);static int ips_release (struct Scsi_Host *);static int ips_eh_abort (struct scsi_cmnd *);static int ips_eh_reset (struct scsi_cmnd *); -static int ips_queue (struct scsi_cmnd *,void (*)(struct scsi_cmnd *)); +static int ips_queue (struct Scsi_Host *,struct scsi_cmnd *,void (*)(struct scsi_cmnd *));static const char *ips_info (struct Scsi_Host *);static irqreturn_t do_ipsintr (int ,void *);static int ips_hainit (ips_ha_t *);
@@ -1046,7 +1046,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC)/* Linux obtains io_request_lock before calling this function */ /* */ /****************************************************************************/ -static int ips_queue (struct scsi_cmnd *SC ,void (*done) (struct scsi_cmnd *)) +static int ips_queue_lck (struct scsi_cmnd *SC ,void (*done) (struct scsi_cmnd *)) {ips_ha_t *ha;ips_passthru_t *pt;
@@ -1137,6 +1137,8 @@ static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))return (0 ); } +static DEF_SCSI_QCMD (ips_queue) +/****************************************************************************/ /* */ /* Routine Name: ips_biosparam */
drivers/scsi/libfc/fc_fcp.c +3 -1
@@ -1753,7 +1753,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport)* This is the i/o strategy routine, called by the SCSI layer. This routine * is called with the host_lock held. */ -int fc_queuecommand (struct scsi_cmnd *sc_cmd,void (*done)(struct scsi_cmnd *)) +static int fc_queuecommand_lck (struct scsi_cmnd *sc_cmd,void (*done)(struct scsi_cmnd *)) {struct fc_lport *lport;struct fc_rport *rport =starget_to_rport (scsi_target (sc_cmd->device));
@@ -1851,6 +1851,8 @@ out:spin_lock_irq (lport->host->host_lock);return rc; } + +DEF_SCSI_QCMD (fc_queuecommand)EXPORT_SYMBOL (fc_queuecommand);/**
drivers/scsi/libiscsi.c +3 -1
@@ -1599,7 +1599,7 @@ enum { FAILURE_SESSION_NOT_READY, }; -int iscsi_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +static int iscsi_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {struct iscsi_cls_session *cls_session;struct Scsi_Host *host;
@@ -1736,6 +1736,8 @@ fault:spin_lock (host->host_lock);return 0 ; } + +DEF_SCSI_QCMD (iscsi_queuecommand)EXPORT_SYMBOL_GPL (iscsi_queuecommand);int iscsi_change_queue_depth (struct scsi_device *sdev,int depth,int reason)
drivers/scsi/libsas/sas_scsi_host.c +3 -1
@@ -189,7 +189,7 @@ int sas_queue_up(struct sas_task *task)* Note: XXX: Remove the host unlock/lock pair when SCSI Core can * call us without holding an IRQ spinlock... */ -int sas_queuecommand(struct scsi_cmnd *cmd, +static int sas_queuecommand_lck(struct scsi_cmnd *cmd, void (*scsi_done)(struct scsi_cmnd *)) __releases(host->host_lock) __acquires(dev->sata_dev.ap->lock)
@@ -254,6 +254,8 @@ out:return res; } +DEF_SCSI_QCMD (sas_queuecommand) + static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) {struct sas_task *task =TO_SAS_TASK (cmd);
drivers/scsi/lpfc/lpfc_scsi.c +3 -1
@@ -2899,7 +2899,7 @@ void lpfc_poll_timeout(unsigned long ptr)* SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. **/ static int -lpfc_queuecommand (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) +lpfc_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct Scsi_Host *shost = cmnd->device->host;struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
@@ -3060,6 +3060,8 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (lpfc_queuecommand) +/** * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point * @cmnd: Pointer to scsi_cmnd data structure.
drivers/scsi/mac53c94.c +3 -1
@@ -66,7 +66,7 @@ static void cmd_done(struct fsc_state *, int result);static void set_dma_cmds (struct fsc_state *,struct scsi_cmnd *); -static int mac53c94_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int mac53c94_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct fsc_state *state;
@@ -99,6 +99,8 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *return 0 ; } +static DEF_SCSI_QCMD (mac53c94_queue) + static int mac53c94_host_reset(struct scsi_cmnd *cmd) {struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata;
drivers/scsi/megaraid.c +4 -2
@@ -366,7 +366,7 @@ mega_runpendq(adapter_t *adapter)* The command queuing entry point for the mid-layer. */ static int -megaraid_queue (Scsi_Cmnd *scmd,void (*done)(Scsi_Cmnd *)) +megaraid_queue_lck (Scsi_Cmnd *scmd,void (*done)(Scsi_Cmnd *)) {adapter_t *adapter;scb_t *scb;
@@ -409,6 +409,8 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))return busy; } +static DEF_SCSI_QCMD (megaraid_queue) +/** * mega_allocate_scb() * @adapter - pointer to our soft state
@@ -4456,7 +4458,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) scb->idx =CMDID_INT_CMDS ; -megaraid_queue (scmd, mega_internal_done); +megaraid_queue (scmd->device->host, scmd, mega_internal_done);wait_for_completion (&adapter->int_waitq);
drivers/scsi/megaraid.h +1 -1
@@ -987,7 +987,7 @@ static int mega_query_adapter(adapter_t *);static int issue_scb (adapter_t *,scb_t *);static int mega_setup_mailbox (adapter_t *); -static int megaraid_queue (Scsi_Cmnd *,void (*)(Scsi_Cmnd *)); +static int megaraid_queue (struct Scsi_Host *,Scsi_Cmnd *,void (*)(Scsi_Cmnd *));static scb_t *mega_build_cmd (adapter_t *,Scsi_Cmnd *,int *);static void __mega_runpendq (adapter_t *);static int issue_scb_block (adapter_t *,u_char *);
drivers/scsi/megaraid/megaraid_mbox.c +4 -2
@@ -113,7 +113,7 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *);static void megaraid_mbox_display_scb (adapter_t *,scb_t *);static void megaraid_mbox_setup_device_map (adapter_t *); -static int megaraid_queue_command (struct scsi_cmnd *, +static int megaraid_queue_command (struct Scsi_Host *,struct scsi_cmnd *,void (*)(struct scsi_cmnd *));static scb_t *megaraid_mbox_build_cmd (adapter_t *,struct scsi_cmnd *,int *);static void megaraid_mbox_runpendq (adapter_t *,scb_t *);
@@ -1484,7 +1484,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)* Queue entry point for mailbox based controllers. */ static int -megaraid_queue_command (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) +megaraid_queue_command_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {adapter_t *adapter;scb_t *scb;
@@ -1513,6 +1513,8 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))return if_busy; } +static DEF_SCSI_QCMD (megaraid_queue_command) +/** * megaraid_mbox_build_cmd - transform the mid-layer scsi commands * @adapter : controller's soft state
drivers/scsi/megaraid/megaraid_sas.c +3 -1
@@ -1334,7 +1334,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance)* @done: Callback entry point */ static int -megasas_queue_command (struct scsi_cmnd *scmd,void (*done) (struct scsi_cmnd *)) +megasas_queue_command_lck (struct scsi_cmnd *scmd,void (*done) (struct scsi_cmnd *)) {u32 frame_count;struct megasas_cmd *cmd;
@@ -1417,6 +1417,8 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (megasas_queue_command) + static struct megasas_instance *megasas_lookup_instance(u16 host_no) {int i;
drivers/scsi/mesh.c +3 -1
@@ -1627,7 +1627,7 @@ static void cmd_complete(struct mesh_state *ms)* Called by midlayer with host locked to queue a new * request */ -static int mesh_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int mesh_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct mesh_state *ms;
@@ -1648,6 +1648,8 @@ static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (mesh_queue) +/* * Called to handle interrupts, either call by the interrupt * handler (do_mesh_interrupt) or by other functions in
drivers/scsi/mpt2sas/mpt2sas_scsih.c +3 -1
@@ -3315,7 +3315,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)* SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full */ static int -_scsih_qcmd (struct scsi_cmnd *scmd,void (*done)(struct scsi_cmnd *)) +_scsih_qcmd_lck (struct scsi_cmnd *scmd,void (*done)(struct scsi_cmnd *)) {struct MPT2SAS_ADAPTER *ioc =shost_priv (scmd->device->host);struct MPT2SAS_DEVICE *sas_device_priv_data;
@@ -3441,6 +3441,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))return SCSI_MLQUEUE_HOST_BUSY ; } +static DEF_SCSI_QCMD (_scsih_qcmd) +/** * _scsih_normalize_sense - normalize descriptor and fixed format sense data * @sense_buffer: sense data returned by target
drivers/scsi/ncr53c8xx.c +3 -1
@@ -8029,7 +8029,7 @@ static int ncr53c8xx_slave_configure(struct scsi_device *device)return 0 ; } -static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;unsigned long flags;
@@ -8068,6 +8068,8 @@ printk("ncr53c8xx : command successfully queued\n");return sts; } +static DEF_SCSI_QCMD (ncr53c8xx_queue_command) + irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) {unsigned long flags;
drivers/scsi/nsp32.c +4 -2
@@ -196,7 +196,7 @@ static void __exit exit_nsp32 (void);static int nsp32_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int nsp32_detect (struct pci_dev *pdev); -static int nsp32_queuecommand (struct scsi_cmnd *, +static int nsp32_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));static const char *nsp32_info (struct Scsi_Host *);static int nsp32_release (struct Scsi_Host *);
@@ -909,7 +909,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt)return TRUE; } -static int nsp32_queuecommand (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int nsp32_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;nsp32_target *target;
@@ -1050,6 +1050,8 @@ static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_return 0 ; } +static DEF_SCSI_QCMD (nsp32_queuecommand) +/* initialize asic */ static int nsp32hw_init(nsp32_hw_data *data) {
drivers/scsi/pas16.h +1 -1
@@ -118,7 +118,7 @@ static int pas16_abort(Scsi_Cmnd *);static int pas16_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int pas16_detect (struct scsi_host_template *); -static int pas16_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int pas16_queue_command (struct Scsi_Host *,Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));static int pas16_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/pcmcia/nsp_cs.c +3 -1
@@ -184,7 +184,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt) SCpnt->scsi_done (SCpnt); } -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, +static int nsp_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {#ifdef NSP_DEBUG
@@ -264,6 +264,8 @@ static int nsp_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (nsp_queuecommand) +/* * setup PIO FIFO transfer mode and enable/disable to data out */
drivers/scsi/pcmcia/nsp_cs.h +1 -1
@@ -299,7 +299,7 @@ static int nsp_proc_info (off_t offset, int length, int inout); -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, +static int nsp_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *SCpnt,void (* done)(struct scsi_cmnd *SCpnt));/* Error handler */
drivers/scsi/pcmcia/sym53c500_cs.c +3 -1
@@ -547,7 +547,7 @@ SYM53C500_info(struct Scsi_Host *SChost) }static int -SYM53C500_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +SYM53C500_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int i;int port_base = SCpnt->device->host->io_port;
@@ -583,6 +583,8 @@ SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (SYM53C500_queue) + static intSYM53C500_host_reset (struct scsi_cmnd *SCpnt) {
drivers/scsi/pmcraid.c +3 -1
@@ -3478,7 +3478,7 @@ static int pmcraid_copy_sglist(* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy */ -static int pmcraid_queuecommand ( +static int pmcraid_queuecommand_lck (struct scsi_cmnd *scsi_cmd,void (*done) (struct scsi_cmnd *) )
@@ -3584,6 +3584,8 @@ static int pmcraid_queuecommand(return rc; } +static DEF_SCSI_QCMD (pmcraid_queuecommand) +/** * pmcraid_open -char node "open" entry, allowed only users with admin access */
drivers/scsi/ppa.c +3 -1
@@ -798,7 +798,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)return 0 ; } -static int ppa_queuecommand (struct scsi_cmnd *cmd, +static int ppa_queuecommand_lck (struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *)) {ppa_struct *dev =ppa_dev (cmd->device->host);
@@ -821,6 +821,8 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (ppa_queuecommand) +/* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really
drivers/scsi/ps3rom.c +3 -1
@@ -211,7 +211,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev,return 0 ; } -static int ps3rom_queuecommand (struct scsi_cmnd *cmd, +static int ps3rom_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ps3rom_private *priv =shost_priv (cmd->device->host);
@@ -260,6 +260,8 @@ static int ps3rom_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (ps3rom_queuecommand) + static int decode_lv1_status(u64 status, unsigned char *sense_key,unsigned char *asc,unsigned char *ascq) {
drivers/scsi/qla1280.c +3 -1
@@ -727,7 +727,7 @@ qla1280_info(struct Scsi_Host *host)* context which is a big NO! NO!. **************************************************************************/ static int -qla1280_queuecommand (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) +qla1280_queuecommand_lck (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
@@ -756,6 +756,8 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))return status; } +static DEF_SCSI_QCMD (qla1280_queuecommand) + enum action {ABORT_COMMAND , DEVICE_RESET,
drivers/scsi/qla2xxx/qla_os.c +4 -2
@@ -179,7 +179,7 @@ static int qla2xxx_slave_alloc(struct scsi_device *);static int qla2xxx_scan_finished (struct Scsi_Host *,unsigned long time);static void qla2xxx_scan_start (struct Scsi_Host *);static void qla2xxx_slave_destroy (struct scsi_device *); -static int qla2xxx_queuecommand (struct scsi_cmnd *cmd, +static int qla2xxx_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *));static int qla2xxx_eh_abort (struct scsi_cmnd *);static int qla2xxx_eh_device_reset (struct scsi_cmnd *);
@@ -535,7 +535,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, }static int -qla2xxx_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +qla2xxx_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {scsi_qla_host_t *vha =shost_priv (cmd->device->host);fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
@@ -609,6 +609,8 @@ qc24_fail_command:return 0 ; } +static DEF_SCSI_QCMD (qla2xxx_queuecommand) +/* * qla2x00_eh_wait_on_command
drivers/scsi/qla4xxx/ql4_os.c +4 -2
@@ -79,7 +79,7 @@ static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc);/* * SCSI host template entry points */ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, +static int qla4xxx_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *));static int qla4xxx_eh_abort (struct scsi_cmnd *cmd);static int qla4xxx_eh_device_reset (struct scsi_cmnd *cmd);
@@ -464,7 +464,7 @@ void qla4xxx_srb_compl(struct kref *ref)* completion handling). Unfortunely, it sometimes calls the scheduler * in interrupt context which is a big NO! NO!. **/ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, +static int qla4xxx_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_qla_host *ha =to_qla_host (cmd->device->host);
@@ -538,6 +538,8 @@ qc_fail_command:return 0 ; } +static DEF_SCSI_QCMD (qla4xxx_queuecommand) +/** * qla4xxx_mem_free - frees memory allocated to adapter * @ha: Pointer to host adapter structure.
drivers/scsi/qlogicfas408.c +3 -1
@@ -439,7 +439,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)* Queued command */ -int qlogicfas408_queuecommand (struct scsi_cmnd *cmd, +static int qlogicfas408_queuecommand_lck (struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *)) {struct qlogicfas408_priv *priv =get_priv_by_cmd (cmd);
@@ -459,6 +459,8 @@ int qlogicfas408_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +DEF_SCSI_QCMD (qlogicfas408_queuecommand) +/* * Return bios parameters */
drivers/scsi/qlogicfas408.h +1 -1
@@ -103,7 +103,7 @@ struct qlogicfas408_priv {#define get_priv_by_host (x) (struct qlogicfas408_priv *)&((x)->hostdata[0])irqreturn_t qlogicfas408_ihandl (int irq,void *dev_id); -int qlogicfas408_queuecommand (struct scsi_cmnd * cmd, +int qlogicfas408_queuecommand (struct Scsi_Host * shost,struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)); int qlogicfas408_biosparam(struct scsi_device * disk, struct block_device *dev,
drivers/scsi/qlogicpti.c +3 -1
@@ -1003,7 +1003,7 @@ static int qlogicpti_slave_configure(struct scsi_device *sdev)* * "This code must fly." -davem */ -static int qlogicpti_queuecommand (struct scsi_cmnd *Cmnd,void (*done)(struct scsi_cmnd *)) +static int qlogicpti_queuecommand_lck (struct scsi_cmnd *Cmnd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = Cmnd->device->host;struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
@@ -1052,6 +1052,8 @@ toss_command:return 1 ; } +static DEF_SCSI_QCMD (qlogicpti_queuecommand) + static int qlogicpti_return_status(struct Status_Entry *sts, int id) {int host_status =DID_ERROR ;
drivers/scsi/scsi.c +4 -13
@@ -634,12 +634,13 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)* Description: a serial number identifies a request for error recovery * and debugging purposes. Protected by the Host_Lock of host. */ -static inline void scsi_cmd_get_serial (struct Scsi_Host *host,struct scsi_cmnd *cmd) +void scsi_cmd_get_serial (struct Scsi_Host *host,struct scsi_cmnd *cmd) { cmd->serial_number = host->cmd_serial_number++;if (cmd->serial_number ==0 ) cmd->serial_number = host->cmd_serial_number++; } +EXPORT_SYMBOL (scsi_cmd_get_serial);/** * scsi_dispatch_command - Dispatch a command to the low-level driver.
@@ -651,7 +652,6 @@ static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmndint scsi_dispatch_cmd (struct scsi_cmnd *cmd) {struct Scsi_Host *host = cmd->device->host; -unsigned long flags =0 ;unsigned long timeout;int rtn =0 ;
@@ -737,23 +737,14 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) goto out; } -spin_lock_irqsave (host->host_lock, flags); -/* -* AK: unlikely race here: for some reason the timer could -* expire before the serial number is set up below. -* -* TODO: kill serial or move to blk layer -*/ -scsi_cmd_get_serial (host, cmd); -if (unlikely (host->shost_state ==SHOST_DEL )) { cmd->result = (DID_NO_CONNECT <<16 );scsi_done (cmd); }else {trace_scsi_dispatch_cmd_start (cmd); - rtn = host->hostt->queuecommand (cmd, scsi_done); + rtn = host->hostt->queuecommand (host, cmd, scsi_done); } -spin_unlock_irqrestore (host->host_lock, flags); +if (rtn) {trace_scsi_dispatch_cmd_error (cmd, rtn); if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
drivers/scsi/scsi_debug.c +3 -1
@@ -3538,7 +3538,7 @@ static void sdebug_remove_adapter(void) }static -int scsi_debug_queuecommand (struct scsi_cmnd *SCpnt,done_funct_t done) +int scsi_debug_queuecommand_lck (struct scsi_cmnd *SCpnt,done_funct_t done) {unsigned char *cmd = (unsigned char *) SCpnt->cmnd;int len, k;
@@ -3884,6 +3884,8 @@ write: (delay_override ? 0 : scsi_debug_delay)); } +static DEF_SCSI_QCMD (scsi_debug_queuecommand) + static struct scsi_host_template sdebug_driver_template = { .proc_info = scsi_debug_proc_info, .proc_name = sdebug_proc_name,
drivers/scsi/scsi_error.c +1 -4
@@ -773,17 +773,14 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,struct Scsi_Host *shost = sdev->host;DECLARE_COMPLETION_ONSTACK (done);unsigned long timeleft; -unsigned long flags;struct scsi_eh_save ses;int rtn;scsi_eh_prep_cmnd (scmd, &ses, cmnd, cmnd_size, sense_bytes); shost->eh_action = &done; -spin_lock_irqsave (shost->host_lock, flags);scsi_log_send (scmd); - shost->hostt->queuecommand (scmd, scsi_eh_done); -spin_unlock_irqrestore (shost->host_lock, flags); + shost->hostt->queuecommand (shost, scmd, scsi_eh_done); timeleft =wait_for_completion_timeout (&done, timeout);
drivers/scsi/stex.c +3 -1
@@ -572,7 +572,7 @@ stex_slave_destroy(struct scsi_device *sdev) }static int -stex_queuecommand (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +stex_queuecommand_lck (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {struct st_hba *hba;struct Scsi_Host *host;
@@ -698,6 +698,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (stex_queuecommand) + static void stex_scsi_done(struct st_ccb *ccb) {struct scsi_cmnd *cmd = ccb->cmd;
drivers/scsi/sun3_NCR5380.c +3 -1
@@ -908,7 +908,7 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags)*/ /* Only make static if a wrapper function is used */ -static int NCR5380_queue_command (struct scsi_cmnd *cmd, +static int NCR5380_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {SETUP_HOSTDATA (cmd->device->host);
@@ -1019,6 +1019,8 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command) +/* * Function : NCR5380_main (void) *
drivers/scsi/sun3_scsi.h +1 -1
@@ -51,7 +51,7 @@ static int sun3scsi_abort(struct scsi_cmnd *);static int sun3scsi_detect (struct scsi_host_template *);static const char *sun3scsi_info (struct Scsi_Host *);static int sun3scsi_bus_reset (struct scsi_cmnd *); -static int sun3scsi_queue_command (struct scsi_cmnd *, +static int sun3scsi_queue_command (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));static int sun3scsi_release (struct Scsi_Host *);
drivers/scsi/sym53c416.c +3 -1
@@ -734,7 +734,7 @@ const char *sym53c416_info(struct Scsi_Host *SChost)return info; } -int sym53c416_queuecommand (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +static int sym53c416_queuecommand_lck (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) {int base;unsigned long flags =0 ;
@@ -761,6 +761,8 @@ int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))return 0 ; } +DEF_SCSI_QCMD (sym53c416_queuecommand) + static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) {int base;
drivers/scsi/sym53c416.h +1 -1
@@ -25,7 +25,7 @@static int sym53c416_detect (struct scsi_host_template *);static const char *sym53c416_info (struct Scsi_Host *);static int sym53c416_release (struct Scsi_Host *); -static int sym53c416_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int sym53c416_queuecommand (struct Scsi_Host *,Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));static int sym53c416_host_reset (Scsi_Cmnd *);static int sym53c416_bios_param (struct scsi_device *,struct block_device *,sector_t ,int *);
drivers/scsi/sym53c8xx_2/sym_glue.c +3 -1
@@ -505,7 +505,7 @@ void sym_log_bus_error(struct Scsi_Host *shost)* queuecommand method. Entered with the host adapter lock held and * interrupts disabled. */ -static int sym53c8xx_queue_command (struct scsi_cmnd *cmd, +static int sym53c8xx_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct sym_hcb *np =SYM_SOFTC_PTR (cmd);
@@ -536,6 +536,8 @@ static int sym53c8xx_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (sym53c8xx_queue_command) +/* * Linux entry point of the interrupt handler. */
drivers/scsi/t128.h +1 -1
@@ -96,7 +96,7 @@ static int t128_abort(struct scsi_cmnd *);static int t128_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int t128_detect (struct scsi_host_template *); -static int t128_queue_command (struct scsi_cmnd *, +static int t128_queue_command (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));static int t128_bus_reset (struct scsi_cmnd *);
drivers/scsi/tmscsim.c +3 -1
@@ -1883,7 +1883,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB )return ; } -static int DC390_queuecommand (struct scsi_cmnd *cmd, +static int DC390_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *sdev = cmd->device;
@@ -1944,6 +1944,8 @@ static int DC390_queuecommand(struct scsi_cmnd *cmd,return SCSI_MLQUEUE_DEVICE_BUSY ; } +static DEF_SCSI_QCMD (DC390_queuecommand) + static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) {struct pci_dev *pdev;
drivers/scsi/u14-34f.c +4 -2
@@ -433,7 +433,7 @@static int u14_34f_detect (struct scsi_host_template *);static int u14_34f_release (struct Scsi_Host *); -static int u14_34f_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +static int u14_34f_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));static int u14_34f_eh_abort (struct scsi_cmnd *);static int u14_34f_eh_host_reset (struct scsi_cmnd *); static int u14_34f_bios_param(struct scsi_device *, struct block_device *,
@@ -1248,7 +1248,7 @@ static void scsi_to_dev_dir(unsigned int i, unsigned int j) { } -static int u14_34f_queuecommand (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) { +static int u14_34f_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {unsigned int i, j, k;struct mscp *cpp;
@@ -1329,6 +1329,8 @@ static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsreturn 0 ; } +static DEF_SCSI_QCMD (u14_34f_queuecommand) + static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) {unsigned int i, j;
drivers/scsi/ultrastor.c +3 -1
@@ -700,7 +700,7 @@ static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) mscp->transfer_data_length = transfer_length; } -static int ultrastor_queuecommand (struct scsi_cmnd *SCpnt, +static int ultrastor_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct mscp *my_mscp;
@@ -825,6 +825,8 @@ retry:return 0 ; } +static DEF_SCSI_QCMD (ultrastor_queuecommand) +/* This code must deal with 2 cases: 1. The command has not been written to the OGM. In this case, set
drivers/scsi/ultrastor.h +1 -1
@@ -15,7 +15,7 @@static int ultrastor_detect (struct scsi_host_template *);static const char *ultrastor_info (struct Scsi_Host *shpnt); -static int ultrastor_queuecommand (struct scsi_cmnd *, +static int ultrastor_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));static int ultrastor_abort (struct scsi_cmnd *);static int ultrastor_host_reset (struct scsi_cmnd *);
drivers/scsi/vmw_pvscsi.c +3 -1
@@ -690,7 +690,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,return 0 ; } -static int pvscsi_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int pvscsi_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct pvscsi_adapter *adapter =shost_priv (host);
@@ -719,6 +719,8 @@ static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (pvscsi_queue) + static int pvscsi_abort(struct scsi_cmnd *cmd) {struct pvscsi_adapter *adapter =shost_priv (cmd->device->host);
drivers/scsi/wd33c93.c +4 -2
@@ -371,8 +371,8 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast, msg[1 ] = offset; } -int -wd33c93_queuecommand (struct scsi_cmnd *cmd, +static int +wd33c93_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct WD33C93_hostdata *hostdata;
@@ -468,6 +468,8 @@ wd33c93_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +DEF_SCSI_QCMD (wd33c93_queuecommand) +/* * This routine attempts to start a scsi command. If the host_card is * already connected, we give up immediately. Otherwise, look through
drivers/scsi/wd33c93.h +1 -1
@@ -343,7 +343,7 @@ struct WD33C93_hostdata {void wd33c93_init (struct Scsi_Host *instance,const wd33c93_regs regs,dma_setup_t setup,dma_stop_t stop,int clock_freq);int wd33c93_abort (struct scsi_cmnd *cmd); -int wd33c93_queuecommand (struct scsi_cmnd *cmd, +int wd33c93_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *));void wd33c93_intr (struct Scsi_Host *instance);int wd33c93_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );
drivers/scsi/wd7000.c +3 -1
@@ -1082,7 +1082,7 @@ static irqreturn_t wd7000_intr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int wd7000_queuecommand (struct scsi_cmnd *SCpnt, +static int wd7000_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {Scb *scb;
@@ -1139,6 +1139,8 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (wd7000_queuecommand) + static int wd7000_diagnostics(Adapter * host, int code) {static IcbDiag icb = {ICB_OP_DIAGNOSTICS };
drivers/staging/hv/storvsc_drv.c +4 -2
@@ -72,7 +72,7 @@ struct storvsc_driver_context {/* Static decl */ static int storvsc_probe (struct device *dev); -static int storvsc_queuecommand (struct scsi_cmnd *scmnd, +static int storvsc_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *));static int storvsc_device_alloc (struct scsi_device *);static int storvsc_device_configure (struct scsi_device *);
@@ -595,7 +595,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl,/* * storvsc_queuecommand - Initiate command processing */ -static int storvsc_queuecommand (struct scsi_cmnd *scmnd, +static int storvsc_queuecommand_lck (struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *)) {int ret;
@@ -783,6 +783,8 @@ retry_request:return ret; } +static DEF_SCSI_QCMD (storvsc_queuecommand) + static int storvsc_merge_bvec(struct request_queue *q,struct bvec_merge_data *bmd,struct bio_vec *bvec) {
drivers/staging/keucr/scsiglue.c +3 -1
@@ -87,7 +87,7 @@ static int slave_configure(struct scsi_device *sdev)/* This is always called with scsi_lock(host) held */ //----- queuecommand() --------------------- -static int queuecommand (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) +static int queuecommand_lck (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) {struct us_data *us =host_to_us (srb->device->host);
@@ -117,6 +117,8 @@ static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (queuecommand) +/*********************************************************************** * Error handling functions ***********************************************************************/
drivers/usb/image/microtek.c +4 -2
@@ -364,7 +364,7 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb) }static int -mts_scsi_queuecommand (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback); +mts_scsi_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback);static void mts_transfer_cleanup (struct urb *transfer );static void mts_do_sg (struct urb * transfer);
@@ -573,7 +573,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)static int -mts_scsi_queuecommand (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback) +mts_scsi_queuecommand_lck (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback) {struct mts_desc * desc = (struct mts_desc *)(srb->device->host->hostdata[0 ]);int err =0 ;
@@ -626,6 +626,8 @@ out:return err; } +static DEF_SCSI_QCMD (mts_scsi_queuecommand) + static struct scsi_host_template mts_scsi_host_template = { .module =THIS_MODULE , .name ="microtekX6" ,
drivers/usb/storage/scsiglue.c +3 -1
@@ -285,7 +285,7 @@ static int slave_configure(struct scsi_device *sdev)/* queue a command */ /* This is always called with scsi_lock(host) held */ -static int queuecommand (struct scsi_cmnd *srb, +static int queuecommand_lck (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) {struct us_data *us =host_to_us (srb->device->host);
@@ -315,6 +315,8 @@ static int queuecommand(struct scsi_cmnd *srb,return 0 ; } +static DEF_SCSI_QCMD (queuecommand) +/*********************************************************************** * Error handling functions ***********************************************************************/
drivers/usb/storage/uas.c +3 -1
@@ -430,7 +430,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,return 0 ; } -static int uas_queuecommand (struct scsi_cmnd *cmnd, +static int uas_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *sdev = cmnd->device;
@@ -488,6 +488,8 @@ static int uas_queuecommand(struct scsi_cmnd *cmnd,return 0 ; } +static DEF_SCSI_QCMD (uas_queuecommand) + static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) {struct scsi_device *sdev = cmnd->device;
include/linux/libata.h +1 -1
@@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, unsigned long, struct ata_port_operations *);extern int ata_scsi_detect (struct scsi_host_template *sht);extern int ata_scsi_ioctl (struct scsi_device *dev,int cmd,void __user *arg); -extern int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)); +extern int ata_scsi_queuecmd (struct Scsi_Host *shost,struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *));extern int ata_sas_scsi_ioctl (struct ata_port *ap,struct scsi_device *dev,int cmd,void __user *arg);extern void ata_sas_port_destroy (struct ata_port *);
include/scsi/libfc.h +1 -1
@@ -1006,7 +1006,7 @@ void fc_fcp_destroy(struct fc_lport *);/* * SCSI INTERACTION LAYER *****************************/ -int fc_queuecommand (struct scsi_cmnd *, +int fc_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));int fc_eh_abort (struct scsi_cmnd *);int fc_eh_device_reset (struct scsi_cmnd *);
include/scsi/libiscsi.h +1 -1
@@ -341,7 +341,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);extern int iscsi_eh_recover_target (struct scsi_cmnd *sc);extern int iscsi_eh_session_reset (struct scsi_cmnd *sc);extern int iscsi_eh_device_reset (struct scsi_cmnd *sc); -extern int iscsi_queuecommand (struct scsi_cmnd *sc, +extern int iscsi_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *));/*
include/scsi/libsas.h +1 -1
@@ -621,7 +621,7 @@ int sas_set_phy_speed(struct sas_phy *phy,int sas_phy_enable (struct sas_phy *phy,int enabled);int sas_phy_reset (struct sas_phy *phy,int hard_reset);int sas_queue_up (struct sas_task *task); -extern int sas_queuecommand (struct scsi_cmnd *, +extern int sas_queuecommand (struct Scsi_Host *,struct scsi_cmnd *,void (*scsi_done)(struct scsi_cmnd *));extern int sas_target_alloc (struct scsi_target *);extern int sas_slave_alloc (struct scsi_device *);
include/scsi/scsi_host.h +16 -1
@@ -127,7 +127,7 @@ struct scsi_host_template {* * STATUS: REQUIRED */ -int (* queuecommand)(struct scsi_cmnd *, +int (* queuecommand)(struct Scsi_Host *,struct scsi_cmnd *,void (*done)(struct scsi_cmnd *));/*
@@ -504,6 +504,20 @@ struct scsi_host_template {u64 vendor_id; }; +#define DEF_SCSI_QCMD (func_name) \ + int func_name (struct Scsi_Host *shost, struct scsi_cmnd *cmd, \ + void (*done)(struct scsi_cmnd *)) \ + { \ + unsigned long irq_flags; \ + int rc; \ + spin_lock_irqsave(shost->host_lock, irq_flags); \ + scsi_cmd_get_serial(shost, cmd); \ + rc = func_name##_lck (cmd, done); \ + spin_unlock_irqrestore(shost->host_lock, irq_flags); \ + return rc; \ + } + +/* * shost state: If you alter this, you also need to alter scsi_sysfs.c * (for the ascii descriptions) and the state model enforcer:
@@ -752,6 +766,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);extern void scsi_host_put (struct Scsi_Host *t);extern struct Scsi_Host *scsi_host_lookup (unsigned short );extern const char *scsi_host_state_name (enum scsi_host_state ); +extern void scsi_cmd_get_serial (struct Scsi_Host *,struct scsi_cmnd *);extern u64 scsi_calculate_bounce_limit (struct Scsi_Host *);
Re: [PATCH v4] SCSI host lock push-down
Quoted 32 lines · Jeff Garzik
drivers/scsi/arm/fas216.c +4
-2@@ -2198,7 +2198,7 @@ no_command:* Returns: 0 on success, else error. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_queue_command (struct scsi_cmnd *SCpnt, +static int fas216_queue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;@@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt,return result; } +DEF_SCSI_QCMD (fas216_queue_command) +/** * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command * @SCpnt: Command to wake @@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)* Returns: scsi result code. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_noqueue_command (struct scsi_cmnd *SCpnt, +static int fas216_noqueue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
drivers/scsi/arm/fas216.c int fas216_noqueue_command(struct scsi_cmnd *SCpnt, · line 2285
Quoted 8 lines
drivers/scsi/arm/fas216.c +1
-1@@ -2277,7 +2279,7 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,BUG_ON (info->scsi.irq !=NO_IRQ ); info->internal_done =0 ; -fas216_queue_command (SCpnt, fas216_internal_done); +fas216_queue_command (SCpnt->device->host, SCpnt, fas216_internal_done);/* * This wastes time, since we can't return until the command is
hmmmm.
Linus's suggestion to add Scsi_Host to queuecommand seems to have had a helpful side effect, exposing a minor bug present in nab's (v1), Andi's (v2), my v3 and v4 push-down patches:
A few odd ducks, such as fas16 or ancient megaraid, call their own ->queuecommand directly. None of the major SCSI drivers do this, thankfully.
The host lock push-down patch should be calling the _lck function in those rare cases, otherwise we've created a deadlock.
Time for v5...
Jeff
PATCH v5 1/1 SCSI host lock push-down
In reply to Jeff GarzikMove 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.
--- arch/ia64/hp/sim/simscsi.c | 4 +++- drivers/ata/libata-scsi.c | 4 +++- drivers/block/cciss_scsi.c | 8 +++++--- drivers/firewire/sbp2.c | 4 +++- drivers/infiniband/ulp/srp/ib_srp.c | 4 +++- drivers/message/fusion/mptfc.c | 7 ++++--- drivers/message/fusion/mptsas.c | 4 +++- drivers/message/fusion/mptspi.c | 4 +++- drivers/message/i2o/i2o_scsi.c | 6 ++++-- drivers/s390/scsi/zfcp_scsi.c | 4 +++- drivers/scsi/3w-9xxx.c | 4 +++- drivers/scsi/3w-sas.c | 4 +++- drivers/scsi/3w-xxxx.c | 4 +++- drivers/scsi/53c700.c | 8 +++++--- drivers/scsi/BusLogic.c | 3 ++- drivers/scsi/BusLogic.h | 2 +- drivers/scsi/NCR5380.c | 3 ++- drivers/scsi/NCR5380.h | 2 +- drivers/scsi/NCR53c406a.c | 4 +++- drivers/scsi/a100u2w.c | 4 +++- drivers/scsi/aacraid/linit.c | 4 +++- drivers/scsi/advansys.c | 4 +++- drivers/scsi/aha152x.c | 4 +++- drivers/scsi/aha1542.c | 4 +++- drivers/scsi/aha1542.h | 2 +- drivers/scsi/aha1740.c | 4 +++- drivers/scsi/aic7xxx/aic79xx_osm.c | 4 +++- drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 +++- drivers/scsi/aic7xxx_old.c | 4 +++- drivers/scsi/arcmsr/arcmsr_hba.c | 7 ++++--- drivers/scsi/arm/acornscsi.c | 4 +++- drivers/scsi/arm/fas216.c | 10 +++++++--- drivers/scsi/arm/fas216.h | 18 ++++++++---------- drivers/scsi/atari_NCR5380.c | 4 +++- drivers/scsi/atari_scsi.c | 17 ----------------- drivers/scsi/atp870u.c | 4 +++- drivers/scsi/bfa/bfad_im.c | 7 ++++--- drivers/scsi/dc395x.c | 3 ++- drivers/scsi/dpt_i2o.c | 4 +++- drivers/scsi/dpti.h | 2 +- drivers/scsi/dtc.h | 2 +- drivers/scsi/eata.c | 7 ++++--- drivers/scsi/eata_pio.c | 4 +++- drivers/scsi/esp_scsi.c | 4 +++- drivers/scsi/fd_mcs.c | 4 +++- drivers/scsi/fdomain.c | 4 +++- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_scsi.c | 4 +++- drivers/scsi/g_NCR5380.h | 2 +- drivers/scsi/gdth.c | 6 ++++-- drivers/scsi/hpsa.c | 7 ++++--- drivers/scsi/hptiop.c | 4 +++- drivers/scsi/ibmmca.c | 6 ++++-- drivers/scsi/ibmvscsi/ibmvfc.c | 4 +++- drivers/scsi/ibmvscsi/ibmvscsi.c | 4 +++- drivers/scsi/imm.c | 4 +++- drivers/scsi/in2000.c | 4 +++- drivers/scsi/in2000.h | 2 +- drivers/scsi/initio.c | 4 +++- drivers/scsi/ipr.c | 4 +++- drivers/scsi/ips.c | 6 ++++-- drivers/scsi/libfc/fc_fcp.c | 4 +++- drivers/scsi/libiscsi.c | 4 +++- drivers/scsi/libsas/sas_scsi_host.c | 4 +++- drivers/scsi/lpfc/lpfc_scsi.c | 4 +++- drivers/scsi/mac53c94.c | 4 +++- drivers/scsi/megaraid.c | 6 ++++-- drivers/scsi/megaraid.h | 2 +- drivers/scsi/megaraid/megaraid_mbox.c | 7 ++++--- drivers/scsi/megaraid/megaraid_sas.c | 4 +++- drivers/scsi/mesh.c | 4 +++- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 4 +++- drivers/scsi/ncr53c8xx.c | 4 +++- drivers/scsi/nsp32.c | 7 ++++--- drivers/scsi/pas16.h | 2 +- drivers/scsi/pcmcia/nsp_cs.c | 4 +++- drivers/scsi/pcmcia/nsp_cs.h | 3 +-- drivers/scsi/pcmcia/sym53c500_cs.c | 4 +++- drivers/scsi/pmcraid.c | 4 +++- drivers/scsi/ppa.c | 4 +++- drivers/scsi/ps3rom.c | 4 +++- drivers/scsi/qla1280.c | 4 +++- drivers/scsi/qla2xxx/qla_os.c | 7 ++++--- drivers/scsi/qla4xxx/ql4_os.c | 7 ++++--- drivers/scsi/qlogicfas408.c | 4 +++- drivers/scsi/qlogicfas408.h | 3 +-- drivers/scsi/qlogicpti.c | 4 +++- drivers/scsi/scsi.c | 18 +++++------------- drivers/scsi/scsi_debug.c | 4 +++- drivers/scsi/scsi_error.c | 6 ++---- drivers/scsi/stex.c | 4 +++- drivers/scsi/sun3_NCR5380.c | 4 +++- drivers/scsi/sun3_scsi.h | 3 +-- drivers/scsi/sym53c416.c | 4 +++- drivers/scsi/sym53c416.h | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +++- drivers/scsi/t128.h | 3 +-- drivers/scsi/tmscsim.c | 4 +++- drivers/scsi/u14-34f.c | 6 ++++-- drivers/scsi/ultrastor.c | 4 +++- drivers/scsi/ultrastor.h | 3 +-- drivers/scsi/vmw_pvscsi.c | 4 +++- drivers/scsi/wd33c93.c | 6 ++++-- drivers/scsi/wd33c93.h | 3 +-- drivers/scsi/wd7000.c | 4 +++- drivers/staging/hv/storvsc_drv.c | 7 ++++--- drivers/staging/keucr/scsiglue.c | 4 +++- drivers/usb/image/microtek.c | 6 ++++-- drivers/usb/storage/scsiglue.c | 4 +++- drivers/usb/storage/uas.c | 4 +++- include/linux/libata.h | 2 +- include/scsi/libfc.h | 3 +-- include/scsi/libiscsi.h | 3 +-- include/scsi/libsas.h | 3 +-- include/scsi/scsi_host.h | 23 +++++++++++++++++++++-- 115 files changed, 347 insertions(+), 199 deletions(-)
arch/ia64/hp/sim/simscsi.c +3 -1
@@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) }static int -simscsi_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +simscsi_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {unsigned int target_id = sc->device->id;char fname[MAX_ROOT_LEN +16 ];
@@ -326,6 +326,8 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (simscsi_queuecommand) + static intsimscsi_host_reset (struct scsi_cmnd *sc) {
drivers/ata/libata-scsi.c +3 -1
@@ -3183,7 +3183,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,* Return value from __ata_scsi_queuecmd() if @cmd can be queued, * 0 otherwise. */ -int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int ata_scsi_queuecmd_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ata_port *ap;struct ata_device *dev;
@@ -3211,6 +3211,8 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return rc; } +DEF_SCSI_QCMD (ata_scsi_queuecmd) +/** * ata_scsi_simulate - simulate SCSI command on ATA device * @dev: the target device
drivers/block/cciss_scsi.c +5 -3
@@ -62,8 +62,8 @@ static int cciss_scsi_proc_info(int length,/* length of data in buffer */ int func); /* 0 == read, 1 == write */ -static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, -void (* done)(struct scsi_cmnd *)); +static int cciss_scsi_queue_command (struct Scsi_Host *h, +struct scsi_cmnd *cmd);static int cciss_eh_device_reset_handler (struct scsi_cmnd *);static int cciss_eh_abort_handler (struct scsi_cmnd *);
@@ -1406,7 +1406,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c,static int -cciss_scsi_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +cciss_scsi_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {ctlr_info_t *h;int rc;
@@ -1504,6 +1504,8 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (cciss_scsi_queue_command) + static void cciss_unregister_scsi(ctlr_info_t *h) {struct cciss_scsi_adapter_data_t *sa;
drivers/firewire/sbp2.c +3 -1
@@ -1468,7 +1468,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb,/* SCSI stack integration */ -static int sbp2_scsi_queuecommand (struct scsi_cmnd *cmd,scsi_done_fn_t done) +static int sbp2_scsi_queuecommand_lck (struct scsi_cmnd *cmd,scsi_done_fn_t done) {struct sbp2_logical_unit *lu = cmd->device->hostdata;struct fw_device *device =target_device (lu->tgt);
@@ -1534,6 +1534,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)return retval; } +static DEF_SCSI_QCMD (sbp2_scsi_queuecommand) + static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) {struct sbp2_logical_unit *lu = sdev->hostdata;
drivers/infiniband/ulp/srp/ib_srp.c +3 -1
@@ -1123,7 +1123,7 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr) } } -static int srp_queuecommand (struct scsi_cmnd *scmnd, +static int srp_queuecommand_lck (struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *)) {struct srp_target_port *target =host_to_target (scmnd->device->host);
@@ -1196,6 +1196,8 @@ err:return SCSI_MLQUEUE_HOST_BUSY ; } +static DEF_SCSI_QCMD (srp_queuecommand) + static int srp_alloc_iu_bufs(struct srp_target_port *target) {int i;
drivers/message/fusion/mptfc.c +4 -3
@@ -97,8 +97,7 @@ static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;static int mptfc_target_alloc (struct scsi_target *starget);static int mptfc_slave_alloc (struct scsi_device *sdev); -static int mptfc_qcmd (struct scsi_cmnd *SCpnt, -void (*done)(struct scsi_cmnd *)); +static int mptfc_qcmd (struct Scsi_Host *shost,struct scsi_cmnd *SCpnt);static void mptfc_target_destroy (struct scsi_target *starget);static void mptfc_set_rport_loss_tmo (struct fc_rport *rport,uint32_t timeout); static void __devexit mptfc_remove(struct pci_dev *pdev);
@@ -650,7 +649,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) }static int -mptfc_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptfc_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {struct mptfc_rport_info *ri;struct fc_rport *rport =starget_to_rport (scsi_target (SCpnt->device));
@@ -681,6 +680,8 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptfc_qcmd) +/* * mptfc_display_port_link_speed - displaying link speed * @ioc: Pointer to MPT_ADAPTER structure
drivers/message/fusion/mptsas.c +3 -1
@@ -1889,7 +1889,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) }static int -mptsas_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptsas_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {MPT_SCSI_HOST *hd;MPT_ADAPTER *ioc;
@@ -1913,6 +1913,8 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptsas_qcmd) +/** * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout * if the device under question is currently in the
drivers/message/fusion/mptspi.c +3 -1
@@ -780,7 +780,7 @@ static int mptspi_slave_configure(struct scsi_device *sdev) }static int -mptspi_qcmd (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +mptspi_qcmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {struct _MPT_SCSI_HOST *hd =shost_priv (SCpnt->device->host);VirtDevice *vdevice = SCpnt->device->hostdata;
@@ -805,6 +805,8 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return mptscsih_qcmd (SCpnt,done); } +static DEF_SCSI_QCMD (mptspi_qcmd) + static void mptspi_slave_destroy(struct scsi_device *sdev) {struct scsi_target *starget =scsi_target (sdev);
drivers/message/i2o/i2o_scsi.c +4 -2
@@ -506,7 +506,7 @@ static struct i2o_driver i2o_scsi_driver = {* Locks: takes the controller lock on error path only */ -static int i2o_scsi_queuecommand (struct scsi_cmnd *SCpnt, +static int i2o_scsi_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct i2o_controller *c;
@@ -688,7 +688,9 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, exit:return rc; -}; +} + +static DEF_SCSI_QCMD (i2o_scsi_queuecommand)/** * i2o_scsi_abort - abort a running command
drivers/s390/scsi/zfcp_scsi.c +3 -1
@@ -76,7 +76,7 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) scpnt->scsi_done (scpnt); } -static int zfcp_scsi_queuecommand (struct scsi_cmnd *scpnt, +static int zfcp_scsi_queuecommand_lck (struct scsi_cmnd *scpnt,void (*done) (struct scsi_cmnd *)) {struct zfcp_scsi_dev *zfcp_sdev =sdev_to_zfcp (scpnt->device);
@@ -127,6 +127,8 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,return ret; } +static DEF_SCSI_QCMD (zfcp_scsi_queuecommand) + static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) {struct fc_rport *rport =starget_to_rport (scsi_target (sdev));
drivers/scsi/3w-9xxx.c +3 -1
@@ -1765,7 +1765,7 @@ out: }/* End twa_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twa_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int twa_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int request_id, retval;TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@@ -1812,6 +1812,8 @@ out:return retval; }/* End twa_scsi_queue() */ +static DEF_SCSI_QCMD (twa_scsi_queue) +/* This function hands scsi cdb's to the firmware */ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg) {
drivers/scsi/3w-sas.c +3 -1
@@ -1501,7 +1501,7 @@ out: }/* End twl_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twl_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int twl_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int request_id, retval;TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@@ -1536,6 +1536,8 @@ out:return retval; }/* End twl_scsi_queue() */ +static DEF_SCSI_QCMD (twl_scsi_queue) +/* This function tells the controller to shut down */ static void __twl_shutdown(TW_Device_Extension *tw_dev) {
drivers/scsi/3w-xxxx.c +3 -1
@@ -1947,7 +1947,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r }/* End tw_scsiop_test_unit_ready_complete() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int tw_scsi_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int tw_scsi_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {unsigned char *command = SCpnt->cmnd;int request_id =0 ;
@@ -2023,6 +2023,8 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmndreturn retval; }/* End tw_scsi_queue() */ +static DEF_SCSI_QCMD (tw_scsi_queue) +/* This function is the interrupt service routine */ static irqreturn_t tw_interrupt(int irq, void *dev_instance) {
drivers/scsi/53c700.c +5 -3
@@ -167,7 +167,7 @@ MODULE_LICENSE("GPL");#include "53c700_d.h" -STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); +STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
@@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id)return IRQ_RETVAL (handled); } -STATIC int -NCR_700_queuecommand (struct scsi_cmnd *SCp,void (*done)(struct scsi_cmnd *)) +static int +NCR_700_queuecommand_lck (struct scsi_cmnd *SCp,void (*done)(struct scsi_cmnd *)) {struct NCR_700_Host_Parameters *hostdata = (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 *))return 0 ; } +STATIC DEF_SCSI_QCMD (NCR_700_queuecommand ) +STATIC int NCR_700_abort(struct scsi_cmnd * SCp) {
drivers/scsi/BusLogic.c +2 -1
@@ -2807,7 +2807,7 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt)Outgoing Mailbox for execution by the associated Host Adapter. */ -static int BusLogic_QueueCommand (struct scsi_cmnd *Command,void (*CompletionRoutine) (struct scsi_cmnd *)) +static int BusLogic_QueueCommand_lck (struct scsi_cmnd *Command,void (*CompletionRoutine) (struct scsi_cmnd *)) {struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata;struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id];
@@ -2994,6 +2994,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoureturn 0 ; } +static DEF_SCSI_QCMD(BusLogic_QueueCommand)#if 0 /*
drivers/scsi/BusLogic.h +1 -1
@@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co*/ static const char *BusLogic_DriverInfo (struct Scsi_Host *); -static int BusLogic_QueueCommand (struct scsi_cmnd *,void (*CompletionRoutine) (struct scsi_cmnd *)); +static int BusLogic_QueueCommand (struct Scsi_Host *h,struct scsi_cmnd *);static int BusLogic_BIOSDiskParameters (struct scsi_device *,struct block_device *,sector_t ,int *);static int BusLogic_ProcDirectoryInfo (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int BusLogic_SlaveConfigure (struct scsi_device *);
drivers/scsi/NCR5380.c +2 -1
@@ -952,7 +952,7 @@ static void NCR5380_exit(struct Scsi_Host *instance)* Locks: host lock taken by caller */ -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int NCR5380_queue_command_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *instance = cmd->device->host;struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@@ -1021,6 +1021,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command)/** * NCR5380_main - NCR state machines
drivers/scsi/NCR5380.h +1 -1
@@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance);#endif static int NCR5380_abort (Scsi_Cmnd * cmd);static int NCR5380_bus_reset (Scsi_Cmnd * cmd); -static int NCR5380_queue_command (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)); +static int NCR5380_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int __maybe_unused NCR5380_proc_info (struct Scsi_Host *instance,char *buffer,char **start,off_t offset,int length,int inout);
drivers/scsi/NCR53c406a.c +3 -1
@@ -693,7 +693,7 @@ static void wait_intr(void) }#endif -static int NCR53c406a_queue (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int NCR53c406a_queue_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {int i;
@@ -726,6 +726,8 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR53c406a_queue) + static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) {DEB (printk ("NCR53c406a_reset called\n" ));
drivers/scsi/a100u2w.c +3 -1
@@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc* queue the command down to the controller */ -static int inia100_queue (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) +static int inia100_queue_lck (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) {struct orc_scb *scb;struct orc_host *host;/* Point to Host adapter control block */
@@ -930,6 +930,8 @@ static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (inia100_queue) +/***************************************************************************** Function name : inia100_abort Description : Abort a queued command.
drivers/scsi/aacraid/linit.c +3 -1
@@ -248,7 +248,7 @@ static struct aac_driver_ident aac_drivers[] = {* TODO: unify with aac_scsi_cmd(). */ -static int aac_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int aac_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct aac_dev *dev = (struct aac_dev *)host->hostdata;
@@ -267,6 +267,8 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmndreturn (aac_scsi_cmd (cmd) ?FAILED :0 ); } +static DEF_SCSI_QCMD (aac_queuecommand) +/** * aac_info - Returns the host adapter name * @shost: Scsi host to report on
drivers/scsi/advansys.c +3 -1
@@ -9500,7 +9500,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)* in the 'scp' result field. */ static int -advansys_queuecommand (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) +advansys_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *shost = scp->device->host;int asc_res, result =0 ;
@@ -9525,6 +9525,8 @@ advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))return result; } +static DEF_SCSI_QCMD (advansys_queuecommand) + static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) { PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
drivers/scsi/aha152x.c +3 -1
@@ -1056,7 +1056,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,* queue a command * */ -static int aha152x_queue (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +static int aha152x_queue_lck (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) {#if 0 if (*SCpnt->cmnd ==REQUEST_SENSE ) {
@@ -1070,6 +1070,8 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))return aha152x_internal_queue (SCpnt,NULL ,0 , done); } +static DEF_SCSI_QCMD (aha152x_queue) +/* *
drivers/scsi/aha1542.c +3 -1
@@ -558,7 +558,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) }; } -static int aha1542_queuecommand (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int aha1542_queuecommand_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {unchar ahacmd =CMD_START_SCSI ;unchar direction;
@@ -718,6 +718,8 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (aha1542_queuecommand) +/* Initialize mailboxes */ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) {
drivers/scsi/aha1542.h +1 -1
@@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */ };static int aha1542_detect (struct scsi_host_template *); -static int aha1542_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int aha1542_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int aha1542_bus_reset (Scsi_Cmnd * SCpnt);static int aha1542_dev_reset (Scsi_Cmnd * SCpnt);static int aha1542_host_reset (Scsi_Cmnd * SCpnt);
drivers/scsi/aha1740.c +3 -1
@@ -331,7 +331,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)return IRQ_RETVAL (handled); } -static int aha1740_queuecommand (Scsi_Cmnd * SCpnt,void (*done)(Scsi_Cmnd *)) +static int aha1740_queuecommand_lck (Scsi_Cmnd * SCpnt,void (*done)(Scsi_Cmnd *)) {unchar direction;unchar *cmd = (unchar *) SCpnt->cmnd;
@@ -503,6 +503,8 @@ static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (aha1740_queuecommand) +/* Query the board for its irq_level and irq_type. Nothing else matters in enhanced mode on an EISA bus. */
drivers/scsi/aic7xxx/aic79xx_osm.c +3 -1
@@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host)* Queue an SCB to the controller. */ static int -ahd_linux_queue (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) +ahd_linux_queue_lck (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) {struct ahd_softc *ahd;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 *))return rtn; } +static DEF_SCSI_QCMD (ahd_linux_queue) + static struct scsi_target **ahd_linux_target_in_softc (struct scsi_target *starget) {
drivers/scsi/aic7xxx/aic7xxx_osm.c +3 -1
@@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host)* Queue an SCB to the controller. */ static int -ahc_linux_queue (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) +ahc_linux_queue_lck (struct scsi_cmnd * cmd,void (*scsi_done) (struct scsi_cmnd *)) {struct ahc_softc *ahc;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 *))return rtn; } +static DEF_SCSI_QCMD (ahc_linux_queue) + static inline struct scsi_target **ahc_linux_target_in_softc (struct scsi_target *starget) {
drivers/scsi/aic7xxx_old.c +3 -1
@@ -10234,7 +10234,7 @@ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,* Description: * Queue a SCB to the controller. *-F*************************************************************************/ -static int aic7xxx_queue (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) +static int aic7xxx_queue_lck (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) {struct aic7xxx_host *p;struct aic7xxx_scb *scb;
@@ -10292,6 +10292,8 @@ static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))return (0 ); } +static DEF_SCSI_QCMD (aic7xxx_queue) +/*+F************************************************************************* * Function: * aic7xxx_bus_device_reset
drivers/scsi/arcmsr/arcmsr_hba.c +4 -3
@@ -85,8 +85,7 @@ static int arcmsr_abort(struct scsi_cmnd *);static int arcmsr_bus_reset (struct scsi_cmnd *);static int arcmsr_bios_param (struct scsi_device *sdev,struct block_device *bdev,sector_t capacity,int *info); -static int arcmsr_queue_command (struct scsi_cmnd *cmd, -void (*done) (struct scsi_cmnd *)); +static int arcmsr_queue_command (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int arcmsr_probe (struct pci_dev *pdev,const struct pci_device_id *id);static void arcmsr_remove (struct pci_dev *pdev);
@@ -2081,7 +2080,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, } } -static int arcmsr_queue_command (struct scsi_cmnd *cmd, +static int arcmsr_queue_command_lck (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;
@@ -2124,6 +2123,8 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (arcmsr_queue_command) + static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) {struct MessageUnit_A __iomem *reg = acb->pmuA;
drivers/scsi/arm/acornscsi.c +3 -1
@@ -2511,7 +2511,7 @@ acornscsi_intr(int irq, void *dev_id)* done - function called on completion, with pointer to command descriptor * Returns : 0, or < 0 on error. */ -int acornscsi_queuecmd (struct scsi_cmnd *SCpnt, +static int acornscsi_queuecmd_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
@@ -2561,6 +2561,8 @@ int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,return 0 ; } +DEF_SCSI_QCMD (acornscsi_queuecmd) +/* * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2
drivers/scsi/arm/fas216.c +7 -3
@@ -2198,7 +2198,7 @@ no_command:* Returns: 0 on success, else error. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_queue_command (struct scsi_cmnd *SCpnt, +static int fas216_queue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt,return result; } +DEF_SCSI_QCMD (fas216_queue_command) +/** * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command * @SCpnt: Command to wake
@@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)* Returns: scsi result code. * Notes: io_request_lock is held, interrupts are disabled. */ -int fas216_noqueue_command (struct scsi_cmnd *SCpnt, +static int fas216_noqueue_command_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@@ -2277,7 +2279,7 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,BUG_ON (info->scsi.irq !=NO_IRQ ); info->internal_done =0 ; -fas216_queue_command (SCpnt, fas216_internal_done); +fas216_queue_command_lck (SCpnt, fas216_internal_done);/* * This wastes time, since we can't return until the command is
@@ -2310,6 +2312,8 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,return 0 ; } +DEF_SCSI_QCMD (fas216_noqueue_command) +/* * Error handler timeout function. Indicate that we timed out, * and wake up any error handler process so it can continue.
drivers/scsi/arm/fas216.h +8 -10
@@ -331,23 +331,21 @@ extern int fas216_init (struct Scsi_Host *instance);*/ extern int fas216_add (struct Scsi_Host *instance,struct device *dev); -/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) * Purpose : queue a command for adapter to process. -* Params : SCpnt - Command to queue -* done - done function to call once command is complete +* Params : h - host adapter +* : SCpnt - Command to queue * Returns : 0 - success, else error */ -extern int fas216_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +extern int fas216_queue_command (struct Scsi_Host *h,struct scsi_cmnd *SCpnt); -/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +/* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) * Purpose : queue a command for adapter to process, and process it to completion. -* Params : SCpnt - Command to queue -* done - done function to call once command is complete +* Params : h - host adapter +* : SCpnt - Command to queue * Returns : 0 - success, else error */ -extern int fas216_noqueue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +extern int fas216_noqueue_command (struct Scsi_Host *,struct scsi_cmnd *)/* Function: irqreturn_t fas216_intr (FAS216_Info *info) * Purpose : handle interrupts from the interface to progress a command
drivers/scsi/atari_NCR5380.c +3 -1
@@ -910,7 +910,7 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)* */ -static int NCR5380_queue_command (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) +static int NCR5380_queue_command_lck (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) {SETUP_HOSTDATA (cmd->device->host);Scsi_Cmnd *tmp;
@@ -1022,6 +1022,8 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command) +/* * Function : NCR5380_main (void) *
drivers/scsi/atari_scsi.c +0 -17
@@ -572,23 +572,6 @@ static void falcon_get_lock(void) } -/* This is the wrapper function for NCR5380_queue_command(). It just -* tries to get the lock on the ST-DMA (see above) and then calls the -* original function. -*/ - -#if 0 -int atari_queue_command (Scsi_Cmnd *cmd,void (*done)(Scsi_Cmnd *)) -{ -/* falcon_get_lock(); -* ++guenther: moved to NCR5380_queue_command() to prevent -* race condition, see there for an explanation. -*/ -return NCR5380_queue_command (cmd, done); -} -#endif - -int __init atari_scsi_detect (struct scsi_host_template *host) {static int called =0 ;
drivers/scsi/atp870u.c +3 -1
@@ -605,7 +605,7 @@ handled:* * Queue a command to the ATP queue. Called with the host lock held. */ -static int atp870u_queuecommand (struct scsi_cmnd * req_p, +static int atp870u_queuecommand_lck (struct scsi_cmnd *req_p,void (*done) (struct scsi_cmnd *)) {unsigned char c;
@@ -694,6 +694,8 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,return 0 ; } +static DEF_SCSI_QCMD (atp870u_queuecommand) +/** * send_s870 - send a command to the controller * @host: host
drivers/scsi/bfa/bfad_im.c +4 -3
@@ -30,8 +30,7 @@ DEFINE_IDR(bfad_im_port_index);struct scsi_transport_template *bfad_im_scsi_transport_template;struct scsi_transport_template *bfad_im_scsi_vport_transport_template;static void bfad_im_itnim_work_handler (struct work_struct *work); -static int bfad_im_queuecommand (struct scsi_cmnd *cmnd, -void (*done)(struct scsi_cmnd *)); +static int bfad_im_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmnd);static int bfad_im_slave_alloc (struct scsi_device *sdev);static void bfad_im_fc_rport_add (struct bfad_im_port_s *im_port,struct bfad_itnim_s *itnim);
@@ -1120,7 +1119,7 @@ bfad_im_itnim_work_handler(struct work_struct *work)* Scsi_Host template entry, queue a SCSI command to the BFAD. */ static int -bfad_im_queuecommand (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) +bfad_im_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) cmnd->device->host->hostdata[0 ];
@@ -1187,6 +1186,8 @@ out_fail_cmd:return 0 ; } +static DEF_SCSI_QCMD (bfad_im_queuecommand) + voidbfad_os_rport_online_wait (struct bfad_s *bfad) {
drivers/scsi/dc395x.c +2 -1
@@ -1080,7 +1080,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,* and is expected to be held on return. * **/ -static int dc395x_queue_command (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int dc395x_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct DeviceCtlBlk *dcb;struct ScsiReqBlk *srb;
@@ -1154,6 +1154,7 @@ complete:return 0 ; } +static DEF_SCSI_QCMD (dc395x_queue_command)/* * Return the disk geometry for the given SCSI device.
drivers/scsi/dpt_i2o.c +3 -1
@@ -423,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device)return 0 ; } -static int adpt_queue (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) +static int adpt_queue_lck (struct scsi_cmnd * cmd,void (*done) (struct scsi_cmnd *)) {adpt_hba * pHba =NULL ;struct adpt_device * pDev =NULL ;/* dpt per device information */
@@ -491,6 +491,8 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))return adpt_scsi_to_i2o (pHba, cmd, pDev); } +static DEF_SCSI_QCMD (adpt_queue) + static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev,sector_t capacity,int geom[]) {
drivers/scsi/dpti.h +1 -1
@@ -29,7 +29,7 @@*/ static int adpt_detect (struct scsi_host_template * sht); -static int adpt_queue (struct scsi_cmnd * cmd,void (*cmdcomplete) (struct scsi_cmnd *)); +static int adpt_queue (struct Scsi_Host *h,struct scsi_cmnd * cmd);static int adpt_abort (struct scsi_cmnd * cmd);static int adpt_reset (struct scsi_cmnd * cmd);static int adpt_release (struct Scsi_Host *host);
drivers/scsi/dtc.h +1 -1
@@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *);static int dtc_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int dtc_detect (struct scsi_host_template *); -static int dtc_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int dtc_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int dtc_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/eata.c +4 -3
@@ -505,8 +505,7 @@static int eata2x_detect (struct scsi_host_template *);static int eata2x_release (struct Scsi_Host *); -static int eata2x_queuecommand (struct scsi_cmnd *, -void (*done) (struct scsi_cmnd *)); +static int eata2x_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int eata2x_eh_abort (struct scsi_cmnd *);static int eata2x_eh_host_reset (struct scsi_cmnd *); static int eata2x_bios_param(struct scsi_device *, struct block_device *,
@@ -1758,7 +1757,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha) } -static int eata2x_queuecommand (struct scsi_cmnd *SCpnt, +static int eata2x_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct Scsi_Host *shost = SCpnt->device->host;
@@ -1843,6 +1842,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (eata2x_queuecommand) + static int eata2x_eh_abort(struct scsi_cmnd *SCarg) {struct Scsi_Host *shost = SCarg->device->host;
drivers/scsi/eata_pio.c +3 -1
@@ -335,7 +335,7 @@ static inline unsigned int eata_pio_send_command(unsigned long base, unsigned chreturn 0 ; } -static int eata_pio_queue (struct scsi_cmnd *cmd, +static int eata_pio_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {unsigned int x, y;
@@ -438,6 +438,8 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (eata_pio_queue) + static int eata_pio_abort(struct scsi_cmnd *cmd) {unsigned int loop =100 ;
drivers/scsi/esp_scsi.c +3 -1
@@ -916,7 +916,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)scsi_track_queue_full (dev, lp->num_tagged -1 ); } -static int esp_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int esp_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *dev = cmd->device;struct esp *esp =shost_priv (dev->host);
@@ -941,6 +941,8 @@ static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmndreturn 0 ; } +static DEF_SCSI_QCMD (esp_queuecommand) + static int esp_check_gross_error(struct esp *esp) {if (esp->sreg &ESP_STAT_SPAM ) {
drivers/scsi/fd_mcs.c +3 -1
@@ -1072,7 +1072,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt)return 0 ; } -static int fd_mcs_queue (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) +static int fd_mcs_queue_lck (Scsi_Cmnd * SCpnt,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *shpnt = SCpnt->device->host;
@@ -1122,6 +1122,8 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD(fd_mcs_queue) +#if DEBUG_ABORT ||DEBUG_RESET static void fd_mcs_print_info (Scsi_Cmnd * SCpnt) {
drivers/scsi/fdomain.c +3 -1
@@ -1419,7 +1419,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int fdomain_16x0_queue (struct scsi_cmnd *SCpnt, +static int fdomain_16x0_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {if (in_command) {
@@ -1469,6 +1469,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD(fdomain_16x0_queue) +#if DEBUG_ABORT static void print_info (struct scsi_cmnd *SCpnt) {
drivers/scsi/fnic/fnic.h +1 -1
@@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *);void fnic_update_mac (struct fc_lport *,u8 *new);void fnic_update_mac_locked (struct fnic *,u8 *new); -int fnic_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +int fnic_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int fnic_abort_cmd (struct scsi_cmnd *);int fnic_device_reset (struct scsi_cmnd *);int fnic_host_reset (struct scsi_cmnd *);
drivers/scsi/fnic/fnic_scsi.c +3 -1
@@ -349,7 +349,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,* Routine to send a scsi cdb * Called with host_lock held and interrupts disabled. */ -int fnic_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +static int fnic_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {struct fc_lport *lp;struct fc_rport *rport;
@@ -457,6 +457,8 @@ out:return ret; } +DEF_SCSI_QCMD (fnic_queuecommand) +/* * fnic_fcpio_fw_reset_cmpl_handler * Routine to handle fw reset completion
drivers/scsi/g_NCR5380.h +1 -1
@@ -46,7 +46,7 @@static int generic_NCR5380_abort (Scsi_Cmnd *);static int generic_NCR5380_detect (struct scsi_host_template *);static int generic_NCR5380_release_resources (struct Scsi_Host *); -static int generic_NCR5380_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int generic_NCR5380_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int generic_NCR5380_bus_reset (Scsi_Cmnd *);static const char *generic_NCR5380_info (struct Scsi_Host *);
drivers/scsi/gdth.c +4 -2
@@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);static void gdth_flush (gdth_ha_str *ha); -static int gdth_queuecommand (Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); +static int gdth_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int __gdth_queuecommand (gdth_ha_str *ha,struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo);static void gdth_scsi_done (struct scsi_cmnd *scp);
@@ -4004,7 +4004,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se } -static int gdth_queuecommand (struct scsi_cmnd *scp, +static int gdth_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {gdth_ha_str *ha =shost_priv (scp->device->host);
@@ -4022,6 +4022,8 @@ static int gdth_queuecommand(struct scsi_cmnd *scp,return __gdth_queuecommand (ha, scp, cmndinfo); } +static DEF_SCSI_QCMD (gdth_queuecommand) + static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,struct gdth_cmndinfo *cmndinfo) {
drivers/scsi/hpsa.c +4 -3
@@ -143,8 +143,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h, void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, int cmd_type); -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, -void (*done)(struct scsi_cmnd *)); +static int hpsa_scsi_queue_command (struct Scsi_Host *h,struct scsi_cmnd *cmd);static void hpsa_scan_start (struct Scsi_Host *);static int hpsa_scan_finished (struct Scsi_Host *sh,unsigned long elapsed_time);
@@ -1926,7 +1925,7 @@ sglist_finished: } -static int hpsa_scsi_queue_command (struct scsi_cmnd *cmd, +static int hpsa_scsi_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ctlr_info *h;
@@ -2020,6 +2019,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (hpsa_scsi_queue_command) + static void hpsa_scan_start(struct Scsi_Host *sh) {struct ctlr_info *h =shost_to_hba (sh);
drivers/scsi/hptiop.c +3 -1
@@ -751,7 +751,7 @@ static void hptiop_post_req_mv(struct hptiop_hba *hba, MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); } -static int hptiop_queuecommand (struct scsi_cmnd *scp, +static int hptiop_queuecommand_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = scp->device->host;
@@ -819,6 +819,8 @@ cmd_done:return 0 ; } +static DEF_SCSI_QCMD (hptiop_queuecommand) + static const char *hptiop_info(struct Scsi_Host *host) {return driver_name_long;
drivers/scsi/ibmmca.c +4 -2
@@ -39,7 +39,7 @@#include <scsi/scsi_host.h> /* Common forward declarations for all Linux-versions: */ -static int ibmmca_queuecommand (Scsi_Cmnd *,void (*done) (Scsi_Cmnd *)); +static int ibmmca_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int ibmmca_abort (Scsi_Cmnd *);static int ibmmca_host_reset (Scsi_Cmnd *);static int ibmmca_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);
@@ -1691,7 +1691,7 @@ static int __devexit ibmmca_remove(struct device *dev) }/* The following routine is the SCSI command queue for the midlevel driver */ -static int ibmmca_queuecommand (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int ibmmca_queuecommand_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {unsigned int ldn;unsigned int scsi_cmd;
@@ -1996,6 +1996,8 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (ibmmca_queuecommand) + static int __ibmmca_abort(Scsi_Cmnd * cmd) {/* Abort does not work, as the adapter never generates an interrupt on
drivers/scsi/ibmvscsi/ibmvfc.c +3 -1
@@ -1606,7 +1606,7 @@ static inline int ibmvfc_host_chkready(struct ibmvfc_host *vhost)* Returns: * 0 on success / other on failure **/ -static int ibmvfc_queuecommand (struct scsi_cmnd *cmnd, +static int ibmvfc_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct ibmvfc_host *vhost =shost_priv (cmnd->device->host);
@@ -1672,6 +1672,8 @@ static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd,return 0 ; } +static DEF_SCSI_QCMD (ibmvfc_queuecommand) +/** * ibmvfc_sync_completion - Signal that a synchronous command has completed * @evt: ibmvfc event struct
drivers/scsi/ibmvscsi/ibmvscsi.c +3 -1
@@ -713,7 +713,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev)* @cmd: struct scsi_cmnd to be executed * @done: Callback function to be called when cmd is completed */ -static int ibmvscsi_queuecommand (struct scsi_cmnd *cmnd, +static int ibmvscsi_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct srp_cmd *srp_cmd;
@@ -766,6 +766,8 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,return ibmvscsi_send_srp_event (evt_struct, hostdata,0 ); } +static DEF_SCSI_QCMD (ibmvscsi_queuecommand) +/* ------------------------------------------------------------ * Routines for driver initialization */
drivers/scsi/imm.c +3 -1
@@ -926,7 +926,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)return 0 ; } -static int imm_queuecommand (struct scsi_cmnd *cmd, +static int imm_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {imm_struct *dev =imm_dev (cmd->device->host);
@@ -949,6 +949,8 @@ static int imm_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (imm_queuecommand) +/* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really
drivers/scsi/in2000.c +3 -1
@@ -334,7 +334,7 @@ static uchar calc_sync_xfer(unsigned int period, unsigned int offset)static void in2000_execute (struct Scsi_Host *instance); -static int in2000_queuecommand (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) +static int in2000_queuecommand_lck (Scsi_Cmnd * cmd,void (*done) (Scsi_Cmnd *)) {struct Scsi_Host *instance;struct IN2000_hostdata *hostdata;
@@ -431,6 +431,8 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))return 0 ; } +static DEF_SCSI_QCMD (in2000_queuecommand) +/*
drivers/scsi/in2000.h +1 -1
@@ -396,7 +396,7 @@ struct IN2000_hostdata { flags) static int in2000_detect(struct scsi_host_template *) in2000__INIT; -static int in2000_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int in2000_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int in2000_abort (Scsi_Cmnd *); static void in2000_setup(char *, int *) in2000__INIT; static int in2000_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/initio.c +3 -1
@@ -2639,7 +2639,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c* will cause the mid layer to call us again later with the command) */ -static int i91u_queuecommand (struct scsi_cmnd *cmd, +static int i91u_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
@@ -2656,6 +2656,8 @@ static int i91u_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (i91u_queuecommand) +/** * i91u_bus_reset - reset the SCSI bus * @cmnd: Command block we want to trigger the reset for
drivers/scsi/ipr.c +3 -1
@@ -5709,7 +5709,7 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy **/ -static int ipr_queuecommand (struct scsi_cmnd *scsi_cmd, +static int ipr_queuecommand_lck (struct scsi_cmnd *scsi_cmd,void (*done) (struct scsi_cmnd *)) {struct ipr_ioa_cfg *ioa_cfg;
@@ -5792,6 +5792,8 @@ static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd,return 0 ; } +static DEF_SCSI_QCMD (ipr_queuecommand) +/** * ipr_ioctl - IOCTL handler * @sdev: scsi device struct
drivers/scsi/ips.c +4 -2
@@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *);static int ips_release (struct Scsi_Host *);static int ips_eh_abort (struct scsi_cmnd *);static int ips_eh_reset (struct scsi_cmnd *); -static int ips_queue (struct scsi_cmnd *,void (*)(struct scsi_cmnd *)); +static int ips_queue (struct Scsi_Host *,struct scsi_cmnd *);static const char *ips_info (struct Scsi_Host *);static irqreturn_t do_ipsintr (int ,void *);static int ips_hainit (ips_ha_t *);
@@ -1046,7 +1046,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC)/* Linux obtains io_request_lock before calling this function */ /* */ /****************************************************************************/ -static int ips_queue (struct scsi_cmnd *SC ,void (*done) (struct scsi_cmnd *)) +static int ips_queue_lck (struct scsi_cmnd *SC ,void (*done) (struct scsi_cmnd *)) {ips_ha_t *ha;ips_passthru_t *pt;
@@ -1137,6 +1137,8 @@ static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))return (0 ); } +static DEF_SCSI_QCMD (ips_queue) +/****************************************************************************/ /* */ /* Routine Name: ips_biosparam */
drivers/scsi/libfc/fc_fcp.c +3 -1
@@ -1753,7 +1753,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport)* This is the i/o strategy routine, called by the SCSI layer. This routine * is called with the host_lock held. */ -int fc_queuecommand (struct scsi_cmnd *sc_cmd,void (*done)(struct scsi_cmnd *)) +static int fc_queuecommand_lck (struct scsi_cmnd *sc_cmd,void (*done)(struct scsi_cmnd *)) {struct fc_lport *lport;struct fc_rport *rport =starget_to_rport (scsi_target (sc_cmd->device));
@@ -1851,6 +1851,8 @@ out:spin_lock_irq (lport->host->host_lock);return rc; } + +DEF_SCSI_QCMD (fc_queuecommand)EXPORT_SYMBOL (fc_queuecommand);/**
drivers/scsi/libiscsi.c +3 -1
@@ -1599,7 +1599,7 @@ enum { FAILURE_SESSION_NOT_READY, }; -int iscsi_queuecommand (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) +static int iscsi_queuecommand_lck (struct scsi_cmnd *sc,void (*done)(struct scsi_cmnd *)) {struct iscsi_cls_session *cls_session;struct Scsi_Host *host;
@@ -1736,6 +1736,8 @@ fault:spin_lock (host->host_lock);return 0 ; } + +DEF_SCSI_QCMD (iscsi_queuecommand)EXPORT_SYMBOL_GPL (iscsi_queuecommand);int iscsi_change_queue_depth (struct scsi_device *sdev,int depth,int reason)
drivers/scsi/libsas/sas_scsi_host.c +3 -1
@@ -189,7 +189,7 @@ int sas_queue_up(struct sas_task *task)* Note: XXX: Remove the host unlock/lock pair when SCSI Core can * call us without holding an IRQ spinlock... */ -int sas_queuecommand(struct scsi_cmnd *cmd, +static int sas_queuecommand_lck(struct scsi_cmnd *cmd, void (*scsi_done)(struct scsi_cmnd *)) __releases(host->host_lock) __acquires(dev->sata_dev.ap->lock)
@@ -254,6 +254,8 @@ out:return res; } +DEF_SCSI_QCMD (sas_queuecommand) + static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) {struct sas_task *task =TO_SAS_TASK (cmd);
drivers/scsi/lpfc/lpfc_scsi.c +3 -1
@@ -2899,7 +2899,7 @@ void lpfc_poll_timeout(unsigned long ptr)* SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. **/ static int -lpfc_queuecommand (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) +lpfc_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done) (struct scsi_cmnd *)) {struct Scsi_Host *shost = cmnd->device->host;struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
@@ -3060,6 +3060,8 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (lpfc_queuecommand) +/** * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point * @cmnd: Pointer to scsi_cmnd data structure.
drivers/scsi/mac53c94.c +3 -1
@@ -66,7 +66,7 @@ static void cmd_done(struct fsc_state *, int result);static void set_dma_cmds (struct fsc_state *,struct scsi_cmnd *); -static int mac53c94_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int mac53c94_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct fsc_state *state;
@@ -99,6 +99,8 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *return 0 ; } +static DEF_SCSI_QCMD (mac53c94_queue) + static int mac53c94_host_reset(struct scsi_cmnd *cmd) {struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata;
drivers/scsi/megaraid.c +4 -2
@@ -366,7 +366,7 @@ mega_runpendq(adapter_t *adapter)* The command queuing entry point for the mid-layer. */ static int -megaraid_queue (Scsi_Cmnd *scmd,void (*done)(Scsi_Cmnd *)) +megaraid_queue_lck (Scsi_Cmnd *scmd,void (*done)(Scsi_Cmnd *)) {adapter_t *adapter;scb_t *scb;
@@ -409,6 +409,8 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))return busy; } +static DEF_SCSI_QCMD (megaraid_queue) +/** * mega_allocate_scb() * @adapter - pointer to our soft state
@@ -4456,7 +4458,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) scb->idx =CMDID_INT_CMDS ; -megaraid_queue (scmd, mega_internal_done); +megaraid_queue_lck (scmd, mega_internal_done);wait_for_completion (&adapter->int_waitq);
drivers/scsi/megaraid.h +1 -1
@@ -987,7 +987,7 @@ static int mega_query_adapter(adapter_t *);static int issue_scb (adapter_t *,scb_t *);static int mega_setup_mailbox (adapter_t *); -static int megaraid_queue (Scsi_Cmnd *,void (*)(Scsi_Cmnd *)); +static int megaraid_queue (struct Scsi_Host *,struct scsi_cmnd *);static scb_t *mega_build_cmd (adapter_t *,Scsi_Cmnd *,int *);static void __mega_runpendq (adapter_t *);static int issue_scb_block (adapter_t *,u_char *);
drivers/scsi/megaraid/megaraid_mbox.c +4 -3
@@ -113,8 +113,7 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *);static void megaraid_mbox_display_scb (adapter_t *,scb_t *);static void megaraid_mbox_setup_device_map (adapter_t *); -static int megaraid_queue_command (struct scsi_cmnd *, -void (*)(struct scsi_cmnd *)); +static int megaraid_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static scb_t *megaraid_mbox_build_cmd (adapter_t *,struct scsi_cmnd *,int *);static void megaraid_mbox_runpendq (adapter_t *,scb_t *); static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *,
@@ -1484,7 +1483,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)* Queue entry point for mailbox based controllers. */ static int -megaraid_queue_command (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) +megaraid_queue_command_lck (struct scsi_cmnd *scp,void (*done)(struct scsi_cmnd *)) {adapter_t *adapter;scb_t *scb;
@@ -1513,6 +1512,8 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))return if_busy; } +static DEF_SCSI_QCMD (megaraid_queue_command) +/** * megaraid_mbox_build_cmd - transform the mid-layer scsi commands * @adapter : controller's soft state
drivers/scsi/megaraid/megaraid_sas.c +3 -1
@@ -1334,7 +1334,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance)* @done: Callback entry point */ static int -megasas_queue_command (struct scsi_cmnd *scmd,void (*done) (struct scsi_cmnd *)) +megasas_queue_command_lck (struct scsi_cmnd *scmd,void (*done) (struct scsi_cmnd *)) {u32 frame_count;struct megasas_cmd *cmd;
@@ -1417,6 +1417,8 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (megasas_queue_command) + static struct megasas_instance *megasas_lookup_instance(u16 host_no) {int i;
drivers/scsi/mesh.c +3 -1
@@ -1627,7 +1627,7 @@ static void cmd_complete(struct mesh_state *ms)* Called by midlayer with host locked to queue a new * request */ -static int mesh_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int mesh_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct mesh_state *ms;
@@ -1648,6 +1648,8 @@ static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (mesh_queue) +/* * Called to handle interrupts, either call by the interrupt * handler (do_mesh_interrupt) or by other functions in
drivers/scsi/mpt2sas/mpt2sas_scsih.c +3 -1
@@ -3315,7 +3315,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)* SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full */ static int -_scsih_qcmd (struct scsi_cmnd *scmd,void (*done)(struct scsi_cmnd *)) +_scsih_qcmd_lck (struct scsi_cmnd *scmd,void (*done)(struct scsi_cmnd *)) {struct MPT2SAS_ADAPTER *ioc =shost_priv (scmd->device->host);struct MPT2SAS_DEVICE *sas_device_priv_data;
@@ -3441,6 +3441,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))return SCSI_MLQUEUE_HOST_BUSY ; } +static DEF_SCSI_QCMD (_scsih_qcmd) +/** * _scsih_normalize_sense - normalize descriptor and fixed format sense data * @sense_buffer: sense data returned by target
drivers/scsi/ncr53c8xx.c +3 -1
@@ -8029,7 +8029,7 @@ static int ncr53c8xx_slave_configure(struct scsi_device *device)return 0 ; } -static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;unsigned long flags;
@@ -8068,6 +8068,8 @@ printk("ncr53c8xx : command successfully queued\n");return sts; } +static DEF_SCSI_QCMD (ncr53c8xx_queue_command) + irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) {unsigned long flags;
drivers/scsi/nsp32.c +4 -3
@@ -196,8 +196,7 @@ static void __exit exit_nsp32 (void);static int nsp32_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );static int nsp32_detect (struct pci_dev *pdev); -static int nsp32_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int nsp32_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static const char *nsp32_info (struct Scsi_Host *);static int nsp32_release (struct Scsi_Host *);
@@ -909,7 +908,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt)return TRUE; } -static int nsp32_queuecommand (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +static int nsp32_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;nsp32_target *target;
@@ -1050,6 +1049,8 @@ static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_return 0 ; } +static DEF_SCSI_QCMD (nsp32_queuecommand) +/* initialize asic */ static int nsp32hw_init(nsp32_hw_data *data) {
drivers/scsi/pas16.h +1 -1
@@ -118,7 +118,7 @@ static int pas16_abort(Scsi_Cmnd *);static int pas16_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int pas16_detect (struct scsi_host_template *); -static int pas16_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int pas16_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int pas16_bus_reset (Scsi_Cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/pcmcia/nsp_cs.c +3 -1
@@ -184,7 +184,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt) SCpnt->scsi_done (SCpnt); } -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, +static int nsp_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {#ifdef NSP_DEBUG
@@ -264,6 +264,8 @@ static int nsp_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (nsp_queuecommand) +/* * setup PIO FIFO transfer mode and enable/disable to data out */
drivers/scsi/pcmcia/nsp_cs.h +1 -2
@@ -299,8 +299,7 @@ static int nsp_proc_info (off_t offset, int length, int inout); -static int nsp_queuecommand (struct scsi_cmnd *SCpnt, -void (* done)(struct scsi_cmnd *SCpnt)); +static int nsp_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *SCpnt);/* Error handler */ /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
drivers/scsi/pcmcia/sym53c500_cs.c +3 -1
@@ -547,7 +547,7 @@ SYM53C500_info(struct Scsi_Host *SChost) }static int -SYM53C500_queue (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) +SYM53C500_queue_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {int i;int port_base = SCpnt->device->host->io_port;
@@ -583,6 +583,8 @@ SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (SYM53C500_queue) + static intSYM53C500_host_reset (struct scsi_cmnd *SCpnt) {
drivers/scsi/pmcraid.c +3 -1
@@ -3478,7 +3478,7 @@ static int pmcraid_copy_sglist(* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy */ -static int pmcraid_queuecommand ( +static int pmcraid_queuecommand_lck (struct scsi_cmnd *scsi_cmd,void (*done) (struct scsi_cmnd *) )
@@ -3584,6 +3584,8 @@ static int pmcraid_queuecommand(return rc; } +static DEF_SCSI_QCMD (pmcraid_queuecommand) +/** * pmcraid_open -char node "open" entry, allowed only users with admin access */
drivers/scsi/ppa.c +3 -1
@@ -798,7 +798,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)return 0 ; } -static int ppa_queuecommand (struct scsi_cmnd *cmd, +static int ppa_queuecommand_lck (struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *)) {ppa_struct *dev =ppa_dev (cmd->device->host);
@@ -821,6 +821,8 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (ppa_queuecommand) +/* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really
drivers/scsi/ps3rom.c +3 -1
@@ -211,7 +211,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev,return 0 ; } -static int ps3rom_queuecommand (struct scsi_cmnd *cmd, +static int ps3rom_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct ps3rom_private *priv =shost_priv (cmd->device->host);
@@ -260,6 +260,8 @@ static int ps3rom_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (ps3rom_queuecommand) + static int decode_lv1_status(u64 status, unsigned char *sense_key,unsigned char *asc,unsigned char *ascq) {
drivers/scsi/qla1280.c +3 -1
@@ -727,7 +727,7 @@ qla1280_info(struct Scsi_Host *host)* context which is a big NO! NO!. **************************************************************************/ static int -qla1280_queuecommand (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) +qla1280_queuecommand_lck (struct scsi_cmnd *cmd,void (*fn)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
@@ -756,6 +756,8 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))return status; } +static DEF_SCSI_QCMD (qla1280_queuecommand) + enum action {ABORT_COMMAND , DEVICE_RESET,
drivers/scsi/qla2xxx/qla_os.c +4 -3
@@ -179,8 +179,7 @@ static int qla2xxx_slave_alloc(struct scsi_device *);static int qla2xxx_scan_finished (struct Scsi_Host *,unsigned long time);static void qla2xxx_scan_start (struct Scsi_Host *);static void qla2xxx_slave_destroy (struct scsi_device *); -static int qla2xxx_queuecommand (struct scsi_cmnd *cmd, -void (*fn)(struct scsi_cmnd *)); +static int qla2xxx_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int qla2xxx_eh_abort (struct scsi_cmnd *);static int qla2xxx_eh_device_reset (struct scsi_cmnd *);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, }static int -qla2xxx_queuecommand (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +qla2xxx_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {scsi_qla_host_t *vha =shost_priv (cmd->device->host);fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
@@ -609,6 +608,8 @@ qc24_fail_command:return 0 ; } +static DEF_SCSI_QCMD (qla2xxx_queuecommand) +/* * qla2x00_eh_wait_on_command
drivers/scsi/qla4xxx/ql4_os.c +4 -3
@@ -79,8 +79,7 @@ static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc);/* * SCSI host template entry points */ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, -void (*done) (struct scsi_cmnd *)); +static int qla4xxx_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);static int qla4xxx_eh_abort (struct scsi_cmnd *cmd);static int qla4xxx_eh_device_reset (struct scsi_cmnd *cmd);static int qla4xxx_eh_target_reset (struct scsi_cmnd *cmd);
@@ -464,7 +463,7 @@ void qla4xxx_srb_compl(struct kref *ref)* completion handling). Unfortunely, it sometimes calls the scheduler * in interrupt context which is a big NO! NO!. **/ -static int qla4xxx_queuecommand (struct scsi_cmnd *cmd, +static int qla4xxx_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_qla_host *ha =to_qla_host (cmd->device->host);
@@ -538,6 +537,8 @@ qc_fail_command:return 0 ; } +static DEF_SCSI_QCMD (qla4xxx_queuecommand) +/** * qla4xxx_mem_free - frees memory allocated to adapter * @ha: Pointer to host adapter structure.
drivers/scsi/qlogicfas408.c +3 -1
@@ -439,7 +439,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)* Queued command */ -int qlogicfas408_queuecommand (struct scsi_cmnd *cmd, +static int qlogicfas408_queuecommand_lck (struct scsi_cmnd *cmd,void (*done) (struct scsi_cmnd *)) {struct qlogicfas408_priv *priv =get_priv_by_cmd (cmd);
@@ -459,6 +459,8 @@ int qlogicfas408_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +DEF_SCSI_QCMD (qlogicfas408_queuecommand) +/* * Return bios parameters */
drivers/scsi/qlogicfas408.h +1 -2
@@ -103,8 +103,7 @@ struct qlogicfas408_priv {#define get_priv_by_host (x) (struct qlogicfas408_priv *)&((x)->hostdata[0])irqreturn_t qlogicfas408_ihandl (int irq,void *dev_id); -int qlogicfas408_queuecommand (struct scsi_cmnd * cmd, -void (*done) (struct scsi_cmnd *)); +int qlogicfas408_queuecommand (struct Scsi_Host *h,struct scsi_cmnd * cmd);int qlogicfas408_biosparam (struct scsi_device * disk,struct block_device *dev,sector_t capacity,int ip[]);
drivers/scsi/qlogicpti.c +3 -1
@@ -1003,7 +1003,7 @@ static int qlogicpti_slave_configure(struct scsi_device *sdev)* * "This code must fly." -davem */ -static int qlogicpti_queuecommand (struct scsi_cmnd *Cmnd,void (*done)(struct scsi_cmnd *)) +static int qlogicpti_queuecommand_lck (struct scsi_cmnd *Cmnd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = Cmnd->device->host;struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
@@ -1052,6 +1052,8 @@ toss_command:return 1 ; } +static DEF_SCSI_QCMD (qlogicpti_queuecommand) + static int qlogicpti_return_status(struct Status_Entry *sts, int id) {int host_status =DID_ERROR ;
drivers/scsi/scsi.c +5 -13
@@ -634,12 +634,13 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)* Description: a serial number identifies a request for error recovery * and debugging purposes. Protected by the Host_Lock of host. */ -static inline void scsi_cmd_get_serial (struct Scsi_Host *host,struct scsi_cmnd *cmd) +void scsi_cmd_get_serial (struct Scsi_Host *host,struct scsi_cmnd *cmd) { cmd->serial_number = host->cmd_serial_number++;if (cmd->serial_number ==0 ) cmd->serial_number = host->cmd_serial_number++; } +EXPORT_SYMBOL (scsi_cmd_get_serial);/** * scsi_dispatch_command - Dispatch a command to the low-level driver.
@@ -651,7 +652,6 @@ static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmndint scsi_dispatch_cmd (struct scsi_cmnd *cmd) {struct Scsi_Host *host = cmd->device->host; -unsigned long flags =0 ;unsigned long timeout;int rtn =0 ;
@@ -737,23 +737,15 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) goto out; } -spin_lock_irqsave (host->host_lock, flags); -/* -* AK: unlikely race here: for some reason the timer could -* expire before the serial number is set up below. -* -* TODO: kill serial or move to blk layer -*/ -scsi_cmd_get_serial (host, cmd); -if (unlikely (host->shost_state ==SHOST_DEL )) { cmd->result = (DID_NO_CONNECT <<16 );scsi_done (cmd); }else {trace_scsi_dispatch_cmd_start (cmd); - rtn = host->hostt->queuecommand (cmd, scsi_done); + cmd->scsi_done = scsi_done; + rtn = host->hostt->queuecommand (host, cmd); } -spin_unlock_irqrestore (host->host_lock, flags); +if (rtn) {trace_scsi_dispatch_cmd_error (cmd, rtn); if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
drivers/scsi/scsi_debug.c +3 -1
@@ -3538,7 +3538,7 @@ static void sdebug_remove_adapter(void) }static -int scsi_debug_queuecommand (struct scsi_cmnd *SCpnt,done_funct_t done) +int scsi_debug_queuecommand_lck (struct scsi_cmnd *SCpnt,done_funct_t done) {unsigned char *cmd = (unsigned char *) SCpnt->cmnd;int len, k;
@@ -3884,6 +3884,8 @@ write: (delay_override ? 0 : scsi_debug_delay)); } +static DEF_SCSI_QCMD (scsi_debug_queuecommand) + static struct scsi_host_template sdebug_driver_template = { .proc_info = scsi_debug_proc_info, .proc_name = sdebug_proc_name,
drivers/scsi/scsi_error.c +2 -4
@@ -773,17 +773,15 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,struct Scsi_Host *shost = sdev->host;DECLARE_COMPLETION_ONSTACK (done);unsigned long timeleft; -unsigned long flags;struct scsi_eh_save ses;int rtn;scsi_eh_prep_cmnd (scmd, &ses, cmnd, cmnd_size, sense_bytes); shost->eh_action = &done; -spin_lock_irqsave (shost->host_lock, flags);scsi_log_send (scmd); - shost->hostt->queuecommand (scmd, scsi_eh_done); -spin_unlock_irqrestore (shost->host_lock, flags); + scmd->scsi_done = scsi_eh_done; + shost->hostt->queuecommand (shost, scmd); timeleft =wait_for_completion_timeout (&done, timeout);
drivers/scsi/stex.c +3 -1
@@ -572,7 +572,7 @@ stex_slave_destroy(struct scsi_device *sdev) }static int -stex_queuecommand (struct scsi_cmnd *cmd,void (* done)(struct scsi_cmnd *)) +stex_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct st_hba *hba;struct Scsi_Host *host;
@@ -698,6 +698,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (stex_queuecommand) + static void stex_scsi_done(struct st_ccb *ccb) {struct scsi_cmnd *cmd = ccb->cmd;
drivers/scsi/sun3_NCR5380.c +3 -1
@@ -908,7 +908,7 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags)*/ /* Only make static if a wrapper function is used */ -static int NCR5380_queue_command (struct scsi_cmnd *cmd, +static int NCR5380_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {SETUP_HOSTDATA (cmd->device->host);
@@ -1019,6 +1019,8 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (NCR5380_queue_command) +/* * Function : NCR5380_main (void) *
drivers/scsi/sun3_scsi.h +1 -2
@@ -51,8 +51,7 @@ static int sun3scsi_abort(struct scsi_cmnd *);static int sun3scsi_detect (struct scsi_host_template *);static const char *sun3scsi_info (struct Scsi_Host *);static int sun3scsi_bus_reset (struct scsi_cmnd *); -static int sun3scsi_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int sun3scsi_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int sun3scsi_release (struct Scsi_Host *);#ifndef CMD_PER_LUN
drivers/scsi/sym53c416.c +3 -1
@@ -734,7 +734,7 @@ const char *sym53c416_info(struct Scsi_Host *SChost)return info; } -int sym53c416_queuecommand (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +static int sym53c416_queuecommand_lck (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) {int base;unsigned long flags =0 ;
@@ -761,6 +761,8 @@ int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))return 0 ; } +DEF_SCSI_QCMD (sym53c416_queuecommand) + static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) {int base;
drivers/scsi/sym53c416.h +1 -1
@@ -25,7 +25,7 @@static int sym53c416_detect (struct scsi_host_template *);static const char *sym53c416_info (struct Scsi_Host *);static int sym53c416_release (struct Scsi_Host *); -static int sym53c416_queuecommand (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +static int sym53c416_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int sym53c416_host_reset (Scsi_Cmnd *);static int sym53c416_bios_param (struct scsi_device *,struct block_device *,sector_t ,int *);
drivers/scsi/sym53c8xx_2/sym_glue.c +3 -1
@@ -505,7 +505,7 @@ void sym_log_bus_error(struct Scsi_Host *shost)* queuecommand method. Entered with the host adapter lock held and * interrupts disabled. */ -static int sym53c8xx_queue_command (struct scsi_cmnd *cmd, +static int sym53c8xx_queue_command_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct sym_hcb *np =SYM_SOFTC_PTR (cmd);
@@ -536,6 +536,8 @@ static int sym53c8xx_queue_command(struct scsi_cmnd *cmd,return 0 ; } +static DEF_SCSI_QCMD (sym53c8xx_queue_command) +/* * Linux entry point of the interrupt handler. */
drivers/scsi/t128.h +1 -2
@@ -96,8 +96,7 @@ static int t128_abort(struct scsi_cmnd *);static int t128_biosparam (struct scsi_device *,struct block_device *,sector_t ,int *);static int t128_detect (struct scsi_host_template *); -static int t128_queue_command (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int t128_queue_command (struct Scsi_Host *,struct scsi_cmnd *);static int t128_bus_reset (struct scsi_cmnd *);#ifndef CMD_PER_LUN
drivers/scsi/tmscsim.c +3 -1
@@ -1883,7 +1883,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB )return ; } -static int DC390_queuecommand (struct scsi_cmnd *cmd, +static int DC390_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *sdev = cmd->device;
@@ -1944,6 +1944,8 @@ static int DC390_queuecommand(struct scsi_cmnd *cmd,return SCSI_MLQUEUE_DEVICE_BUSY ; } +static DEF_SCSI_QCMD (DC390_queuecommand) + static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) {struct pci_dev *pdev;
drivers/scsi/u14-34f.c +4 -2
@@ -433,7 +433,7 @@static int u14_34f_detect (struct scsi_host_template *);static int u14_34f_release (struct Scsi_Host *); -static int u14_34f_queuecommand (struct scsi_cmnd *,void (*done)(struct scsi_cmnd *)); +static int u14_34f_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int u14_34f_eh_abort (struct scsi_cmnd *);static int u14_34f_eh_host_reset (struct scsi_cmnd *); static int u14_34f_bios_param(struct scsi_device *, struct block_device *,
@@ -1248,7 +1248,7 @@ static void scsi_to_dev_dir(unsigned int i, unsigned int j) { } -static int u14_34f_queuecommand (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) { +static int u14_34f_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {unsigned int i, j, k;struct mscp *cpp;
@@ -1329,6 +1329,8 @@ static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsreturn 0 ; } +static DEF_SCSI_QCMD (u14_34f_queuecommand) + static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) {unsigned int i, j;
drivers/scsi/ultrastor.c +3 -1
@@ -700,7 +700,7 @@ static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) mscp->transfer_data_length = transfer_length; } -static int ultrastor_queuecommand (struct scsi_cmnd *SCpnt, +static int ultrastor_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done) (struct scsi_cmnd *)) {struct mscp *my_mscp;
@@ -825,6 +825,8 @@ retry:return 0 ; } +static DEF_SCSI_QCMD (ultrastor_queuecommand) +/* This code must deal with 2 cases: 1. The command has not been written to the OGM. In this case, set
drivers/scsi/ultrastor.h +1 -2
@@ -15,8 +15,7 @@static int ultrastor_detect (struct scsi_host_template *);static const char *ultrastor_info (struct Scsi_Host *shpnt); -static int ultrastor_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +static int ultrastor_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);static int ultrastor_abort (struct scsi_cmnd *);static int ultrastor_host_reset (struct scsi_cmnd *); static int ultrastor_biosparam(struct scsi_device *, struct block_device *,
drivers/scsi/vmw_pvscsi.c +3 -1
@@ -690,7 +690,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,return 0 ; } -static int pvscsi_queue (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) +static int pvscsi_queue_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct Scsi_Host *host = cmd->device->host;struct pvscsi_adapter *adapter =shost_priv (host);
@@ -719,6 +719,8 @@ static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (pvscsi_queue) + static int pvscsi_abort(struct scsi_cmnd *cmd) {struct pvscsi_adapter *adapter =shost_priv (cmd->device->host);
drivers/scsi/wd33c93.c +4 -2
@@ -371,8 +371,8 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast, msg[1 ] = offset; } -int -wd33c93_queuecommand (struct scsi_cmnd *cmd, +static int +wd33c93_queuecommand_lck (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)) {struct WD33C93_hostdata *hostdata;
@@ -468,6 +468,8 @@ wd33c93_queuecommand(struct scsi_cmnd *cmd,return 0 ; } +DEF_SCSI_QCMD (wd33c93_queuecommand) +/* * This routine attempts to start a scsi command. If the host_card is * already connected, we give up immediately. Otherwise, look through
drivers/scsi/wd33c93.h +1 -2
@@ -343,8 +343,7 @@ struct WD33C93_hostdata {void wd33c93_init (struct Scsi_Host *instance,const wd33c93_regs regs,dma_setup_t setup,dma_stop_t stop,int clock_freq);int wd33c93_abort (struct scsi_cmnd *cmd); -int wd33c93_queuecommand (struct scsi_cmnd *cmd, -void (*done)(struct scsi_cmnd *)); +int wd33c93_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *cmd);void wd33c93_intr (struct Scsi_Host *instance);int wd33c93_proc_info (struct Scsi_Host *,char *,char **,off_t ,int ,int );int wd33c93_host_reset (struct scsi_cmnd *);
drivers/scsi/wd7000.c +3 -1
@@ -1082,7 +1082,7 @@ static irqreturn_t wd7000_intr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int wd7000_queuecommand (struct scsi_cmnd *SCpnt, +static int wd7000_queuecommand_lck (struct scsi_cmnd *SCpnt,void (*done)(struct scsi_cmnd *)) {Scb *scb;
@@ -1139,6 +1139,8 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,return 0 ; } +static DEF_SCSI_QCMD (wd7000_queuecommand) + static int wd7000_diagnostics(Adapter * host, int code) {static IcbDiag icb = {ICB_OP_DIAGNOSTICS };
drivers/staging/hv/storvsc_drv.c +4 -3
@@ -72,8 +72,7 @@ struct storvsc_driver_context {/* Static decl */ static int storvsc_probe (struct device *dev); -static int storvsc_queuecommand (struct scsi_cmnd *scmnd, -void (*done)(struct scsi_cmnd *)); +static int storvsc_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *scmnd);static int storvsc_device_alloc (struct scsi_device *);static int storvsc_device_configure (struct scsi_device *);static int storvsc_host_reset_handler (struct scsi_cmnd *scmnd);
@@ -595,7 +594,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl,/* * storvsc_queuecommand - Initiate command processing */ -static int storvsc_queuecommand (struct scsi_cmnd *scmnd, +static int storvsc_queuecommand_lck (struct scsi_cmnd *scmnd,void (*done)(struct scsi_cmnd *)) {int ret;
@@ -783,6 +782,8 @@ retry_request:return ret; } +static DEF_SCSI_QCMD (storvsc_queuecommand) + static int storvsc_merge_bvec(struct request_queue *q,struct bvec_merge_data *bmd,struct bio_vec *bvec) {
drivers/staging/keucr/scsiglue.c +3 -1
@@ -87,7 +87,7 @@ static int slave_configure(struct scsi_device *sdev)/* This is always called with scsi_lock(host) held */ //----- queuecommand() --------------------- -static int queuecommand (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) +static int queuecommand_lck (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) {struct us_data *us =host_to_us (srb->device->host);
@@ -117,6 +117,8 @@ static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *))return 0 ; } +static DEF_SCSI_QCMD (queuecommand) +/*********************************************************************** * Error handling functions ***********************************************************************/
drivers/usb/image/microtek.c +4 -2
@@ -364,7 +364,7 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb) }static int -mts_scsi_queuecommand (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback); +mts_scsi_queuecommand (struct Scsi_Host *shost,struct scsi_cmnd *srb);static void mts_transfer_cleanup (struct urb *transfer );static void mts_do_sg (struct urb * transfer);
@@ -573,7 +573,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)static int -mts_scsi_queuecommand (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback) +mts_scsi_queuecommand_lck (struct scsi_cmnd *srb,mts_scsi_cmnd_callback callback) {struct mts_desc * desc = (struct mts_desc *)(srb->device->host->hostdata[0 ]);int err =0 ;
@@ -626,6 +626,8 @@ out:return err; } +static DEF_SCSI_QCMD (mts_scsi_queuecommand) + static struct scsi_host_template mts_scsi_host_template = { .module =THIS_MODULE , .name ="microtekX6" ,
drivers/usb/storage/scsiglue.c +3 -1
@@ -285,7 +285,7 @@ static int slave_configure(struct scsi_device *sdev)/* queue a command */ /* This is always called with scsi_lock(host) held */ -static int queuecommand (struct scsi_cmnd *srb, +static int queuecommand_lck (struct scsi_cmnd *srb,void (*done)(struct scsi_cmnd *)) {struct us_data *us =host_to_us (srb->device->host);
@@ -315,6 +315,8 @@ static int queuecommand(struct scsi_cmnd *srb,return 0 ; } +static DEF_SCSI_QCMD (queuecommand) +/*********************************************************************** * Error handling functions ***********************************************************************/
drivers/usb/storage/uas.c +3 -1
@@ -430,7 +430,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,return 0 ; } -static int uas_queuecommand (struct scsi_cmnd *cmnd, +static int uas_queuecommand_lck (struct scsi_cmnd *cmnd,void (*done)(struct scsi_cmnd *)) {struct scsi_device *sdev = cmnd->device;
@@ -488,6 +488,8 @@ static int uas_queuecommand(struct scsi_cmnd *cmnd,return 0 ; } +static DEF_SCSI_QCMD (uas_queuecommand) + static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) {struct scsi_device *sdev = cmnd->device;
include/linux/libata.h +1 -1
@@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, unsigned long, struct ata_port_operations *);extern int ata_scsi_detect (struct scsi_host_template *sht);extern int ata_scsi_ioctl (struct scsi_device *dev,int cmd,void __user *arg); -extern int ata_scsi_queuecmd (struct scsi_cmnd *cmd,void (*done)(struct scsi_cmnd *)); +extern int ata_scsi_queuecmd (struct Scsi_Host *h,struct scsi_cmnd *cmd);extern int ata_sas_scsi_ioctl (struct ata_port *ap,struct scsi_device *dev,int cmd,void __user *arg);extern void ata_sas_port_destroy (struct ata_port *);
include/scsi/libfc.h +1 -2
@@ -1006,8 +1006,7 @@ void fc_fcp_destroy(struct fc_lport *);/* * SCSI INTERACTION LAYER *****************************/ -int fc_queuecommand (struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +int fc_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int fc_eh_abort (struct scsi_cmnd *);int fc_eh_device_reset (struct scsi_cmnd *);int fc_eh_host_reset (struct scsi_cmnd *);
include/scsi/libiscsi.h +1 -2
@@ -341,8 +341,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);extern int iscsi_eh_recover_target (struct scsi_cmnd *sc);extern int iscsi_eh_session_reset (struct scsi_cmnd *sc);extern int iscsi_eh_device_reset (struct scsi_cmnd *sc); -extern int iscsi_queuecommand (struct scsi_cmnd *sc, -void (*done)(struct scsi_cmnd *)); +extern int iscsi_queuecommand (struct Scsi_Host *h,struct scsi_cmnd *sc);/* * iSCSI host helpers.
include/scsi/libsas.h +1 -2
@@ -621,8 +621,7 @@ int sas_set_phy_speed(struct sas_phy *phy,int sas_phy_enable (struct sas_phy *phy,int enabled);int sas_phy_reset (struct sas_phy *phy,int hard_reset);int sas_queue_up (struct sas_task *task); -extern int sas_queuecommand (struct scsi_cmnd *, -void (*scsi_done)(struct scsi_cmnd *)); +extern int sas_queuecommand (struct Scsi_Host * ,struct scsi_cmnd *);extern int sas_target_alloc (struct scsi_target *);extern int sas_slave_alloc (struct scsi_device *);extern int sas_slave_configure (struct scsi_device *);
include/scsi/scsi_host.h +21 -2
@@ -127,8 +127,7 @@ struct scsi_host_template {* * STATUS: REQUIRED */ -int (* queuecommand)(struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); +int (* queuecommand)(struct Scsi_Host *,struct scsi_cmnd *);/* * The transfer functions are used to queue a scsi command to
@@ -505,6 +504,25 @@ struct scsi_host_template { };/* +* Temporary #define for host lock push down. Can be removed when all +* drivers have been updated to take advantage of unlocked +* queuecommand. +* +*/ +#define DEF_SCSI_QCMD (func_name) \ + int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ + { \ + unsigned long irq_flags; \ + int rc; \ + spin_lock_irqsave(shost->host_lock, irq_flags); \ + scsi_cmd_get_serial(shost, cmd); \ + rc = func_name##_lck (cmd, cmd->scsi_done); \ + spin_unlock_irqrestore(shost->host_lock, irq_flags); \ + return rc; \ + } + + +/* * shost state: If you alter this, you also need to alter scsi_sysfs.c * (for the ascii descriptions) and the state model enforcer: * scsi_host_set_state()
@@ -752,6 +770,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);extern void scsi_host_put (struct Scsi_Host *t);extern struct Scsi_Host *scsi_host_lookup (unsigned short );extern const char *scsi_host_state_name (enum scsi_host_state ); +extern void scsi_cmd_get_serial (struct Scsi_Host *,struct scsi_cmnd *);extern u64 scsi_calculate_bounce_limit (struct Scsi_Host *);
Re: [PATCH v5] SCSI host lock push-down
Quoted 2 lines · Jeff Garzik
and remove one parameter from queuecommand,
void (*done)(structscsi_cmnd*)
add appropriate credit to James (and willy?) for this bit...
Re: [PATCH v5] SCSI host lock push-down
In reply to Jeff GarzikQuoted 4 lines · Jeff Garzik
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.
Looks ok to me. How should I take this? Just as a patch? Or should it go through the scsi tree?
Linus
Re: [PATCH v5] SCSI host lock push-down
Quoted 8 lines · Linus Torvalds
Quoted 4 lines · Jeff Garzik
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.
Looks ok to me. How should I take this? Just as a patch? Or should it go through the scsi tree?
I was thinking through next for a few days to see if anything breaks in the architectures with scsi drivers we can't compile on x86 ... but realistically that will happen in -rcX as well, so I'm happy either way.
James
Re: [PATCH v5] SCSI host lock push-down
Quoted 4 lines · James Bottomley
I was thinking through next for a few days to see if anything breaks in the architectures with scsi drivers we can't compile on x86 ... but realistically that will happen in -rcX as well, so I'm happy either way.
I really just wanted a firm "just take the patch" or "wait for a pull", so that I can forget about this issue either way.
But it sounds like I have an ack for you, so I might as well just take the patch.
Linus
James Bottomley
Acked-byRe: [PATCH v5] SCSI host lock push-down
Quoted 7 lines · Linus Torvalds
Quoted 4 lines · James Bottomley
I was thinking through next for a few days to see if anything breaks in the architectures with scsi drivers we can't compile on x86 ... but realistically that will happen in -rcX as well, so I'm happy either way.
Quoted 5 lines
I really just wanted a firm "just take the patch" or "wait for a pull", so that I can forget about this issue either way.
But it sounds like I have an ack for you, so I might as well just take the patch.
You do ... if you need it formally:
James
Re: [PATCH v5] SCSI host lock push-down
In reply to Linus TorvaldsQuoted 8 lines · Linus Torvalds
Quoted 4 lines · Jeff Garzik
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.
Looks ok to me. How should I take this? Just as a patch? Or should it go through the scsi tree?
Directly as a single patch (v5), if James acks; otherwise through jejb/scsi-rc-fixes.git I would presume.
Jeff