aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2010-02-17 05:18:57 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 18:46:31 -0500
commitab72528a4498251a702fa7693b51b9311b2432f8 (patch)
tree3413362ef1838a6ddbf2ab6316685a18c547ba66 /drivers/s390/scsi
parent615f59e0daaf56e43dcaaf3ea228967d9bc21584 (diff)
[SCSI] zfcp: Move scsi result tracing decision to zfcp_dbf.h
Move the decision which trace tag and trace level to use for the scsi result trace to zfcp_dbf.h. zfcp_dbf_scsi_result is already an inline function, so move the trace code there, simplifying the response handling in zfcp_fsf.c. Reviewed-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')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h28
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c7
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c4
3 files changed, 24 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index ca841ee44c15..457e046f2d28 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -303,17 +303,31 @@ void zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
303 303
304/** 304/**
305 * zfcp_dbf_scsi_result - trace event for SCSI command completion 305 * zfcp_dbf_scsi_result - trace event for SCSI command completion
306 * @tag: tag indicating success or failure of SCSI command 306 * @dbf: adapter dbf trace
307 * @level: trace level applicable for this event
308 * @adapter: adapter that has been used to issue the SCSI command
309 * @scmd: SCSI command pointer 307 * @scmd: SCSI command pointer
310 * @fsf_req: request used to issue SCSI command (might be NULL) 308 * @req: FSF request used to issue SCSI command
311 */ 309 */
312static inline 310static inline
313void zfcp_dbf_scsi_result(const char *tag, int level, struct zfcp_dbf *dbf, 311void zfcp_dbf_scsi_result(struct zfcp_dbf *dbf, struct scsi_cmnd *scmd,
314 struct scsi_cmnd *scmd, struct zfcp_fsf_req *fsf_req) 312 struct zfcp_fsf_req *req)
315{ 313{
316 zfcp_dbf_scsi("rslt", tag, level, dbf, scmd, fsf_req, 0); 314 if (scmd->result != 0)
315 zfcp_dbf_scsi("rslt", "erro", 3, dbf, scmd, req, 0);
316 else if (scmd->retries > 0)
317 zfcp_dbf_scsi("rslt", "retr", 4, dbf, scmd, req, 0);
318 else
319 zfcp_dbf_scsi("rslt", "norm", 6, dbf, scmd, req, 0);
320}
321
322/**
323 * zfcp_dbf_scsi_fail_send - trace event for failure to send SCSI command
324 * @dbf: adapter dbf trace
325 * @scmd: SCSI command pointer
326 */
327static inline
328void zfcp_dbf_scsi_fail_send(struct zfcp_dbf *dbf, struct scsi_cmnd *scmd)
329{
330 zfcp_dbf_scsi("rslt", "fail", 4, dbf, scmd, NULL, 0);
317} 331}
318 332
319/** 333/**
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index bd4d71cdcace..1c47c495d69d 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -2156,12 +2156,7 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req)
2156 zfcp_fsf_req_trace(req, scpnt); 2156 zfcp_fsf_req_trace(req, scpnt);
2157 2157
2158skip_fsfstatus: 2158skip_fsfstatus:
2159 if (scpnt->result != 0) 2159 zfcp_dbf_scsi_result(req->adapter->dbf, scpnt, req);
2160 zfcp_dbf_scsi_result("erro", 3, req->adapter->dbf, scpnt, req);
2161 else if (scpnt->retries > 0)
2162 zfcp_dbf_scsi_result("retr", 4, req->adapter->dbf, scpnt, req);
2163 else
2164 zfcp_dbf_scsi_result("norm", 6, req->adapter->dbf, scpnt, req);
2165 2160
2166 scpnt->host_scribble = NULL; 2161 scpnt->host_scribble = NULL;
2167 (scpnt->scsi_done) (scpnt); 2162 (scpnt->scsi_done) (scpnt);
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 0d580b2fc4da..c3c4178888af 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -62,7 +62,7 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
62 (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; 62 (struct zfcp_adapter *) scpnt->device->host->hostdata[0];
63 63
64 set_host_byte(scpnt, result); 64 set_host_byte(scpnt, result);
65 zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL); 65 zfcp_dbf_scsi_fail_send(adapter->dbf, scpnt);
66 scpnt->scsi_done(scpnt); 66 scpnt->scsi_done(scpnt);
67} 67}
68 68
@@ -89,7 +89,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
89 scsi_result = fc_remote_port_chkready(rport); 89 scsi_result = fc_remote_port_chkready(rport);
90 if (unlikely(scsi_result)) { 90 if (unlikely(scsi_result)) {
91 scpnt->result = scsi_result; 91 scpnt->result = scsi_result;
92 zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL); 92 zfcp_dbf_scsi_fail_send(adapter->dbf, scpnt);
93 scpnt->scsi_done(scpnt); 93 scpnt->scsi_done(scpnt);
94 return 0; 94 return 0;
95 } 95 }