SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Jeff Garzik and committed by Linus Torvalds f281233d bdbd01ac

+347 -199
+3 -1
arch/ia64/hp/sim/simscsi.c
··· 202 202 } 203 203 204 204 static int 205 - simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 205 + simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 206 206 { 207 207 unsigned int target_id = sc->device->id; 208 208 char fname[MAX_ROOT_LEN+16]; ··· 325 325 tasklet_schedule(&simscsi_tasklet); 326 326 return 0; 327 327 } 328 + 329 + static DEF_SCSI_QCMD(simscsi_queuecommand) 328 330 329 331 static int 330 332 simscsi_host_reset (struct scsi_cmnd *sc)
+3 -1
drivers/ata/libata-scsi.c
··· 3183 3183 * Return value from __ata_scsi_queuecmd() if @cmd can be queued, 3184 3184 * 0 otherwise. 3185 3185 */ 3186 - int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 3186 + static int ata_scsi_queuecmd_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 3187 3187 { 3188 3188 struct ata_port *ap; 3189 3189 struct ata_device *dev; ··· 3210 3210 spin_lock(shost->host_lock); 3211 3211 return rc; 3212 3212 } 3213 + 3214 + DEF_SCSI_QCMD(ata_scsi_queuecmd) 3213 3215 3214 3216 /** 3215 3217 * ata_scsi_simulate - simulate SCSI command on ATA device
+5 -3
drivers/block/cciss_scsi.c
··· 62 62 int length, /* length of data in buffer */ 63 63 int func); /* 0 == read, 1 == write */ 64 64 65 - static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, 66 - void (* done)(struct scsi_cmnd *)); 65 + static int cciss_scsi_queue_command (struct Scsi_Host *h, 66 + struct scsi_cmnd *cmd); 67 67 static int cciss_eh_device_reset_handler(struct scsi_cmnd *); 68 68 static int cciss_eh_abort_handler(struct scsi_cmnd *); 69 69 ··· 1406 1406 1407 1407 1408 1408 static int 1409 - cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) 1409 + cciss_scsi_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1410 1410 { 1411 1411 ctlr_info_t *h; 1412 1412 int rc; ··· 1503 1503 /* the cmd'll come back via intr handler in complete_scsi_command() */ 1504 1504 return 0; 1505 1505 } 1506 + 1507 + static DEF_SCSI_QCMD(cciss_scsi_queue_command) 1506 1508 1507 1509 static void cciss_unregister_scsi(ctlr_info_t *h) 1508 1510 {
+3 -1
drivers/firewire/sbp2.c
··· 1468 1468 1469 1469 /* SCSI stack integration */ 1470 1470 1471 - static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) 1471 + static int sbp2_scsi_queuecommand_lck(struct scsi_cmnd *cmd, scsi_done_fn_t done) 1472 1472 { 1473 1473 struct sbp2_logical_unit *lu = cmd->device->hostdata; 1474 1474 struct fw_device *device = target_device(lu->tgt); ··· 1533 1533 kref_put(&orb->base.kref, free_orb); 1534 1534 return retval; 1535 1535 } 1536 + 1537 + static DEF_SCSI_QCMD(sbp2_scsi_queuecommand) 1536 1538 1537 1539 static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) 1538 1540 {
+3 -1
drivers/infiniband/ulp/srp/ib_srp.c
··· 1123 1123 } 1124 1124 } 1125 1125 1126 - static int srp_queuecommand(struct scsi_cmnd *scmnd, 1126 + static int srp_queuecommand_lck(struct scsi_cmnd *scmnd, 1127 1127 void (*done)(struct scsi_cmnd *)) 1128 1128 { 1129 1129 struct srp_target_port *target = host_to_target(scmnd->device->host); ··· 1195 1195 err: 1196 1196 return SCSI_MLQUEUE_HOST_BUSY; 1197 1197 } 1198 + 1199 + static DEF_SCSI_QCMD(srp_queuecommand) 1198 1200 1199 1201 static int srp_alloc_iu_bufs(struct srp_target_port *target) 1200 1202 {
+4 -3
drivers/message/fusion/mptfc.c
··· 97 97 98 98 static int mptfc_target_alloc(struct scsi_target *starget); 99 99 static int mptfc_slave_alloc(struct scsi_device *sdev); 100 - static int mptfc_qcmd(struct scsi_cmnd *SCpnt, 101 - void (*done)(struct scsi_cmnd *)); 100 + static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); 102 101 static void mptfc_target_destroy(struct scsi_target *starget); 103 102 static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); 104 103 static void __devexit mptfc_remove(struct pci_dev *pdev); ··· 649 650 } 650 651 651 652 static int 652 - mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 653 + mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 653 654 { 654 655 struct mptfc_rport_info *ri; 655 656 struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); ··· 679 680 680 681 return mptscsih_qcmd(SCpnt,done); 681 682 } 683 + 684 + static DEF_SCSI_QCMD(mptfc_qcmd) 682 685 683 686 /* 684 687 * mptfc_display_port_link_speed - displaying link speed
+3 -1
drivers/message/fusion/mptsas.c
··· 1889 1889 } 1890 1890 1891 1891 static int 1892 - mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1892 + mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1893 1893 { 1894 1894 MPT_SCSI_HOST *hd; 1895 1895 MPT_ADAPTER *ioc; ··· 1912 1912 1913 1913 return mptscsih_qcmd(SCpnt,done); 1914 1914 } 1915 + 1916 + static DEF_SCSI_QCMD(mptsas_qcmd) 1915 1917 1916 1918 /** 1917 1919 * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout
+3 -1
drivers/message/fusion/mptspi.c
··· 780 780 } 781 781 782 782 static int 783 - mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 783 + mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 784 784 { 785 785 struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); 786 786 VirtDevice *vdevice = SCpnt->device->hostdata; ··· 804 804 805 805 return mptscsih_qcmd(SCpnt,done); 806 806 } 807 + 808 + static DEF_SCSI_QCMD(mptspi_qcmd) 807 809 808 810 static void mptspi_slave_destroy(struct scsi_device *sdev) 809 811 {
+4 -2
drivers/message/i2o/i2o_scsi.c
··· 506 506 * Locks: takes the controller lock on error path only 507 507 */ 508 508 509 - static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, 509 + static int i2o_scsi_queuecommand_lck(struct scsi_cmnd *SCpnt, 510 510 void (*done) (struct scsi_cmnd *)) 511 511 { 512 512 struct i2o_controller *c; ··· 688 688 689 689 exit: 690 690 return rc; 691 - }; 691 + } 692 + 693 + static DEF_SCSI_QCMD(i2o_scsi_queuecommand) 692 694 693 695 /** 694 696 * i2o_scsi_abort - abort a running command
+3 -1
drivers/s390/scsi/zfcp_scsi.c
··· 76 76 scpnt->scsi_done(scpnt); 77 77 } 78 78 79 - static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, 79 + static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, 80 80 void (*done) (struct scsi_cmnd *)) 81 81 { 82 82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); ··· 126 126 127 127 return ret; 128 128 } 129 + 130 + static DEF_SCSI_QCMD(zfcp_scsi_queuecommand) 129 131 130 132 static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) 131 133 {
+3 -1
drivers/scsi/3w-9xxx.c
··· 1765 1765 } /* End twa_scsi_eh_reset() */ 1766 1766 1767 1767 /* This is the main scsi queue function to handle scsi opcodes */ 1768 - static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1768 + static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1769 1769 { 1770 1770 int request_id, retval; 1771 1771 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; ··· 1811 1811 out: 1812 1812 return retval; 1813 1813 } /* End twa_scsi_queue() */ 1814 + 1815 + static DEF_SCSI_QCMD(twa_scsi_queue) 1814 1816 1815 1817 /* This function hands scsi cdb's to the firmware */ 1816 1818 static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg)
+3 -1
drivers/scsi/3w-sas.c
··· 1501 1501 } /* End twl_scsi_eh_reset() */ 1502 1502 1503 1503 /* This is the main scsi queue function to handle scsi opcodes */ 1504 - static int twl_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1504 + static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1505 1505 { 1506 1506 int request_id, retval; 1507 1507 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; ··· 1535 1535 out: 1536 1536 return retval; 1537 1537 } /* End twl_scsi_queue() */ 1538 + 1539 + static DEF_SCSI_QCMD(twl_scsi_queue) 1538 1540 1539 1541 /* This function tells the controller to shut down */ 1540 1542 static void __twl_shutdown(TW_Device_Extension *tw_dev)
+3 -1
drivers/scsi/3w-xxxx.c
··· 1947 1947 } /* End tw_scsiop_test_unit_ready_complete() */ 1948 1948 1949 1949 /* This is the main scsi queue function to handle scsi opcodes */ 1950 - static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1950 + static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1951 1951 { 1952 1952 unsigned char *command = SCpnt->cmnd; 1953 1953 int request_id = 0; ··· 2022 2022 } 2023 2023 return retval; 2024 2024 } /* End tw_scsi_queue() */ 2025 + 2026 + static DEF_SCSI_QCMD(tw_scsi_queue) 2025 2027 2026 2028 /* This function is the interrupt service routine */ 2027 2029 static irqreturn_t tw_interrupt(int irq, void *dev_instance)
+5 -3
drivers/scsi/53c700.c
··· 167 167 #include "53c700_d.h" 168 168 169 169 170 - STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 170 + STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); 171 171 STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); 172 172 STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); 173 173 STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); ··· 1749 1749 return IRQ_RETVAL(handled); 1750 1750 } 1751 1751 1752 - STATIC int 1753 - NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) 1752 + static int 1753 + NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) 1754 1754 { 1755 1755 struct NCR_700_Host_Parameters *hostdata = 1756 1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; ··· 1903 1903 NCR_700_start_command(SCp); 1904 1904 return 0; 1905 1905 } 1906 + 1907 + STATIC DEF_SCSI_QCMD(NCR_700_queuecommand) 1906 1908 1907 1909 STATIC int 1908 1910 NCR_700_abort(struct scsi_cmnd * SCp)
+2 -1
drivers/scsi/BusLogic.c
··· 2807 2807 Outgoing Mailbox for execution by the associated Host Adapter. 2808 2808 */ 2809 2809 2810 - static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) 2810 + static int BusLogic_QueueCommand_lck(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) 2811 2811 { 2812 2812 struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata; 2813 2813 struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id]; ··· 2994 2994 return 0; 2995 2995 } 2996 2996 2997 + static DEF_SCSI_QCMD(BusLogic_QueueCommand) 2997 2998 2998 2999 #if 0 2999 3000 /*
+1 -1
drivers/scsi/BusLogic.h
··· 1319 1319 */ 1320 1320 1321 1321 static const char *BusLogic_DriverInfo(struct Scsi_Host *); 1322 - static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *)); 1322 + static int BusLogic_QueueCommand(struct Scsi_Host *h, struct scsi_cmnd *); 1323 1323 static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *); 1324 1324 static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int); 1325 1325 static int BusLogic_SlaveConfigure(struct scsi_device *);
+2 -1
drivers/scsi/NCR5380.c
··· 952 952 * Locks: host lock taken by caller 953 953 */ 954 954 955 - static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 955 + static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 956 956 { 957 957 struct Scsi_Host *instance = cmd->device->host; 958 958 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; ··· 1021 1021 return 0; 1022 1022 } 1023 1023 1024 + static DEF_SCSI_QCMD(NCR5380_queue_command) 1024 1025 1025 1026 /** 1026 1027 * NCR5380_main - NCR state machines
+1 -1
drivers/scsi/NCR5380.h
··· 313 313 #endif 314 314 static int NCR5380_abort(Scsi_Cmnd * cmd); 315 315 static int NCR5380_bus_reset(Scsi_Cmnd * cmd); 316 - static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)); 316 + static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 317 317 static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance, 318 318 char *buffer, char **start, off_t offset, int length, int inout); 319 319
+3 -1
drivers/scsi/NCR53c406a.c
··· 693 693 } 694 694 #endif 695 695 696 - static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 696 + static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 697 697 { 698 698 int i; 699 699 ··· 725 725 rtrc(1); 726 726 return 0; 727 727 } 728 + 729 + static DEF_SCSI_QCMD(NCR53c406a_queue) 728 730 729 731 static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) 730 732 {
+3 -1
drivers/scsi/a100u2w.c
··· 911 911 * queue the command down to the controller 912 912 */ 913 913 914 - static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 914 + static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 915 915 { 916 916 struct orc_scb *scb; 917 917 struct orc_host *host; /* Point to Host adapter control block */ ··· 929 929 orc_exec_scb(host, scb); /* Start execute SCB */ 930 930 return 0; 931 931 } 932 + 933 + static DEF_SCSI_QCMD(inia100_queue) 932 934 933 935 /***************************************************************************** 934 936 Function name : inia100_abort
+3 -1
drivers/scsi/aacraid/linit.c
··· 248 248 * TODO: unify with aac_scsi_cmd(). 249 249 */ 250 250 251 - static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 251 + static int aac_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 252 252 { 253 253 struct Scsi_Host *host = cmd->device->host; 254 254 struct aac_dev *dev = (struct aac_dev *)host->hostdata; ··· 266 266 cmd->SCp.phase = AAC_OWNER_LOWLEVEL; 267 267 return (aac_scsi_cmd(cmd) ? FAILED : 0); 268 268 } 269 + 270 + static DEF_SCSI_QCMD(aac_queuecommand) 269 271 270 272 /** 271 273 * aac_info - Returns the host adapter name
+3 -1
drivers/scsi/advansys.c
··· 9500 9500 * in the 'scp' result field. 9501 9501 */ 9502 9502 static int 9503 - advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 9503 + advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 9504 9504 { 9505 9505 struct Scsi_Host *shost = scp->device->host; 9506 9506 int asc_res, result = 0; ··· 9524 9524 9525 9525 return result; 9526 9526 } 9527 + 9528 + static DEF_SCSI_QCMD(advansys_queuecommand) 9527 9529 9528 9530 static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) 9529 9531 {
+3 -1
drivers/scsi/aha152x.c
··· 1056 1056 * queue a command 1057 1057 * 1058 1058 */ 1059 - static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 1059 + static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 1060 1060 { 1061 1061 #if 0 1062 1062 if(*SCpnt->cmnd == REQUEST_SENSE) { ··· 1069 1069 1070 1070 return aha152x_internal_queue(SCpnt, NULL, 0, done); 1071 1071 } 1072 + 1073 + static DEF_SCSI_QCMD(aha152x_queue) 1072 1074 1073 1075 1074 1076 /*
+3 -1
drivers/scsi/aha1542.c
··· 558 558 }; 559 559 } 560 560 561 - static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 561 + static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 562 562 { 563 563 unchar ahacmd = CMD_START_SCSI; 564 564 unchar direction; ··· 717 717 718 718 return 0; 719 719 } 720 + 721 + static DEF_SCSI_QCMD(aha1542_queuecommand) 720 722 721 723 /* Initialize mailboxes */ 722 724 static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
+1 -1
drivers/scsi/aha1542.h
··· 132 132 }; 133 133 134 134 static int aha1542_detect(struct scsi_host_template *); 135 - static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 135 + static int aha1542_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 136 136 static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); 137 137 static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); 138 138 static int aha1542_host_reset(Scsi_Cmnd * SCpnt);
+3 -1
drivers/scsi/aha1740.c
··· 331 331 return IRQ_RETVAL(handled); 332 332 } 333 333 334 - static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) 334 + static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) 335 335 { 336 336 unchar direction; 337 337 unchar *cmd = (unchar *) SCpnt->cmnd; ··· 502 502 printk(KERN_ALERT "aha1740_queuecommand: done can't be NULL\n"); 503 503 return 0; 504 504 } 505 + 506 + static DEF_SCSI_QCMD(aha1740_queuecommand) 505 507 506 508 /* Query the board for its irq_level and irq_type. Nothing else matters 507 509 in enhanced mode on an EISA bus. */
+3 -1
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 573 573 * Queue an SCB to the controller. 574 574 */ 575 575 static int 576 - ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 576 + ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 577 577 { 578 578 struct ahd_softc *ahd; 579 579 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); ··· 587 587 588 588 return rtn; 589 589 } 590 + 591 + static DEF_SCSI_QCMD(ahd_linux_queue) 590 592 591 593 static struct scsi_target ** 592 594 ahd_linux_target_in_softc(struct scsi_target *starget)
+3 -1
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 528 528 * Queue an SCB to the controller. 529 529 */ 530 530 static int 531 - ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 531 + ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 532 532 { 533 533 struct ahc_softc *ahc; 534 534 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); ··· 547 547 548 548 return rtn; 549 549 } 550 + 551 + static DEF_SCSI_QCMD(ahc_linux_queue) 550 552 551 553 static inline struct scsi_target ** 552 554 ahc_linux_target_in_softc(struct scsi_target *starget)
+3 -1
drivers/scsi/aic7xxx_old.c
··· 10234 10234 * Description: 10235 10235 * Queue a SCB to the controller. 10236 10236 *-F*************************************************************************/ 10237 - static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 10237 + static int aic7xxx_queue_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 10238 10238 { 10239 10239 struct aic7xxx_host *p; 10240 10240 struct aic7xxx_scb *scb; ··· 10291 10291 aic7xxx_run_waiting_queues(p); 10292 10292 return (0); 10293 10293 } 10294 + 10295 + static DEF_SCSI_QCMD(aic7xxx_queue) 10294 10296 10295 10297 /*+F************************************************************************* 10296 10298 * Function:
+4 -3
drivers/scsi/arcmsr/arcmsr_hba.c
··· 85 85 static int arcmsr_bus_reset(struct scsi_cmnd *); 86 86 static int arcmsr_bios_param(struct scsi_device *sdev, 87 87 struct block_device *bdev, sector_t capacity, int *info); 88 - static int arcmsr_queue_command(struct scsi_cmnd *cmd, 89 - void (*done) (struct scsi_cmnd *)); 88 + static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); 90 89 static int arcmsr_probe(struct pci_dev *pdev, 91 90 const struct pci_device_id *id); 92 91 static void arcmsr_remove(struct pci_dev *pdev); ··· 2080 2081 } 2081 2082 } 2082 2083 2083 - static int arcmsr_queue_command(struct scsi_cmnd *cmd, 2084 + static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, 2084 2085 void (* done)(struct scsi_cmnd *)) 2085 2086 { 2086 2087 struct Scsi_Host *host = cmd->device->host; ··· 2122 2123 arcmsr_post_ccb(acb, ccb); 2123 2124 return 0; 2124 2125 } 2126 + 2127 + static DEF_SCSI_QCMD(arcmsr_queue_command) 2125 2128 2126 2129 static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) 2127 2130 {
+3 -1
drivers/scsi/arm/acornscsi.c
··· 2511 2511 * done - function called on completion, with pointer to command descriptor 2512 2512 * Returns : 0, or < 0 on error. 2513 2513 */ 2514 - int acornscsi_queuecmd(struct scsi_cmnd *SCpnt, 2514 + static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, 2515 2515 void (*done)(struct scsi_cmnd *)) 2516 2516 { 2517 2517 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; ··· 2560 2560 } 2561 2561 return 0; 2562 2562 } 2563 + 2564 + DEF_SCSI_QCMD(acornscsi_queuecmd) 2563 2565 2564 2566 /* 2565 2567 * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result)
+7 -3
drivers/scsi/arm/fas216.c
··· 2198 2198 * Returns: 0 on success, else error. 2199 2199 * Notes: io_request_lock is held, interrupts are disabled. 2200 2200 */ 2201 - int fas216_queue_command(struct scsi_cmnd *SCpnt, 2201 + static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, 2202 2202 void (*done)(struct scsi_cmnd *)) 2203 2203 { 2204 2204 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; ··· 2240 2240 return result; 2241 2241 } 2242 2242 2243 + DEF_SCSI_QCMD(fas216_queue_command) 2244 + 2243 2245 /** 2244 2246 * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command 2245 2247 * @SCpnt: Command to wake ··· 2265 2263 * Returns: scsi result code. 2266 2264 * Notes: io_request_lock is held, interrupts are disabled. 2267 2265 */ 2268 - int fas216_noqueue_command(struct scsi_cmnd *SCpnt, 2266 + static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, 2269 2267 void (*done)(struct scsi_cmnd *)) 2270 2268 { 2271 2269 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; ··· 2279 2277 BUG_ON(info->scsi.irq != NO_IRQ); 2280 2278 2281 2279 info->internal_done = 0; 2282 - fas216_queue_command(SCpnt, fas216_internal_done); 2280 + fas216_queue_command_lck(SCpnt, fas216_internal_done); 2283 2281 2284 2282 /* 2285 2283 * This wastes time, since we can't return until the command is ··· 2311 2309 2312 2310 return 0; 2313 2311 } 2312 + 2313 + DEF_SCSI_QCMD(fas216_noqueue_command) 2314 2314 2315 2315 /* 2316 2316 * Error handler timeout function. Indicate that we timed out,
+8 -10
drivers/scsi/arm/fas216.h
··· 331 331 */ 332 332 extern int fas216_add (struct Scsi_Host *instance, struct device *dev); 333 333 334 - /* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 334 + /* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) 335 335 * Purpose : queue a command for adapter to process. 336 - * Params : SCpnt - Command to queue 337 - * done - done function to call once command is complete 336 + * Params : h - host adapter 337 + * : SCpnt - Command to queue 338 338 * Returns : 0 - success, else error 339 339 */ 340 - extern int fas216_queue_command(struct scsi_cmnd *, 341 - void (*done)(struct scsi_cmnd *)); 340 + extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 342 341 343 - /* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 342 + /* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) 344 343 * Purpose : queue a command for adapter to process, and process it to completion. 345 - * Params : SCpnt - Command to queue 346 - * done - done function to call once command is complete 344 + * Params : h - host adapter 345 + * : SCpnt - Command to queue 347 346 * Returns : 0 - success, else error 348 347 */ 349 - extern int fas216_noqueue_command(struct scsi_cmnd *, 350 - void (*done)(struct scsi_cmnd *)); 348 + extern int fas216_noqueue_command(struct Scsi_Host *, struct scsi_cmnd *) 351 349 352 350 /* Function: irqreturn_t fas216_intr (FAS216_Info *info) 353 351 * Purpose : handle interrupts from the interface to progress a command
+3 -1
drivers/scsi/atari_NCR5380.c
··· 910 910 * 911 911 */ 912 912 913 - static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 913 + static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 914 914 { 915 915 SETUP_HOSTDATA(cmd->device->host); 916 916 Scsi_Cmnd *tmp; ··· 1021 1021 NCR5380_main(NULL); 1022 1022 return 0; 1023 1023 } 1024 + 1025 + static DEF_SCSI_QCMD(NCR5380_queue_command) 1024 1026 1025 1027 /* 1026 1028 * Function : NCR5380_main (void)
-17
drivers/scsi/atari_scsi.c
··· 572 572 } 573 573 574 574 575 - /* This is the wrapper function for NCR5380_queue_command(). It just 576 - * tries to get the lock on the ST-DMA (see above) and then calls the 577 - * original function. 578 - */ 579 - 580 - #if 0 581 - int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 582 - { 583 - /* falcon_get_lock(); 584 - * ++guenther: moved to NCR5380_queue_command() to prevent 585 - * race condition, see there for an explanation. 586 - */ 587 - return NCR5380_queue_command(cmd, done); 588 - } 589 - #endif 590 - 591 - 592 575 int __init atari_scsi_detect(struct scsi_host_template *host) 593 576 { 594 577 static int called = 0;
+3 -1
drivers/scsi/atp870u.c
··· 605 605 * 606 606 * Queue a command to the ATP queue. Called with the host lock held. 607 607 */ 608 - static int atp870u_queuecommand(struct scsi_cmnd * req_p, 608 + static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, 609 609 void (*done) (struct scsi_cmnd *)) 610 610 { 611 611 unsigned char c; ··· 693 693 #endif 694 694 return 0; 695 695 } 696 + 697 + static DEF_SCSI_QCMD(atp870u_queuecommand) 696 698 697 699 /** 698 700 * send_s870 - send a command to the controller
+4 -3
drivers/scsi/bfa/bfad_im.c
··· 30 30 struct scsi_transport_template *bfad_im_scsi_transport_template; 31 31 struct scsi_transport_template *bfad_im_scsi_vport_transport_template; 32 32 static void bfad_im_itnim_work_handler(struct work_struct *work); 33 - static int bfad_im_queuecommand(struct scsi_cmnd *cmnd, 34 - void (*done)(struct scsi_cmnd *)); 33 + static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd); 35 34 static int bfad_im_slave_alloc(struct scsi_device *sdev); 36 35 static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, 37 36 struct bfad_itnim_s *itnim); ··· 1119 1120 * Scsi_Host template entry, queue a SCSI command to the BFAD. 1120 1121 */ 1121 1122 static int 1122 - bfad_im_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 1123 + bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 1123 1124 { 1124 1125 struct bfad_im_port_s *im_port = 1125 1126 (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; ··· 1185 1186 1186 1187 return 0; 1187 1188 } 1189 + 1190 + static DEF_SCSI_QCMD(bfad_im_queuecommand) 1188 1191 1189 1192 void 1190 1193 bfad_os_rport_online_wait(struct bfad_s *bfad)
+2 -1
drivers/scsi/dc395x.c
··· 1080 1080 * and is expected to be held on return. 1081 1081 * 1082 1082 **/ 1083 - static int dc395x_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1083 + static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1084 1084 { 1085 1085 struct DeviceCtlBlk *dcb; 1086 1086 struct ScsiReqBlk *srb; ··· 1154 1154 return 0; 1155 1155 } 1156 1156 1157 + static DEF_SCSI_QCMD(dc395x_queue_command) 1157 1158 1158 1159 /* 1159 1160 * Return the disk geometry for the given SCSI device.
+3 -1
drivers/scsi/dpt_i2o.c
··· 423 423 return 0; 424 424 } 425 425 426 - static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 426 + static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 427 427 { 428 428 adpt_hba* pHba = NULL; 429 429 struct adpt_device* pDev = NULL; /* dpt per device information */ ··· 490 490 } 491 491 return adpt_scsi_to_i2o(pHba, cmd, pDev); 492 492 } 493 + 494 + static DEF_SCSI_QCMD(adpt_queue) 493 495 494 496 static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, 495 497 sector_t capacity, int geom[])
+1 -1
drivers/scsi/dpti.h
··· 29 29 */ 30 30 31 31 static int adpt_detect(struct scsi_host_template * sht); 32 - static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); 32 + static int adpt_queue(struct Scsi_Host *h, struct scsi_cmnd * cmd); 33 33 static int adpt_abort(struct scsi_cmnd * cmd); 34 34 static int adpt_reset(struct scsi_cmnd* cmd); 35 35 static int adpt_release(struct Scsi_Host *host);
+1 -1
drivers/scsi/dtc.h
··· 36 36 static int dtc_biosparam(struct scsi_device *, struct block_device *, 37 37 sector_t, int*); 38 38 static int dtc_detect(struct scsi_host_template *); 39 - static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 39 + static int dtc_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 40 40 static int dtc_bus_reset(Scsi_Cmnd *); 41 41 42 42 #ifndef CMD_PER_LUN
+4 -3
drivers/scsi/eata.c
··· 505 505 506 506 static int eata2x_detect(struct scsi_host_template *); 507 507 static int eata2x_release(struct Scsi_Host *); 508 - static int eata2x_queuecommand(struct scsi_cmnd *, 509 - void (*done) (struct scsi_cmnd *)); 508 + static int eata2x_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 510 509 static int eata2x_eh_abort(struct scsi_cmnd *); 511 510 static int eata2x_eh_host_reset(struct scsi_cmnd *); 512 511 static int eata2x_bios_param(struct scsi_device *, struct block_device *, ··· 1757 1758 1758 1759 } 1759 1760 1760 - static int eata2x_queuecommand(struct scsi_cmnd *SCpnt, 1761 + static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt, 1761 1762 void (*done) (struct scsi_cmnd *)) 1762 1763 { 1763 1764 struct Scsi_Host *shost = SCpnt->device->host; ··· 1841 1842 ha->cp_stat[i] = IN_USE; 1842 1843 return 0; 1843 1844 } 1845 + 1846 + static DEF_SCSI_QCMD(eata2x_queuecommand) 1844 1847 1845 1848 static int eata2x_eh_abort(struct scsi_cmnd *SCarg) 1846 1849 {
+3 -1
drivers/scsi/eata_pio.c
··· 335 335 return 0; 336 336 } 337 337 338 - static int eata_pio_queue(struct scsi_cmnd *cmd, 338 + static int eata_pio_queue_lck(struct scsi_cmnd *cmd, 339 339 void (*done)(struct scsi_cmnd *)) 340 340 { 341 341 unsigned int x, y; ··· 437 437 438 438 return 0; 439 439 } 440 + 441 + static DEF_SCSI_QCMD(eata_pio_queue) 440 442 441 443 static int eata_pio_abort(struct scsi_cmnd *cmd) 442 444 {
+3 -1
drivers/scsi/esp_scsi.c
··· 916 916 scsi_track_queue_full(dev, lp->num_tagged - 1); 917 917 } 918 918 919 - static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 919 + static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 920 920 { 921 921 struct scsi_device *dev = cmd->device; 922 922 struct esp *esp = shost_priv(dev->host); ··· 940 940 941 941 return 0; 942 942 } 943 + 944 + static DEF_SCSI_QCMD(esp_queuecommand) 943 945 944 946 static int esp_check_gross_error(struct esp *esp) 945 947 {
+3 -1
drivers/scsi/fd_mcs.c
··· 1072 1072 return 0; 1073 1073 } 1074 1074 1075 - static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 1075 + static int fd_mcs_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 1076 1076 { 1077 1077 struct Scsi_Host *shpnt = SCpnt->device->host; 1078 1078 ··· 1121 1121 1122 1122 return 0; 1123 1123 } 1124 + 1125 + static DEF_SCSI_QCMD(fd_mcs_queue) 1124 1126 1125 1127 #if DEBUG_ABORT || DEBUG_RESET 1126 1128 static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
+3 -1
drivers/scsi/fdomain.c
··· 1419 1419 return IRQ_HANDLED; 1420 1420 } 1421 1421 1422 - static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, 1422 + static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt, 1423 1423 void (*done)(struct scsi_cmnd *)) 1424 1424 { 1425 1425 if (in_command) { ··· 1468 1468 1469 1469 return 0; 1470 1470 } 1471 + 1472 + static DEF_SCSI_QCMD(fdomain_16x0_queue) 1471 1473 1472 1474 #if DEBUG_ABORT 1473 1475 static void print_info(struct scsi_cmnd *SCpnt)
+1 -1
drivers/scsi/fnic/fnic.h
··· 246 246 void fnic_update_mac(struct fc_lport *, u8 *new); 247 247 void fnic_update_mac_locked(struct fnic *, u8 *new); 248 248 249 - int fnic_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 249 + int fnic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 250 250 int fnic_abort_cmd(struct scsi_cmnd *); 251 251 int fnic_device_reset(struct scsi_cmnd *); 252 252 int fnic_host_reset(struct scsi_cmnd *);
+3 -1
drivers/scsi/fnic/fnic_scsi.c
··· 349 349 * Routine to send a scsi cdb 350 350 * Called with host_lock held and interrupts disabled. 351 351 */ 352 - int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 352 + static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 353 353 { 354 354 struct fc_lport *lp; 355 355 struct fc_rport *rport; ··· 456 456 spin_lock(lp->host->host_lock); 457 457 return ret; 458 458 } 459 + 460 + DEF_SCSI_QCMD(fnic_queuecommand) 459 461 460 462 /* 461 463 * fnic_fcpio_fw_reset_cmpl_handler
+1 -1
drivers/scsi/g_NCR5380.h
··· 46 46 static int generic_NCR5380_abort(Scsi_Cmnd *); 47 47 static int generic_NCR5380_detect(struct scsi_host_template *); 48 48 static int generic_NCR5380_release_resources(struct Scsi_Host *); 49 - static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 49 + static int generic_NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 50 50 static int generic_NCR5380_bus_reset(Scsi_Cmnd *); 51 51 static const char* generic_NCR5380_info(struct Scsi_Host *); 52 52
+4 -2
drivers/scsi/gdth.c
··· 185 185 unsigned long arg); 186 186 187 187 static void gdth_flush(gdth_ha_str *ha); 188 - static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); 188 + static int gdth_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); 189 189 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, 190 190 struct gdth_cmndinfo *cmndinfo); 191 191 static void gdth_scsi_done(struct scsi_cmnd *scp); ··· 4004 4004 } 4005 4005 4006 4006 4007 - static int gdth_queuecommand(struct scsi_cmnd *scp, 4007 + static int gdth_queuecommand_lck(struct scsi_cmnd *scp, 4008 4008 void (*done)(struct scsi_cmnd *)) 4009 4009 { 4010 4010 gdth_ha_str *ha = shost_priv(scp->device->host); ··· 4021 4021 4022 4022 return __gdth_queuecommand(ha, scp, cmndinfo); 4023 4023 } 4024 + 4025 + static DEF_SCSI_QCMD(gdth_queuecommand) 4024 4026 4025 4027 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, 4026 4028 struct gdth_cmndinfo *cmndinfo)
+4 -3
drivers/scsi/hpsa.c
··· 143 143 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, 144 144 int cmd_type); 145 145 146 - static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 147 - void (*done)(struct scsi_cmnd *)); 146 + static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); 148 147 static void hpsa_scan_start(struct Scsi_Host *); 149 148 static int hpsa_scan_finished(struct Scsi_Host *sh, 150 149 unsigned long elapsed_time); ··· 1925 1926 } 1926 1927 1927 1928 1928 - static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 1929 + static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, 1929 1930 void (*done)(struct scsi_cmnd *)) 1930 1931 { 1931 1932 struct ctlr_info *h; ··· 2018 2019 /* the cmd'll come back via intr handler in complete_scsi_command() */ 2019 2020 return 0; 2020 2021 } 2022 + 2023 + static DEF_SCSI_QCMD(hpsa_scsi_queue_command) 2021 2024 2022 2025 static void hpsa_scan_start(struct Scsi_Host *sh) 2023 2026 {
+3 -1
drivers/scsi/hptiop.c
··· 751 751 MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); 752 752 } 753 753 754 - static int hptiop_queuecommand(struct scsi_cmnd *scp, 754 + static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, 755 755 void (*done)(struct scsi_cmnd *)) 756 756 { 757 757 struct Scsi_Host *host = scp->device->host; ··· 818 818 scp->scsi_done(scp); 819 819 return 0; 820 820 } 821 + 822 + static DEF_SCSI_QCMD(hptiop_queuecommand) 821 823 822 824 static const char *hptiop_info(struct Scsi_Host *host) 823 825 {
+4 -2
drivers/scsi/ibmmca.c
··· 39 39 #include <scsi/scsi_host.h> 40 40 41 41 /* Common forward declarations for all Linux-versions: */ 42 - static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); 42 + static int ibmmca_queuecommand (struct Scsi_Host *, struct scsi_cmnd *); 43 43 static int ibmmca_abort (Scsi_Cmnd *); 44 44 static int ibmmca_host_reset (Scsi_Cmnd *); 45 45 static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *); ··· 1691 1691 } 1692 1692 1693 1693 /* The following routine is the SCSI command queue for the midlevel driver */ 1694 - static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 1694 + static int ibmmca_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 1695 1695 { 1696 1696 unsigned int ldn; 1697 1697 unsigned int scsi_cmd; ··· 1995 1995 } 1996 1996 return 0; 1997 1997 } 1998 + 1999 + static DEF_SCSI_QCMD(ibmmca_queuecommand) 1998 2000 1999 2001 static int __ibmmca_abort(Scsi_Cmnd * cmd) 2000 2002 {
+3 -1
drivers/scsi/ibmvscsi/ibmvfc.c
··· 1606 1606 * Returns: 1607 1607 * 0 on success / other on failure 1608 1608 **/ 1609 - static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd, 1609 + static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, 1610 1610 void (*done) (struct scsi_cmnd *)) 1611 1611 { 1612 1612 struct ibmvfc_host *vhost = shost_priv(cmnd->device->host); ··· 1671 1671 done(cmnd); 1672 1672 return 0; 1673 1673 } 1674 + 1675 + static DEF_SCSI_QCMD(ibmvfc_queuecommand) 1674 1676 1675 1677 /** 1676 1678 * ibmvfc_sync_completion - Signal that a synchronous command has completed
+3 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 713 713 * @cmd: struct scsi_cmnd to be executed 714 714 * @done: Callback function to be called when cmd is completed 715 715 */ 716 - static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, 716 + static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, 717 717 void (*done) (struct scsi_cmnd *)) 718 718 { 719 719 struct srp_cmd *srp_cmd; ··· 765 765 766 766 return ibmvscsi_send_srp_event(evt_struct, hostdata, 0); 767 767 } 768 + 769 + static DEF_SCSI_QCMD(ibmvscsi_queuecommand) 768 770 769 771 /* ------------------------------------------------------------ 770 772 * Routines for driver initialization
+3 -1
drivers/scsi/imm.c
··· 926 926 return 0; 927 927 } 928 928 929 - static int imm_queuecommand(struct scsi_cmnd *cmd, 929 + static int imm_queuecommand_lck(struct scsi_cmnd *cmd, 930 930 void (*done)(struct scsi_cmnd *)) 931 931 { 932 932 imm_struct *dev = imm_dev(cmd->device->host); ··· 948 948 949 949 return 0; 950 950 } 951 + 952 + static DEF_SCSI_QCMD(imm_queuecommand) 951 953 952 954 /* 953 955 * Apparently the disk->capacity attribute is off by 1 sector
+3 -1
drivers/scsi/in2000.c
··· 334 334 335 335 static void in2000_execute(struct Scsi_Host *instance); 336 336 337 - static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 337 + static int in2000_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 338 338 { 339 339 struct Scsi_Host *instance; 340 340 struct IN2000_hostdata *hostdata; ··· 430 430 DB(DB_QUEUE_COMMAND, printk(")Q-%ld ", cmd->serial_number)) 431 431 return 0; 432 432 } 433 + 434 + static DEF_SCSI_QCMD(in2000_queuecommand) 433 435 434 436 435 437
+1 -1
drivers/scsi/in2000.h
··· 396 396 flags) 397 397 398 398 static int in2000_detect(struct scsi_host_template *) in2000__INIT; 399 - static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 399 + static int in2000_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 400 400 static int in2000_abort(Scsi_Cmnd *); 401 401 static void in2000_setup(char *, int *) in2000__INIT; 402 402 static int in2000_biosparam(struct scsi_device *, struct block_device *,
+3 -1
drivers/scsi/initio.c
··· 2639 2639 * will cause the mid layer to call us again later with the command) 2640 2640 */ 2641 2641 2642 - static int i91u_queuecommand(struct scsi_cmnd *cmd, 2642 + static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, 2643 2643 void (*done)(struct scsi_cmnd *)) 2644 2644 { 2645 2645 struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; ··· 2655 2655 initio_exec_scb(host, cmnd); 2656 2656 return 0; 2657 2657 } 2658 + 2659 + static DEF_SCSI_QCMD(i91u_queuecommand) 2658 2660 2659 2661 /** 2660 2662 * i91u_bus_reset - reset the SCSI bus
+3 -1
drivers/scsi/ipr.c
··· 5709 5709 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 5710 5710 * SCSI_MLQUEUE_HOST_BUSY if host is busy 5711 5711 **/ 5712 - static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd, 5712 + static int ipr_queuecommand_lck(struct scsi_cmnd *scsi_cmd, 5713 5713 void (*done) (struct scsi_cmnd *)) 5714 5714 { 5715 5715 struct ipr_ioa_cfg *ioa_cfg; ··· 5791 5791 5792 5792 return 0; 5793 5793 } 5794 + 5795 + static DEF_SCSI_QCMD(ipr_queuecommand) 5794 5796 5795 5797 /** 5796 5798 * ipr_ioctl - IOCTL handler
+4 -2
drivers/scsi/ips.c
··· 232 232 static int ips_release(struct Scsi_Host *); 233 233 static int ips_eh_abort(struct scsi_cmnd *); 234 234 static int ips_eh_reset(struct scsi_cmnd *); 235 - static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *)); 235 + static int ips_queue(struct Scsi_Host *, struct scsi_cmnd *); 236 236 static const char *ips_info(struct Scsi_Host *); 237 237 static irqreturn_t do_ipsintr(int, void *); 238 238 static int ips_hainit(ips_ha_t *); ··· 1046 1046 /* Linux obtains io_request_lock before calling this function */ 1047 1047 /* */ 1048 1048 /****************************************************************************/ 1049 - static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) 1049 + static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) 1050 1050 { 1051 1051 ips_ha_t *ha; 1052 1052 ips_passthru_t *pt; ··· 1136 1136 1137 1137 return (0); 1138 1138 } 1139 + 1140 + static DEF_SCSI_QCMD(ips_queue) 1139 1141 1140 1142 /****************************************************************************/ 1141 1143 /* */
+3 -1
drivers/scsi/libfc/fc_fcp.c
··· 1753 1753 * This is the i/o strategy routine, called by the SCSI layer. This routine 1754 1754 * is called with the host_lock held. 1755 1755 */ 1756 - int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) 1756 + static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) 1757 1757 { 1758 1758 struct fc_lport *lport; 1759 1759 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); ··· 1851 1851 spin_lock_irq(lport->host->host_lock); 1852 1852 return rc; 1853 1853 } 1854 + 1855 + DEF_SCSI_QCMD(fc_queuecommand) 1854 1856 EXPORT_SYMBOL(fc_queuecommand); 1855 1857 1856 1858 /**
+3 -1
drivers/scsi/libiscsi.c
··· 1599 1599 FAILURE_SESSION_NOT_READY, 1600 1600 }; 1601 1601 1602 - int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 1602 + static int iscsi_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 1603 1603 { 1604 1604 struct iscsi_cls_session *cls_session; 1605 1605 struct Scsi_Host *host; ··· 1736 1736 spin_lock(host->host_lock); 1737 1737 return 0; 1738 1738 } 1739 + 1740 + DEF_SCSI_QCMD(iscsi_queuecommand) 1739 1741 EXPORT_SYMBOL_GPL(iscsi_queuecommand); 1740 1742 1741 1743 int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
+3 -1
drivers/scsi/libsas/sas_scsi_host.c
··· 189 189 * Note: XXX: Remove the host unlock/lock pair when SCSI Core can 190 190 * call us without holding an IRQ spinlock... 191 191 */ 192 - int sas_queuecommand(struct scsi_cmnd *cmd, 192 + static int sas_queuecommand_lck(struct scsi_cmnd *cmd, 193 193 void (*scsi_done)(struct scsi_cmnd *)) 194 194 __releases(host->host_lock) 195 195 __acquires(dev->sata_dev.ap->lock) ··· 253 253 spin_lock_irq(host->host_lock); 254 254 return res; 255 255 } 256 + 257 + DEF_SCSI_QCMD(sas_queuecommand) 256 258 257 259 static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) 258 260 {
+3 -1
drivers/scsi/lpfc/lpfc_scsi.c
··· 2899 2899 * SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. 2900 2900 **/ 2901 2901 static int 2902 - lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 2902 + lpfc_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 2903 2903 { 2904 2904 struct Scsi_Host *shost = cmnd->device->host; 2905 2905 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; ··· 3059 3059 done(cmnd); 3060 3060 return 0; 3061 3061 } 3062 + 3063 + static DEF_SCSI_QCMD(lpfc_queuecommand) 3062 3064 3063 3065 /** 3064 3066 * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point
+3 -1
drivers/scsi/mac53c94.c
··· 66 66 static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); 67 67 68 68 69 - static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 69 + static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 70 70 { 71 71 struct fsc_state *state; 72 72 ··· 98 98 99 99 return 0; 100 100 } 101 + 102 + static DEF_SCSI_QCMD(mac53c94_queue) 101 103 102 104 static int mac53c94_host_reset(struct scsi_cmnd *cmd) 103 105 {
+4 -2
drivers/scsi/megaraid.c
··· 366 366 * The command queuing entry point for the mid-layer. 367 367 */ 368 368 static int 369 - megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) 369 + megaraid_queue_lck(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) 370 370 { 371 371 adapter_t *adapter; 372 372 scb_t *scb; ··· 408 408 spin_unlock_irqrestore(&adapter->lock, flags); 409 409 return busy; 410 410 } 411 + 412 + static DEF_SCSI_QCMD(megaraid_queue) 411 413 412 414 /** 413 415 * mega_allocate_scb() ··· 4458 4456 4459 4457 scb->idx = CMDID_INT_CMDS; 4460 4458 4461 - megaraid_queue(scmd, mega_internal_done); 4459 + megaraid_queue_lck(scmd, mega_internal_done); 4462 4460 4463 4461 wait_for_completion(&adapter->int_waitq); 4464 4462
+1 -1
drivers/scsi/megaraid.h
··· 987 987 static int issue_scb(adapter_t *, scb_t *); 988 988 static int mega_setup_mailbox(adapter_t *); 989 989 990 - static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); 990 + static int megaraid_queue (struct Scsi_Host *, struct scsi_cmnd *); 991 991 static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); 992 992 static void __mega_runpendq(adapter_t *); 993 993 static int issue_scb_block(adapter_t *, u_char *);
+4 -3
drivers/scsi/megaraid/megaraid_mbox.c
··· 113 113 static void megaraid_mbox_display_scb(adapter_t *, scb_t *); 114 114 static void megaraid_mbox_setup_device_map(adapter_t *); 115 115 116 - static int megaraid_queue_command(struct scsi_cmnd *, 117 - void (*)(struct scsi_cmnd *)); 116 + static int megaraid_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 118 117 static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); 119 118 static void megaraid_mbox_runpendq(adapter_t *, scb_t *); 120 119 static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, ··· 1483 1484 * Queue entry point for mailbox based controllers. 1484 1485 */ 1485 1486 static int 1486 - megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 1487 + megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 1487 1488 { 1488 1489 adapter_t *adapter; 1489 1490 scb_t *scb; ··· 1511 1512 megaraid_mbox_runpendq(adapter, scb); 1512 1513 return if_busy; 1513 1514 } 1515 + 1516 + static DEF_SCSI_QCMD(megaraid_queue_command) 1514 1517 1515 1518 /** 1516 1519 * megaraid_mbox_build_cmd - transform the mid-layer scsi commands
+3 -1
drivers/scsi/megaraid/megaraid_sas.c
··· 1334 1334 * @done: Callback entry point 1335 1335 */ 1336 1336 static int 1337 - megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) 1337 + megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) 1338 1338 { 1339 1339 u32 frame_count; 1340 1340 struct megasas_cmd *cmd; ··· 1416 1416 done(scmd); 1417 1417 return 0; 1418 1418 } 1419 + 1420 + static DEF_SCSI_QCMD(megasas_queue_command) 1419 1421 1420 1422 static struct megasas_instance *megasas_lookup_instance(u16 host_no) 1421 1423 {
+3 -1
drivers/scsi/mesh.c
··· 1627 1627 * Called by midlayer with host locked to queue a new 1628 1628 * request 1629 1629 */ 1630 - static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1630 + static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1631 1631 { 1632 1632 struct mesh_state *ms; 1633 1633 ··· 1647 1647 1648 1648 return 0; 1649 1649 } 1650 + 1651 + static DEF_SCSI_QCMD(mesh_queue) 1650 1652 1651 1653 /* 1652 1654 * Called to handle interrupts, either call by the interrupt
+3 -1
drivers/scsi/mpt2sas/mpt2sas_scsih.c
··· 3315 3315 * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full 3316 3316 */ 3317 3317 static int 3318 - _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) 3318 + _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) 3319 3319 { 3320 3320 struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 3321 3321 struct MPT2SAS_DEVICE *sas_device_priv_data; ··· 3440 3440 out: 3441 3441 return SCSI_MLQUEUE_HOST_BUSY; 3442 3442 } 3443 + 3444 + static DEF_SCSI_QCMD(_scsih_qcmd) 3443 3445 3444 3446 /** 3445 3447 * _scsih_normalize_sense - normalize descriptor and fixed format sense data
+3 -1
drivers/scsi/ncr53c8xx.c
··· 8029 8029 return 0; 8030 8030 } 8031 8031 8032 - static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) 8032 + static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 8033 8033 { 8034 8034 struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; 8035 8035 unsigned long flags; ··· 8067 8067 8068 8068 return sts; 8069 8069 } 8070 + 8071 + static DEF_SCSI_QCMD(ncr53c8xx_queue_command) 8070 8072 8071 8073 irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) 8072 8074 {
+4 -3
drivers/scsi/nsp32.c
··· 196 196 static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); 197 197 198 198 static int nsp32_detect (struct pci_dev *pdev); 199 - static int nsp32_queuecommand(struct scsi_cmnd *, 200 - void (*done)(struct scsi_cmnd *)); 199 + static int nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 201 200 static const char *nsp32_info (struct Scsi_Host *); 202 201 static int nsp32_release (struct Scsi_Host *); 203 202 ··· 908 909 return TRUE; 909 910 } 910 911 911 - static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 912 + static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 912 913 { 913 914 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; 914 915 nsp32_target *target; ··· 1048 1049 1049 1050 return 0; 1050 1051 } 1052 + 1053 + static DEF_SCSI_QCMD(nsp32_queuecommand) 1051 1054 1052 1055 /* initialize asic */ 1053 1056 static int nsp32hw_init(nsp32_hw_data *data)
+1 -1
drivers/scsi/pas16.h
··· 118 118 static int pas16_biosparam(struct scsi_device *, struct block_device *, 119 119 sector_t, int*); 120 120 static int pas16_detect(struct scsi_host_template *); 121 - static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 121 + static int pas16_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 122 122 static int pas16_bus_reset(Scsi_Cmnd *); 123 123 124 124 #ifndef CMD_PER_LUN
+3 -1
drivers/scsi/pcmcia/nsp_cs.c
··· 184 184 SCpnt->scsi_done(SCpnt); 185 185 } 186 186 187 - static int nsp_queuecommand(struct scsi_cmnd *SCpnt, 187 + static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, 188 188 void (*done)(struct scsi_cmnd *)) 189 189 { 190 190 #ifdef NSP_DEBUG ··· 263 263 #endif 264 264 return 0; 265 265 } 266 + 267 + static DEF_SCSI_QCMD(nsp_queuecommand) 266 268 267 269 /* 268 270 * setup PIO FIFO transfer mode and enable/disable to data out
+1 -2
drivers/scsi/pcmcia/nsp_cs.h
··· 299 299 off_t offset, 300 300 int length, 301 301 int inout); 302 - static int nsp_queuecommand(struct scsi_cmnd *SCpnt, 303 - void (* done)(struct scsi_cmnd *SCpnt)); 302 + static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 304 303 305 304 /* Error handler */ 306 305 /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
+3 -1
drivers/scsi/pcmcia/sym53c500_cs.c
··· 547 547 } 548 548 549 549 static int 550 - SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 550 + SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 551 551 { 552 552 int i; 553 553 int port_base = SCpnt->device->host->io_port; ··· 582 582 583 583 return 0; 584 584 } 585 + 586 + static DEF_SCSI_QCMD(SYM53C500_queue) 585 587 586 588 static int 587 589 SYM53C500_host_reset(struct scsi_cmnd *SCpnt)
+3 -1
drivers/scsi/pmcraid.c
··· 3478 3478 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 3479 3479 * SCSI_MLQUEUE_HOST_BUSY if host is busy 3480 3480 */ 3481 - static int pmcraid_queuecommand( 3481 + static int pmcraid_queuecommand_lck( 3482 3482 struct scsi_cmnd *scsi_cmd, 3483 3483 void (*done) (struct scsi_cmnd *) 3484 3484 ) ··· 3583 3583 3584 3584 return rc; 3585 3585 } 3586 + 3587 + static DEF_SCSI_QCMD(pmcraid_queuecommand) 3586 3588 3587 3589 /** 3588 3590 * pmcraid_open -char node "open" entry, allowed only users with admin access
+3 -1
drivers/scsi/ppa.c
··· 798 798 return 0; 799 799 } 800 800 801 - static int ppa_queuecommand(struct scsi_cmnd *cmd, 801 + static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, 802 802 void (*done) (struct scsi_cmnd *)) 803 803 { 804 804 ppa_struct *dev = ppa_dev(cmd->device->host); ··· 820 820 821 821 return 0; 822 822 } 823 + 824 + static DEF_SCSI_QCMD(ppa_queuecommand) 823 825 824 826 /* 825 827 * Apparently the disk->capacity attribute is off by 1 sector
+3 -1
drivers/scsi/ps3rom.c
··· 211 211 return 0; 212 212 } 213 213 214 - static int ps3rom_queuecommand(struct scsi_cmnd *cmd, 214 + static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, 215 215 void (*done)(struct scsi_cmnd *)) 216 216 { 217 217 struct ps3rom_private *priv = shost_priv(cmd->device->host); ··· 259 259 260 260 return 0; 261 261 } 262 + 263 + static DEF_SCSI_QCMD(ps3rom_queuecommand) 262 264 263 265 static int decode_lv1_status(u64 status, unsigned char *sense_key, 264 266 unsigned char *asc, unsigned char *ascq)
+3 -1
drivers/scsi/qla1280.c
··· 727 727 * context which is a big NO! NO!. 728 728 **************************************************************************/ 729 729 static int 730 - qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 730 + qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 731 731 { 732 732 struct Scsi_Host *host = cmd->device->host; 733 733 struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; ··· 755 755 #endif 756 756 return status; 757 757 } 758 + 759 + static DEF_SCSI_QCMD(qla1280_queuecommand) 758 760 759 761 enum action { 760 762 ABORT_COMMAND,
+4 -3
drivers/scsi/qla2xxx/qla_os.c
··· 179 179 static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); 180 180 static void qla2xxx_scan_start(struct Scsi_Host *); 181 181 static void qla2xxx_slave_destroy(struct scsi_device *); 182 - static int qla2xxx_queuecommand(struct scsi_cmnd *cmd, 183 - void (*fn)(struct scsi_cmnd *)); 182 + static int qla2xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); 184 183 static int qla2xxx_eh_abort(struct scsi_cmnd *); 185 184 static int qla2xxx_eh_device_reset(struct scsi_cmnd *); 186 185 static int qla2xxx_eh_target_reset(struct scsi_cmnd *); ··· 534 535 } 535 536 536 537 static int 537 - qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 538 + qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 538 539 { 539 540 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 540 541 fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; ··· 607 608 608 609 return 0; 609 610 } 611 + 612 + static DEF_SCSI_QCMD(qla2xxx_queuecommand) 610 613 611 614 612 615 /*
+4 -3
drivers/scsi/qla4xxx/ql4_os.c
··· 79 79 /* 80 80 * SCSI host template entry points 81 81 */ 82 - static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, 83 - void (*done) (struct scsi_cmnd *)); 82 + static int qla4xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); 84 83 static int qla4xxx_eh_abort(struct scsi_cmnd *cmd); 85 84 static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd); 86 85 static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd); ··· 463 464 * completion handling). Unfortunely, it sometimes calls the scheduler 464 465 * in interrupt context which is a big NO! NO!. 465 466 **/ 466 - static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, 467 + static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, 467 468 void (*done)(struct scsi_cmnd *)) 468 469 { 469 470 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); ··· 536 537 537 538 return 0; 538 539 } 540 + 541 + static DEF_SCSI_QCMD(qla4xxx_queuecommand) 539 542 540 543 /** 541 544 * qla4xxx_mem_free - frees memory allocated to adapter
+3 -1
drivers/scsi/qlogicfas408.c
··· 439 439 * Queued command 440 440 */ 441 441 442 - int qlogicfas408_queuecommand(struct scsi_cmnd *cmd, 442 + static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, 443 443 void (*done) (struct scsi_cmnd *)) 444 444 { 445 445 struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); ··· 458 458 ql_icmd(cmd); 459 459 return 0; 460 460 } 461 + 462 + DEF_SCSI_QCMD(qlogicfas408_queuecommand) 461 463 462 464 /* 463 465 * Return bios parameters
+1 -2
drivers/scsi/qlogicfas408.h
··· 103 103 #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0]) 104 104 105 105 irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id); 106 - int qlogicfas408_queuecommand(struct scsi_cmnd * cmd, 107 - void (*done) (struct scsi_cmnd *)); 106 + int qlogicfas408_queuecommand(struct Scsi_Host *h, struct scsi_cmnd * cmd); 108 107 int qlogicfas408_biosparam(struct scsi_device * disk, 109 108 struct block_device *dev, 110 109 sector_t capacity, int ip[]);
+3 -1
drivers/scsi/qlogicpti.c
··· 1003 1003 * 1004 1004 * "This code must fly." -davem 1005 1005 */ 1006 - static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) 1006 + static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) 1007 1007 { 1008 1008 struct Scsi_Host *host = Cmnd->device->host; 1009 1009 struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; ··· 1051 1051 done(Cmnd); 1052 1052 return 1; 1053 1053 } 1054 + 1055 + static DEF_SCSI_QCMD(qlogicpti_queuecommand) 1054 1056 1055 1057 static int qlogicpti_return_status(struct Status_Entry *sts, int id) 1056 1058 {
+5 -13
drivers/scsi/scsi.c
··· 634 634 * Description: a serial number identifies a request for error recovery 635 635 * and debugging purposes. Protected by the Host_Lock of host. 636 636 */ 637 - static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) 637 + void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) 638 638 { 639 639 cmd->serial_number = host->cmd_serial_number++; 640 640 if (cmd->serial_number == 0) 641 641 cmd->serial_number = host->cmd_serial_number++; 642 642 } 643 + EXPORT_SYMBOL(scsi_cmd_get_serial); 643 644 644 645 /** 645 646 * scsi_dispatch_command - Dispatch a command to the low-level driver. ··· 652 651 int scsi_dispatch_cmd(struct scsi_cmnd *cmd) 653 652 { 654 653 struct Scsi_Host *host = cmd->device->host; 655 - unsigned long flags = 0; 656 654 unsigned long timeout; 657 655 int rtn = 0; 658 656 ··· 737 737 goto out; 738 738 } 739 739 740 - spin_lock_irqsave(host->host_lock, flags); 741 - /* 742 - * AK: unlikely race here: for some reason the timer could 743 - * expire before the serial number is set up below. 744 - * 745 - * TODO: kill serial or move to blk layer 746 - */ 747 - scsi_cmd_get_serial(host, cmd); 748 - 749 740 if (unlikely(host->shost_state == SHOST_DEL)) { 750 741 cmd->result = (DID_NO_CONNECT << 16); 751 742 scsi_done(cmd); 752 743 } else { 753 744 trace_scsi_dispatch_cmd_start(cmd); 754 - rtn = host->hostt->queuecommand(cmd, scsi_done); 745 + cmd->scsi_done = scsi_done; 746 + rtn = host->hostt->queuecommand(host, cmd); 755 747 } 756 - spin_unlock_irqrestore(host->host_lock, flags); 748 + 757 749 if (rtn) { 758 750 trace_scsi_dispatch_cmd_error(cmd, rtn); 759 751 if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
+3 -1
drivers/scsi/scsi_debug.c
··· 3538 3538 } 3539 3539 3540 3540 static 3541 - int scsi_debug_queuecommand(struct scsi_cmnd *SCpnt, done_funct_t done) 3541 + int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done) 3542 3542 { 3543 3543 unsigned char *cmd = (unsigned char *) SCpnt->cmnd; 3544 3544 int len, k; ··· 3883 3883 return schedule_resp(SCpnt, devip, done, errsts, 3884 3884 (delay_override ? 0 : scsi_debug_delay)); 3885 3885 } 3886 + 3887 + static DEF_SCSI_QCMD(scsi_debug_queuecommand) 3886 3888 3887 3889 static struct scsi_host_template sdebug_driver_template = { 3888 3890 .proc_info = scsi_debug_proc_info,
+2 -4
drivers/scsi/scsi_error.c
··· 773 773 struct Scsi_Host *shost = sdev->host; 774 774 DECLARE_COMPLETION_ONSTACK(done); 775 775 unsigned long timeleft; 776 - unsigned long flags; 777 776 struct scsi_eh_save ses; 778 777 int rtn; 779 778 780 779 scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); 781 780 shost->eh_action = &done; 782 781 783 - spin_lock_irqsave(shost->host_lock, flags); 784 782 scsi_log_send(scmd); 785 - shost->hostt->queuecommand(scmd, scsi_eh_done); 786 - spin_unlock_irqrestore(shost->host_lock, flags); 783 + scmd->scsi_done = scsi_eh_done; 784 + shost->hostt->queuecommand(shost, scmd); 787 785 788 786 timeleft = wait_for_completion_timeout(&done, timeout); 789 787
+3 -1
drivers/scsi/stex.c
··· 572 572 } 573 573 574 574 static int 575 - stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) 575 + stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 576 576 { 577 577 struct st_hba *hba; 578 578 struct Scsi_Host *host; ··· 697 697 hba->send(hba, req, tag); 698 698 return 0; 699 699 } 700 + 701 + static DEF_SCSI_QCMD(stex_queuecommand) 700 702 701 703 static void stex_scsi_done(struct st_ccb *ccb) 702 704 {
+3 -1
drivers/scsi/sun3_NCR5380.c
··· 908 908 */ 909 909 910 910 /* Only make static if a wrapper function is used */ 911 - static int NCR5380_queue_command(struct scsi_cmnd *cmd, 911 + static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd, 912 912 void (*done)(struct scsi_cmnd *)) 913 913 { 914 914 SETUP_HOSTDATA(cmd->device->host); ··· 1018 1018 NCR5380_main(NULL); 1019 1019 return 0; 1020 1020 } 1021 + 1022 + static DEF_SCSI_QCMD(NCR5380_queue_command) 1021 1023 1022 1024 /* 1023 1025 * Function : NCR5380_main (void)
+1 -2
drivers/scsi/sun3_scsi.h
··· 51 51 static int sun3scsi_detect (struct scsi_host_template *); 52 52 static const char *sun3scsi_info (struct Scsi_Host *); 53 53 static int sun3scsi_bus_reset(struct scsi_cmnd *); 54 - static int sun3scsi_queue_command(struct scsi_cmnd *, 55 - void (*done)(struct scsi_cmnd *)); 54 + static int sun3scsi_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 56 55 static int sun3scsi_release (struct Scsi_Host *); 57 56 58 57 #ifndef CMD_PER_LUN
+3 -1
drivers/scsi/sym53c416.c
··· 734 734 return info; 735 735 } 736 736 737 - int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 737 + static int sym53c416_queuecommand_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 738 738 { 739 739 int base; 740 740 unsigned long flags = 0; ··· 760 760 spin_unlock_irqrestore(&sym53c416_lock, flags); 761 761 return 0; 762 762 } 763 + 764 + DEF_SCSI_QCMD(sym53c416_queuecommand) 763 765 764 766 static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) 765 767 {
+1 -1
drivers/scsi/sym53c416.h
··· 25 25 static int sym53c416_detect(struct scsi_host_template *); 26 26 static const char *sym53c416_info(struct Scsi_Host *); 27 27 static int sym53c416_release(struct Scsi_Host *); 28 - static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 28 + static int sym53c416_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 29 29 static int sym53c416_host_reset(Scsi_Cmnd *); 30 30 static int sym53c416_bios_param(struct scsi_device *, struct block_device *, 31 31 sector_t, int *);
+3 -1
drivers/scsi/sym53c8xx_2/sym_glue.c
··· 505 505 * queuecommand method. Entered with the host adapter lock held and 506 506 * interrupts disabled. 507 507 */ 508 - static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, 508 + static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, 509 509 void (*done)(struct scsi_cmnd *)) 510 510 { 511 511 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); ··· 535 535 return SCSI_MLQUEUE_HOST_BUSY; 536 536 return 0; 537 537 } 538 + 539 + static DEF_SCSI_QCMD(sym53c8xx_queue_command) 538 540 539 541 /* 540 542 * Linux entry point of the interrupt handler.
+1 -2
drivers/scsi/t128.h
··· 96 96 static int t128_biosparam(struct scsi_device *, struct block_device *, 97 97 sector_t, int*); 98 98 static int t128_detect(struct scsi_host_template *); 99 - static int t128_queue_command(struct scsi_cmnd *, 100 - void (*done)(struct scsi_cmnd *)); 99 + static int t128_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 101 100 static int t128_bus_reset(struct scsi_cmnd *); 102 101 103 102 #ifndef CMD_PER_LUN
+3 -1
drivers/scsi/tmscsim.c
··· 1883 1883 return; 1884 1884 } 1885 1885 1886 - static int DC390_queuecommand(struct scsi_cmnd *cmd, 1886 + static int DC390_queuecommand_lck(struct scsi_cmnd *cmd, 1887 1887 void (*done)(struct scsi_cmnd *)) 1888 1888 { 1889 1889 struct scsi_device *sdev = cmd->device; ··· 1943 1943 device_busy: 1944 1944 return SCSI_MLQUEUE_DEVICE_BUSY; 1945 1945 } 1946 + 1947 + static DEF_SCSI_QCMD(DC390_queuecommand) 1946 1948 1947 1949 static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) 1948 1950 {
+4 -2
drivers/scsi/u14-34f.c
··· 433 433 434 434 static int u14_34f_detect(struct scsi_host_template *); 435 435 static int u14_34f_release(struct Scsi_Host *); 436 - static int u14_34f_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 436 + static int u14_34f_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 437 437 static int u14_34f_eh_abort(struct scsi_cmnd *); 438 438 static int u14_34f_eh_host_reset(struct scsi_cmnd *); 439 439 static int u14_34f_bios_param(struct scsi_device *, struct block_device *, ··· 1248 1248 1249 1249 } 1250 1250 1251 - static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { 1251 + static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { 1252 1252 unsigned int i, j, k; 1253 1253 struct mscp *cpp; 1254 1254 ··· 1328 1328 HD(j)->cp_stat[i] = IN_USE; 1329 1329 return 0; 1330 1330 } 1331 + 1332 + static DEF_SCSI_QCMD(u14_34f_queuecommand) 1331 1333 1332 1334 static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) { 1333 1335 unsigned int i, j;
+3 -1
drivers/scsi/ultrastor.c
··· 700 700 mscp->transfer_data_length = transfer_length; 701 701 } 702 702 703 - static int ultrastor_queuecommand(struct scsi_cmnd *SCpnt, 703 + static int ultrastor_queuecommand_lck(struct scsi_cmnd *SCpnt, 704 704 void (*done) (struct scsi_cmnd *)) 705 705 { 706 706 struct mscp *my_mscp; ··· 824 824 825 825 return 0; 826 826 } 827 + 828 + static DEF_SCSI_QCMD(ultrastor_queuecommand) 827 829 828 830 /* This code must deal with 2 cases: 829 831
+1 -2
drivers/scsi/ultrastor.h
··· 15 15 16 16 static int ultrastor_detect(struct scsi_host_template *); 17 17 static const char *ultrastor_info(struct Scsi_Host *shpnt); 18 - static int ultrastor_queuecommand(struct scsi_cmnd *, 19 - void (*done)(struct scsi_cmnd *)); 18 + static int ultrastor_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 20 19 static int ultrastor_abort(struct scsi_cmnd *); 21 20 static int ultrastor_host_reset(struct scsi_cmnd *); 22 21 static int ultrastor_biosparam(struct scsi_device *, struct block_device *,
+3 -1
drivers/scsi/vmw_pvscsi.c
··· 690 690 return 0; 691 691 } 692 692 693 - static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 693 + static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 694 694 { 695 695 struct Scsi_Host *host = cmd->device->host; 696 696 struct pvscsi_adapter *adapter = shost_priv(host); ··· 718 718 719 719 return 0; 720 720 } 721 + 722 + static DEF_SCSI_QCMD(pvscsi_queue) 721 723 722 724 static int pvscsi_abort(struct scsi_cmnd *cmd) 723 725 {
+4 -2
drivers/scsi/wd33c93.c
··· 371 371 msg[1] = offset; 372 372 } 373 373 374 - int 375 - wd33c93_queuecommand(struct scsi_cmnd *cmd, 374 + static int 375 + wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, 376 376 void (*done)(struct scsi_cmnd *)) 377 377 { 378 378 struct WD33C93_hostdata *hostdata; ··· 467 467 spin_unlock_irq(&hostdata->lock); 468 468 return 0; 469 469 } 470 + 471 + DEF_SCSI_QCMD(wd33c93_queuecommand) 470 472 471 473 /* 472 474 * This routine attempts to start a scsi command. If the host_card is
+1 -2
drivers/scsi/wd33c93.h
··· 343 343 void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, 344 344 dma_setup_t setup, dma_stop_t stop, int clock_freq); 345 345 int wd33c93_abort (struct scsi_cmnd *cmd); 346 - int wd33c93_queuecommand (struct scsi_cmnd *cmd, 347 - void (*done)(struct scsi_cmnd *)); 346 + int wd33c93_queuecommand (struct Scsi_Host *h, struct scsi_cmnd *cmd); 348 347 void wd33c93_intr (struct Scsi_Host *instance); 349 348 int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); 350 349 int wd33c93_host_reset (struct scsi_cmnd *);
+3 -1
drivers/scsi/wd7000.c
··· 1082 1082 return IRQ_HANDLED; 1083 1083 } 1084 1084 1085 - static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, 1085 + static int wd7000_queuecommand_lck(struct scsi_cmnd *SCpnt, 1086 1086 void (*done)(struct scsi_cmnd *)) 1087 1087 { 1088 1088 Scb *scb; ··· 1138 1138 1139 1139 return 0; 1140 1140 } 1141 + 1142 + static DEF_SCSI_QCMD(wd7000_queuecommand) 1141 1143 1142 1144 static int wd7000_diagnostics(Adapter * host, int code) 1143 1145 {
+4 -3
drivers/staging/hv/storvsc_drv.c
··· 72 72 73 73 /* Static decl */ 74 74 static int storvsc_probe(struct device *dev); 75 - static int storvsc_queuecommand(struct scsi_cmnd *scmnd, 76 - void (*done)(struct scsi_cmnd *)); 75 + static int storvsc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd); 77 76 static int storvsc_device_alloc(struct scsi_device *); 78 77 static int storvsc_device_configure(struct scsi_device *); 79 78 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); ··· 594 595 /* 595 596 * storvsc_queuecommand - Initiate command processing 596 597 */ 597 - static int storvsc_queuecommand(struct scsi_cmnd *scmnd, 598 + static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, 598 599 void (*done)(struct scsi_cmnd *)) 599 600 { 600 601 int ret; ··· 781 782 782 783 return ret; 783 784 } 785 + 786 + static DEF_SCSI_QCMD(storvsc_queuecommand) 784 787 785 788 static int storvsc_merge_bvec(struct request_queue *q, 786 789 struct bvec_merge_data *bmd, struct bio_vec *bvec)
+3 -1
drivers/staging/keucr/scsiglue.c
··· 87 87 88 88 /* This is always called with scsi_lock(host) held */ 89 89 //----- queuecommand() --------------------- 90 - static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) 90 + static int queuecommand_lck(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) 91 91 { 92 92 struct us_data *us = host_to_us(srb->device->host); 93 93 ··· 116 116 117 117 return 0; 118 118 } 119 + 120 + static DEF_SCSI_QCMD(queuecommand) 119 121 120 122 /*********************************************************************** 121 123 * Error handling functions
+4 -2
drivers/usb/image/microtek.c
··· 364 364 } 365 365 366 366 static int 367 - mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback); 367 + mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb); 368 368 369 369 static void mts_transfer_cleanup( struct urb *transfer ); 370 370 static void mts_do_sg(struct urb * transfer); ··· 573 573 574 574 575 575 static int 576 - mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) 576 + mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) 577 577 { 578 578 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); 579 579 int err = 0; ··· 625 625 out: 626 626 return err; 627 627 } 628 + 629 + static DEF_SCSI_QCMD(mts_scsi_queuecommand) 628 630 629 631 static struct scsi_host_template mts_scsi_host_template = { 630 632 .module = THIS_MODULE,
+3 -1
drivers/usb/storage/scsiglue.c
··· 285 285 286 286 /* queue a command */ 287 287 /* This is always called with scsi_lock(host) held */ 288 - static int queuecommand(struct scsi_cmnd *srb, 288 + static int queuecommand_lck(struct scsi_cmnd *srb, 289 289 void (*done)(struct scsi_cmnd *)) 290 290 { 291 291 struct us_data *us = host_to_us(srb->device->host); ··· 314 314 315 315 return 0; 316 316 } 317 + 318 + static DEF_SCSI_QCMD(queuecommand) 317 319 318 320 /*********************************************************************** 319 321 * Error handling functions
+3 -1
drivers/usb/storage/uas.c
··· 430 430 return 0; 431 431 } 432 432 433 - static int uas_queuecommand(struct scsi_cmnd *cmnd, 433 + static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, 434 434 void (*done)(struct scsi_cmnd *)) 435 435 { 436 436 struct scsi_device *sdev = cmnd->device; ··· 487 487 488 488 return 0; 489 489 } 490 + 491 + static DEF_SCSI_QCMD(uas_queuecommand) 490 492 491 493 static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) 492 494 {
+1 -1
include/linux/libata.h
··· 986 986 unsigned long, struct ata_port_operations *); 987 987 extern int ata_scsi_detect(struct scsi_host_template *sht); 988 988 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 989 - extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 989 + extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); 990 990 extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, 991 991 int cmd, void __user *arg); 992 992 extern void ata_sas_port_destroy(struct ata_port *);
+1 -2
include/scsi/libfc.h
··· 1006 1006 /* 1007 1007 * SCSI INTERACTION LAYER 1008 1008 *****************************/ 1009 - int fc_queuecommand(struct scsi_cmnd *, 1010 - void (*done)(struct scsi_cmnd *)); 1009 + int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 1011 1010 int fc_eh_abort(struct scsi_cmnd *); 1012 1011 int fc_eh_device_reset(struct scsi_cmnd *); 1013 1012 int fc_eh_host_reset(struct scsi_cmnd *);
+1 -2
include/scsi/libiscsi.h
··· 341 341 extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); 342 342 extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); 343 343 extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); 344 - extern int iscsi_queuecommand(struct scsi_cmnd *sc, 345 - void (*done)(struct scsi_cmnd *)); 344 + extern int iscsi_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *sc); 346 345 347 346 /* 348 347 * iSCSI host helpers.
+1 -2
include/scsi/libsas.h
··· 621 621 int sas_phy_enable(struct sas_phy *phy, int enabled); 622 622 int sas_phy_reset(struct sas_phy *phy, int hard_reset); 623 623 int sas_queue_up(struct sas_task *task); 624 - extern int sas_queuecommand(struct scsi_cmnd *, 625 - void (*scsi_done)(struct scsi_cmnd *)); 624 + extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *); 626 625 extern int sas_target_alloc(struct scsi_target *); 627 626 extern int sas_slave_alloc(struct scsi_device *); 628 627 extern int sas_slave_configure(struct scsi_device *);
+21 -2
include/scsi/scsi_host.h
··· 127 127 * 128 128 * STATUS: REQUIRED 129 129 */ 130 - int (* queuecommand)(struct scsi_cmnd *, 131 - void (*done)(struct scsi_cmnd *)); 130 + int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); 132 131 133 132 /* 134 133 * The transfer functions are used to queue a scsi command to ··· 504 505 }; 505 506 506 507 /* 508 + * Temporary #define for host lock push down. Can be removed when all 509 + * drivers have been updated to take advantage of unlocked 510 + * queuecommand. 511 + * 512 + */ 513 + #define DEF_SCSI_QCMD(func_name) \ 514 + int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ 515 + { \ 516 + unsigned long irq_flags; \ 517 + int rc; \ 518 + spin_lock_irqsave(shost->host_lock, irq_flags); \ 519 + scsi_cmd_get_serial(shost, cmd); \ 520 + rc = func_name##_lck (cmd, cmd->scsi_done); \ 521 + spin_unlock_irqrestore(shost->host_lock, irq_flags); \ 522 + return rc; \ 523 + } 524 + 525 + 526 + /* 507 527 * shost state: If you alter this, you also need to alter scsi_sysfs.c 508 528 * (for the ascii descriptions) and the state model enforcer: 509 529 * scsi_host_set_state() ··· 770 752 extern void scsi_host_put(struct Scsi_Host *t); 771 753 extern struct Scsi_Host *scsi_host_lookup(unsigned short); 772 754 extern const char *scsi_host_state_name(enum scsi_host_state); 755 + extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); 773 756 774 757 extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 775 758