Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89706
b: refs/heads/master
c: 0f65e95
h: refs/heads/master
v: v3
  • Loading branch information
Martin Peschke authored and James Bottomley committed Apr 7, 2008
1 parent 87ea06d commit 2bbc3dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c15450e33d198334291d50b5a95337c6b90cdab0
refs/heads/master: 0f65e951ee0c4a7506c6c0489b59a6fb1d2f0e75
39 changes: 10 additions & 29 deletions trunk/drivers/s390/scsi/zfcp_dbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,38 +562,19 @@ _zfcp_san_dbf_event_common_els(const char *tag, int level,
{
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);
}

Expand Down

0 comments on commit 2bbc3dd

Please sign in to comment.