diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2010-12-02 09:16:15 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:24:46 -0500 |
commit | 250a1352b95e1db3216e5c5d4f4365bea5122f4a (patch) | |
tree | 24191a5b1a22662f1bdeb3c5f8420d59a8233a42 /drivers/s390/scsi/zfcp_scsi.c | |
parent | a54ca0f62f953898b05549391ac2a8a4dad6482b (diff) |
[SCSI] zfcp: Redesign of the debug tracing for SCSI records.
This patch is the continuation to redesign the zfcp tracing to a more
straight-forward and easy to extend scheme.
This patch deals with all trace records of the zfcp SCSI area.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 63529ed801eb..8c5c1c89c098 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -68,11 +68,8 @@ static int zfcp_scsi_slave_configure(struct scsi_device *sdp) | |||
68 | 68 | ||
69 | static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) | 69 | static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) |
70 | { | 70 | { |
71 | struct zfcp_adapter *adapter = | ||
72 | (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; | ||
73 | |||
74 | set_host_byte(scpnt, result); | 71 | set_host_byte(scpnt, result); |
75 | zfcp_dbf_scsi_fail_send(adapter->dbf, scpnt); | 72 | zfcp_dbf_scsi_fail_send(scpnt); |
76 | scpnt->scsi_done(scpnt); | 73 | scpnt->scsi_done(scpnt); |
77 | } | 74 | } |
78 | 75 | ||
@@ -80,7 +77,6 @@ static | |||
80 | int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) | 77 | int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) |
81 | { | 78 | { |
82 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); | 79 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); |
83 | struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; | ||
84 | struct fc_rport *rport = starget_to_rport(scsi_target(scpnt->device)); | 80 | struct fc_rport *rport = starget_to_rport(scsi_target(scpnt->device)); |
85 | int status, scsi_result, ret; | 81 | int status, scsi_result, ret; |
86 | 82 | ||
@@ -91,7 +87,7 @@ int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) | |||
91 | scsi_result = fc_remote_port_chkready(rport); | 87 | scsi_result = fc_remote_port_chkready(rport); |
92 | if (unlikely(scsi_result)) { | 88 | if (unlikely(scsi_result)) { |
93 | scpnt->result = scsi_result; | 89 | scpnt->result = scsi_result; |
94 | zfcp_dbf_scsi_fail_send(adapter->dbf, scpnt); | 90 | zfcp_dbf_scsi_fail_send(scpnt); |
95 | scpnt->scsi_done(scpnt); | 91 | scpnt->scsi_done(scpnt); |
96 | return 0; | 92 | return 0; |
97 | } | 93 | } |
@@ -182,8 +178,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
182 | old_req = zfcp_reqlist_find(adapter->req_list, old_reqid); | 178 | old_req = zfcp_reqlist_find(adapter->req_list, old_reqid); |
183 | if (!old_req) { | 179 | if (!old_req) { |
184 | write_unlock_irqrestore(&adapter->abort_lock, flags); | 180 | write_unlock_irqrestore(&adapter->abort_lock, flags); |
185 | zfcp_dbf_scsi_abort("lte1", adapter->dbf, scpnt, NULL, | 181 | zfcp_dbf_scsi_abort("abrt_or", scpnt, NULL); |
186 | old_reqid); | ||
187 | return FAILED; /* completion could be in progress */ | 182 | return FAILED; /* completion could be in progress */ |
188 | } | 183 | } |
189 | old_req->data = NULL; | 184 | old_req->data = NULL; |
@@ -198,29 +193,32 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
198 | 193 | ||
199 | zfcp_erp_wait(adapter); | 194 | zfcp_erp_wait(adapter); |
200 | ret = fc_block_scsi_eh(scpnt); | 195 | ret = fc_block_scsi_eh(scpnt); |
201 | if (ret) | 196 | if (ret) { |
197 | zfcp_dbf_scsi_abort("abrt_bl", scpnt, NULL); | ||
202 | return ret; | 198 | return ret; |
199 | } | ||
203 | if (!(atomic_read(&adapter->status) & | 200 | if (!(atomic_read(&adapter->status) & |
204 | ZFCP_STATUS_COMMON_RUNNING)) { | 201 | ZFCP_STATUS_COMMON_RUNNING)) { |
205 | zfcp_dbf_scsi_abort("nres", adapter->dbf, scpnt, NULL, | 202 | zfcp_dbf_scsi_abort("abrt_ru", scpnt, NULL); |
206 | old_reqid); | ||
207 | return SUCCESS; | 203 | return SUCCESS; |
208 | } | 204 | } |
209 | } | 205 | } |
210 | if (!abrt_req) | 206 | if (!abrt_req) { |
207 | zfcp_dbf_scsi_abort("abrt_ar", scpnt, NULL); | ||
211 | return FAILED; | 208 | return FAILED; |
209 | } | ||
212 | 210 | ||
213 | wait_for_completion(&abrt_req->completion); | 211 | wait_for_completion(&abrt_req->completion); |
214 | 212 | ||
215 | if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) | 213 | if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) |
216 | dbf_tag = "okay"; | 214 | dbf_tag = "abrt_ok"; |
217 | else if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) | 215 | else if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) |
218 | dbf_tag = "lte2"; | 216 | dbf_tag = "abrt_nn"; |
219 | else { | 217 | else { |
220 | dbf_tag = "fail"; | 218 | dbf_tag = "abrt_fa"; |
221 | retval = FAILED; | 219 | retval = FAILED; |
222 | } | 220 | } |
223 | zfcp_dbf_scsi_abort(dbf_tag, adapter->dbf, scpnt, abrt_req, old_reqid); | 221 | zfcp_dbf_scsi_abort(dbf_tag, scpnt, abrt_req); |
224 | zfcp_fsf_req_free(abrt_req); | 222 | zfcp_fsf_req_free(abrt_req); |
225 | return retval; | 223 | return retval; |
226 | } | 224 | } |