All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
	Martin Peschke <mp3@de.ibm.com>,
	Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 02/11] zfcp: Clean up _zfcp_san_dbf_event_common_els
Date: Thu, 27 Mar 2008 14:21:56 +0100	[thread overview]
Message-ID: <20080327133023.786277000@de.ibm.com> (raw)
In-Reply-To: 20080327132154.826339000@de.ibm.com

[-- Attachment #1: zfcp_san_dbf_simplify_els_hex_dump.diff --]
[-- Type: text/plain, Size: 2231 bytes --]

From: Martin Peschke <mp3@de.ibm.com>

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>
---
 drivers/s390/scsi/zfcp_dbf.c |   39 ++++++++++-----------------------------
 1 file changed, 10 insertions(+), 29 deletions(-)

--- 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 cha
 {
 	struct zfcp_adapter *adapter = fsf_req->adapter;
 	struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf;
-	struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
 	unsigned long flags;
-	int offset = 0;
 
 	spin_lock_irqsave(&adapter->san_dbf_lock, flags);
-	do {
-		memset(rec, 0, sizeof(struct zfcp_san_dbf_record));
-		if (offset == 0) {
-			strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
-			rec->fsf_reqid = (unsigned long)fsf_req;
-			rec->fsf_seqno = fsf_req->seq_no;
-			rec->s_id = s_id;
-			rec->d_id = d_id;
-			rec->type.els.ls_code = ls_code;
-			buflen = min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD);
-			rec->type.els.payload_size = buflen;
-			memcpy(rec->type.els.payload,
-			       buffer, min(buflen, ZFCP_DBF_ELS_PAYLOAD));
-			offset += min(buflen, ZFCP_DBF_ELS_PAYLOAD);
-		} else {
-			strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
-			dump->total_size = buflen;
-			dump->offset = offset;
-			dump->size = min(buflen - offset,
-					 (int)sizeof(struct zfcp_san_dbf_record)
-					 - (int)sizeof(struct zfcp_dbf_dump));
-			memcpy(dump->data, buffer + offset, dump->size);
-			offset += dump->size;
-		}
-		debug_event(adapter->san_dbf, level,
-			    rec, sizeof(struct zfcp_san_dbf_record));
-	} while (offset < buflen);
+	memset(rec, 0, sizeof(struct zfcp_san_dbf_record));
+	strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
+	rec->fsf_reqid = (unsigned long)fsf_req;
+	rec->fsf_seqno = fsf_req->seq_no;
+	rec->s_id = s_id;
+	rec->d_id = d_id;
+	rec->type.els.ls_code = ls_code;
+	debug_event(adapter->san_dbf, level, rec, sizeof(*rec));
+	zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level,
+			 buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD));
 	spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
 }
 

-- 

  parent reply	other threads:[~2008-03-27 13:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 13:21 [patch 00/11] zfcp debug trace update Christof Schmitt
2008-03-27 13:21 ` [patch 01/11] zfcp: Introduce a helper function that dumps hex data to a zfcp trace Christof Schmitt
2008-03-27 13:21 ` Christof Schmitt [this message]
2008-03-27 13:21 ` [patch 03/11] zfcp: Remove qtcb dump to kernel log Christof Schmitt
2008-03-27 13:21 ` [patch 04/11] zfcp: Add qtcb dump to hba debug trace Christof Schmitt
2008-03-27 13:21 ` [patch 05/11] zfcp: Introduce printf helper functions for " Christof Schmitt
2008-03-27 13:22 ` [patch 06/11] zfcp: Register new recovery trace Christof Schmitt
2008-03-27 13:22 ` [patch 07/11] zfcp: Add trace records for recovery thread and its queues Christof Schmitt
2008-03-27 13:22 ` [patch 08/11] zfcp: Add traces for state changes Christof Schmitt
2008-03-27 14:20   ` Heiko Carstens
2008-03-27 14:31     ` Martin Peschke
2008-03-27 13:22 ` [patch 09/11] zfcp: Trace all triggers of error recovery activity Christof Schmitt
2008-03-27 13:22 ` [patch 10/11] zfcp: Add trace records for recovery actions Christof Schmitt
2008-03-27 13:22 ` [patch 11/11] zfcp: Remove obsolete erp_dbf trace Christof Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080327133023.786277000@de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mp3@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.