aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2011-01-28 19:04:29 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 12:02:25 -0500
commit04885b16a1ec86b4670702b99a81805e66bf9f30 (patch)
tree136525d2615f044bd1a362790529c4ac2b45cdd5 /drivers/scsi/libfc
parent925cedae2b223d44d59a02df1b35902fc8bdd6d2 (diff)
[SCSI] libfc: Remove usage of the Scsi_Host's host_lock
This patch removes the use of the Scsi_Host's host_lock within fc_queuecommand. It also removes the DEF_SCSI_QCMD usage so that libfc has fully moved on to the new queuecommand interface. Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Reviewed-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 383a98288d2e..b1b03af158bf 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1789,15 +1789,14 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport)
1789 1789
1790/** 1790/**
1791 * fc_queuecommand() - The queuecommand function of the SCSI template 1791 * fc_queuecommand() - The queuecommand function of the SCSI template
1792 * @shost: The Scsi_Host that the command was issued to
1792 * @cmd: The scsi_cmnd to be executed 1793 * @cmd: The scsi_cmnd to be executed
1793 * @done: The callback function to be called when the scsi_cmnd is complete
1794 * 1794 *
1795 * This is the i/o strategy routine, called by the SCSI layer. This routine 1795 * This is the i/o strategy routine, called by the SCSI layer.
1796 * is called with the host_lock held.
1797 */ 1796 */
1798static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) 1797int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
1799{ 1798{
1800 struct fc_lport *lport; 1799 struct fc_lport *lport = shost_priv(shost);
1801 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); 1800 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
1802 struct fc_fcp_pkt *fsp; 1801 struct fc_fcp_pkt *fsp;
1803 struct fc_rport_libfc_priv *rpriv; 1802 struct fc_rport_libfc_priv *rpriv;
@@ -1805,15 +1804,12 @@ static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scs
1805 int rc = 0; 1804 int rc = 0;
1806 struct fcoe_dev_stats *stats; 1805 struct fcoe_dev_stats *stats;
1807 1806
1808 lport = shost_priv(sc_cmd->device->host);
1809
1810 rval = fc_remote_port_chkready(rport); 1807 rval = fc_remote_port_chkready(rport);
1811 if (rval) { 1808 if (rval) {
1812 sc_cmd->result = rval; 1809 sc_cmd->result = rval;
1813 done(sc_cmd); 1810 sc_cmd->scsi_done(sc_cmd);
1814 return 0; 1811 return 0;
1815 } 1812 }
1816 spin_unlock_irq(lport->host->host_lock);
1817 1813
1818 if (!*(struct fc_remote_port **)rport->dd_data) { 1814 if (!*(struct fc_remote_port **)rport->dd_data) {
1819 /* 1815 /*
@@ -1821,7 +1817,7 @@ static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scs
1821 * online 1817 * online
1822 */ 1818 */
1823 sc_cmd->result = DID_IMM_RETRY << 16; 1819 sc_cmd->result = DID_IMM_RETRY << 16;
1824 done(sc_cmd); 1820 sc_cmd->scsi_done(sc_cmd);
1825 goto out; 1821 goto out;
1826 } 1822 }
1827 1823
@@ -1845,7 +1841,6 @@ static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scs
1845 */ 1841 */
1846 fsp->cmd = sc_cmd; /* save the cmd */ 1842 fsp->cmd = sc_cmd; /* save the cmd */
1847 fsp->rport = rport; /* set the remote port ptr */ 1843 fsp->rport = rport; /* set the remote port ptr */
1848 sc_cmd->scsi_done = done;
1849 1844
1850 /* 1845 /*
1851 * set up the transfer length 1846 * set up the transfer length
@@ -1886,11 +1881,8 @@ static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scs
1886 rc = SCSI_MLQUEUE_HOST_BUSY; 1881 rc = SCSI_MLQUEUE_HOST_BUSY;
1887 } 1882 }
1888out: 1883out:
1889 spin_lock_irq(lport->host->host_lock);
1890 return rc; 1884 return rc;
1891} 1885}
1892
1893DEF_SCSI_QCMD(fc_queuecommand)
1894EXPORT_SYMBOL(fc_queuecommand); 1886EXPORT_SYMBOL(fc_queuecommand);
1895 1887
1896/** 1888/**