diff options
author | Martin Peschke <mp3@de.ibm.com> | 2008-03-27 09:21:56 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:03 -0400 |
commit | 0f65e951ee0c4a7506c6c0489b59a6fb1d2f0e75 (patch) | |
tree | 546b4e69b33cc56cd37f9e1068b77c2880ac4b37 /drivers | |
parent | c15450e33d198334291d50b5a95337c6b90cdab0 (diff) |
[SCSI] zfcp: Clean up _zfcp_san_dbf_event_common_els
Clean up _zfcp_san_dbf_event_common_els using zfcp_dbf_hexdump()
helper.
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 0faadb0cda24..5019d7b738bc 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -562,38 +562,19 @@ _zfcp_san_dbf_event_common_els(const char *tag, int level, | |||
562 | { | 562 | { |
563 | struct zfcp_adapter *adapter = fsf_req->adapter; | 563 | struct zfcp_adapter *adapter = fsf_req->adapter; |
564 | struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf; | 564 | struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf; |
565 | struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; | ||
566 | unsigned long flags; | 565 | unsigned long flags; |
567 | int offset = 0; | ||
568 | 566 | ||
569 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); | 567 | spin_lock_irqsave(&adapter->san_dbf_lock, flags); |
570 | do { | 568 | memset(rec, 0, sizeof(struct zfcp_san_dbf_record)); |
571 | memset(rec, 0, sizeof(struct zfcp_san_dbf_record)); | 569 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); |
572 | if (offset == 0) { | 570 | rec->fsf_reqid = (unsigned long)fsf_req; |
573 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); | 571 | rec->fsf_seqno = fsf_req->seq_no; |
574 | rec->fsf_reqid = (unsigned long)fsf_req; | 572 | rec->s_id = s_id; |
575 | rec->fsf_seqno = fsf_req->seq_no; | 573 | rec->d_id = d_id; |
576 | rec->s_id = s_id; | 574 | rec->type.els.ls_code = ls_code; |
577 | rec->d_id = d_id; | 575 | debug_event(adapter->san_dbf, level, rec, sizeof(*rec)); |
578 | rec->type.els.ls_code = ls_code; | 576 | zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level, |
579 | buflen = min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD); | 577 | buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD)); |
580 | rec->type.els.payload_size = buflen; | ||
581 | memcpy(rec->type.els.payload, | ||
582 | buffer, min(buflen, ZFCP_DBF_ELS_PAYLOAD)); | ||
583 | offset += min(buflen, ZFCP_DBF_ELS_PAYLOAD); | ||
584 | } else { | ||
585 | strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE); | ||
586 | dump->total_size = buflen; | ||
587 | dump->offset = offset; | ||
588 | dump->size = min(buflen - offset, | ||
589 | (int)sizeof(struct zfcp_san_dbf_record) | ||
590 | - (int)sizeof(struct zfcp_dbf_dump)); | ||
591 | memcpy(dump->data, buffer + offset, dump->size); | ||
592 | offset += dump->size; | ||
593 | } | ||
594 | debug_event(adapter->san_dbf, level, | ||
595 | rec, sizeof(struct zfcp_san_dbf_record)); | ||
596 | } while (offset < buflen); | ||
597 | spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); | 578 | spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); |
598 | } | 579 | } |
599 | 580 | ||