aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 11:35:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 11:35:37 -0700
commitf5bcf5f44796bf30a058a01c10a61b19784f0540 (patch)
tree1c78ecbb2a21f880a1508dc2fcbbcc4b169f43f3 /drivers/scsi/scsi_transport_fc.c
parentdefe9104833b5ad309447bbc1fcb8e5981b2d3e1 (diff)
parent129dd98194747a3b8ac1ff876d8d1f2440660d01 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (38 commits) fusion: mptsas, fix lock imbalance [SCSI] scsi_transport_fc: replace BUS_ID_SIZE by fixed count sd, sr: fix Driver 'sd' needs updating message scsi_transport_iscsi: return -EOVERFLOW for Too many iscsi targets fc_transport: Selective return value from BSG timeout function fc_transport: The softirq_done function registration for BSG request sym53c8xx: ratelimit parity errors explain the hidden scsi_wait_scan Kconfig variable ibmvfc: Fix endless PRLI loop in discovery ibmvfc: Process async events before command responses libfc: Add runtime debugging with debug_logging module parameter libfcoe: Add runtime debugging with module param debug_logging fcoe: Add runtime debug logging with module parameter debug_logging scsi_debug: Add support for physical block exponent and alignment cnic: add NETDEV_1000 and NETDEVICES to Kconfig select cnic: Fix __symbol_get() build error. Revert "[SCSI] cnic: fix error: implicit declaration of function ‘__symbol_get’" ipr: differentiate pci-x and pci-e based adapters ipr: add test for MSI interrupt support scsi_transport_spi: Blacklist Ultrium-3 tape for IU transfers ...
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 3f64d93b6c8..2eee9e6e4fe 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -3397,7 +3397,6 @@ fc_destroy_bsgjob(struct fc_bsg_job *job)
kfree(job);
}
-
/**
* fc_bsg_jobdone - completion routine for bsg requests that the LLD has
* completed
@@ -3408,15 +3407,10 @@ fc_bsg_jobdone(struct fc_bsg_job *job)
{
struct request *req = job->req;
struct request *rsp = req->next_rq;
- unsigned long flags;
int err;
- spin_lock_irqsave(&job->job_lock, flags);
- job->state_flags |= FC_RQST_STATE_DONE;
- job->ref_cnt--;
- spin_unlock_irqrestore(&job->job_lock, flags);
-
err = job->req->errors = job->reply->result;
+
if (err < 0)
/* we're only returning the result field in the reply */
job->req->sense_len = sizeof(uint32_t);
@@ -3433,13 +3427,27 @@ fc_bsg_jobdone(struct fc_bsg_job *job)
rsp->resid_len -= min(job->reply->reply_payload_rcv_len,
rsp->resid_len);
}
+ blk_complete_request(req);
+}
- blk_end_request_all(req, err);
+/**
+ * fc_bsg_softirq_done - softirq done routine for destroying the bsg requests
+ * @req: BSG request that holds the job to be destroyed
+ */
+static void fc_bsg_softirq_done(struct request *rq)
+{
+ struct fc_bsg_job *job = rq->special;
+ unsigned long flags;
+ spin_lock_irqsave(&job->job_lock, flags);
+ job->state_flags |= FC_RQST_STATE_DONE;
+ job->ref_cnt--;
+ spin_unlock_irqrestore(&job->job_lock, flags);
+
+ blk_end_request_all(rq, rq->errors);
fc_destroy_bsgjob(job);
}
-
/**
* fc_bsg_job_timeout - handler for when a bsg request timesout
* @req: request that timed out
@@ -3471,19 +3479,13 @@ fc_bsg_job_timeout(struct request *req)
"abort failed with status %d\n", err);
}
- if (!done) {
- spin_lock_irqsave(&job->job_lock, flags);
- job->ref_cnt--;
- spin_unlock_irqrestore(&job->job_lock, flags);
- fc_destroy_bsgjob(job);
- }
-
/* the blk_end_sync_io() doesn't check the error */
- return BLK_EH_HANDLED;
+ if (done)
+ return BLK_EH_NOT_HANDLED;
+ else
+ return BLK_EH_HANDLED;
}
-
-
static int
fc_bsg_map_buffer(struct fc_bsg_buffer *buf, struct request *req)
{
@@ -3859,7 +3861,7 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
struct fc_internal *i = to_fc_internal(shost->transportt);
struct request_queue *q;
int err;
- char bsg_name[BUS_ID_SIZE]; /*20*/
+ char bsg_name[20];
fc_host->rqst_q = NULL;
@@ -3879,6 +3881,7 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
q->queuedata = shost;
queue_flag_set_unlocked(QUEUE_FLAG_BIDI, q);
+ blk_queue_softirq_done(q, fc_bsg_softirq_done);
blk_queue_rq_timed_out(q, fc_bsg_job_timeout);
blk_queue_rq_timeout(q, FC_DEFAULT_BSG_TIMEOUT);
@@ -3924,6 +3927,7 @@ fc_bsg_rportadd(struct Scsi_Host *shost, struct fc_rport *rport)
q->queuedata = rport;
queue_flag_set_unlocked(QUEUE_FLAG_BIDI, q);
+ blk_queue_softirq_done(q, fc_bsg_softirq_done);
blk_queue_rq_timed_out(q, fc_bsg_job_timeout);
blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT);