diff options
author | Christoph Hellwig <hch@lst.de> | 2008-11-05 09:03:15 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-02 11:51:44 -0500 |
commit | fa9907810bf733ef48b0cd50023b03b78f983434 (patch) | |
tree | 93abfd78bf6a1807b4614e740018512a07bf9dba /drivers/scsi/scsi_error.c | |
parent | 327d0c7d89319a8ee8e946b90cb94c08daadb723 (diff) |
[SCSI] clean up scsi_times_out
Make sure the control flow in scsi_times_out makes sense.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 381838ebd460..7484e4317efb 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -124,34 +124,22 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag) | |||
124 | enum blk_eh_timer_return scsi_times_out(struct request *req) | 124 | enum blk_eh_timer_return scsi_times_out(struct request *req) |
125 | { | 125 | { |
126 | struct scsi_cmnd *scmd = req->special; | 126 | struct scsi_cmnd *scmd = req->special; |
127 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); | ||
128 | enum blk_eh_timer_return rtn = BLK_EH_NOT_HANDLED; | 127 | enum blk_eh_timer_return rtn = BLK_EH_NOT_HANDLED; |
129 | 128 | ||
130 | scsi_log_completion(scmd, TIMEOUT_ERROR); | 129 | scsi_log_completion(scmd, TIMEOUT_ERROR); |
131 | 130 | ||
132 | if (scmd->device->host->transportt->eh_timed_out) | 131 | if (scmd->device->host->transportt->eh_timed_out) |
133 | eh_timed_out = scmd->device->host->transportt->eh_timed_out; | 132 | rtn = scmd->device->host->transportt->eh_timed_out(scmd); |
134 | else if (scmd->device->host->hostt->eh_timed_out) | 133 | else if (scmd->device->host->hostt->eh_timed_out) |
135 | eh_timed_out = scmd->device->host->hostt->eh_timed_out; | 134 | rtn = scmd->device->host->hostt->eh_timed_out(scmd); |
136 | else | ||
137 | eh_timed_out = NULL; | ||
138 | 135 | ||
139 | if (eh_timed_out) { | 136 | if (unlikely(rtn == BLK_EH_NOT_HANDLED && |
140 | rtn = eh_timed_out(scmd); | 137 | !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) { |
141 | switch (rtn) { | ||
142 | case BLK_EH_NOT_HANDLED: | ||
143 | break; | ||
144 | default: | ||
145 | return rtn; | ||
146 | } | ||
147 | } | ||
148 | |||
149 | if (unlikely(!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) { | ||
150 | scmd->result |= DID_TIME_OUT << 16; | 138 | scmd->result |= DID_TIME_OUT << 16; |
151 | return BLK_EH_HANDLED; | 139 | rtn = BLK_EH_HANDLED; |
152 | } | 140 | } |
153 | 141 | ||
154 | return BLK_EH_NOT_HANDLED; | 142 | return rtn; |
155 | } | 143 | } |
156 | 144 | ||
157 | /** | 145 | /** |