From: michaelc@cs.wisc.edu Subject: [PATCH 15/23] Drop host lock in queuecommand Date: Tue, 4 Dec 2007 18:42:29 -0600 Message-ID: <11968153842186-git-send-email-michaelc@cs.wisc.edu> References: <11968153574025-git-send-email-michaelc@cs.wisc.edu> <119681536472-git-send-email-michaelc@cs.wisc.edu> <11968153663560-git-send-email-michaelc@cs.wisc.edu> <11968153713324-git-send-email-michaelc@cs.wisc.edu> <11968153753743-git-send-email-michaelc@cs.wisc.edu> <11968153751098-git-send-email-michaelc@cs.wisc.edu> <1196815376111-git-send-email-michaelc@cs.wisc.edu> <1196815377131-git-send-email-michaelc@cs.wisc.edu> <11968153781126-git-send-email-michaelc@cs.wisc.edu> <1196815378769-git-send-email-michaelc@cs.wisc.edu> <11968153791438-git-send-email-michaelc@cs.wisc.edu> <11968153801823-git-send-email-michaelc@cs.wisc.edu> <11968153812001-git-send-email-michaelc@cs.wisc.edu> <1196815382808-git-send-email-michaelc@cs.wisc.edu> <11968153831244-git-send-email-michaelc@cs.wisc.edu> Return-path: Received: from mx1.redhat.com ([66.187.233.31]:42631 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbXLEAnK (ORCPT ); Tue, 4 Dec 2007 19:43:10 -0500 In-Reply-To: <11968153831244-git-send-email-michaelc@cs.wisc.edu> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: linux-scsi@vger.kernel.org Cc: Mike Christie From: Mike Christie The driver does not need the host lock in queuecommand so drop it. Signed-off-by: Mike Christie --- drivers/scsi/libiscsi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 4461317..b0bc8c3 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1010,8 +1010,9 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) sc->SCp.ptr = NULL; host = sc->device->host; - session = iscsi_hostdata(host->hostdata); + spin_unlock(host->host_lock); + session = iscsi_hostdata(host->hostdata); spin_lock(&session->lock); /* @@ -1077,11 +1078,13 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) spin_unlock(&session->lock); scsi_queue_work(host, &conn->xmitwork); + spin_lock(host->host_lock); return 0; reject: spin_unlock(&session->lock); debug_scsi("cmd 0x%x rejected (%d)\n", sc->cmnd[0], reason); + spin_lock(host->host_lock); return SCSI_MLQUEUE_HOST_BUSY; fault: @@ -1091,6 +1094,7 @@ fault: sc->result = (DID_NO_CONNECT << 16); scsi_set_resid(sc, scsi_bufflen(sc)); sc->scsi_done(sc); + spin_lock(host->host_lock); return 0; } EXPORT_SYMBOL_GPL(iscsi_queuecommand); -- 1.5.1.2