diff options
| author | Hannes Reinecke <hare@suse.de> | 2015-01-08 01:43:44 -0500 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 09:44:29 -0500 |
| commit | 9e5ed2a5b3662c6f398023042c02aaa527099a3d (patch) | |
| tree | 494155845e8fd696e96642bd08667e48038e31d8 /include/scsi | |
| parent | aa66ab35f2b31e96f4b60e675b2d6ffc51d472eb (diff) | |
scsi: use external buffer for command logging
Use an external buffer for __scsi_print_command() and move command
logging over to use the per-cpu logging buffer. With that we can
guarantee the command always will always be formatted in one line.
So we can even print out a variable length command correctly across
several lines. Finally rename __scsi_print_command() to
__scsi_format_comment() to better reflect the functionality.
Tested-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/scsi')
| -rw-r--r-- | include/scsi/scsi.h | 3 | ||||
| -rw-r--r-- | include/scsi/scsi_dbg.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 8a7f8ad58aac..d0a66aa1868d 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
| @@ -195,6 +195,9 @@ enum scsi_timeouts { | |||
| 195 | #define ATA_16 0x85 /* 16-byte pass-thru */ | 195 | #define ATA_16 0x85 /* 16-byte pass-thru */ |
| 196 | #define ATA_12 0xa1 /* 12-byte pass-thru */ | 196 | #define ATA_12 0xa1 /* 12-byte pass-thru */ |
| 197 | 197 | ||
| 198 | /* Vendor specific CDBs start here */ | ||
| 199 | #define VENDOR_SPECIFIC_CDB 0xc0 | ||
| 200 | |||
| 198 | /* | 201 | /* |
| 199 | * SCSI command lengths | 202 | * SCSI command lengths |
| 200 | */ | 203 | */ |
diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h index 7982795df595..c7ed7b81b338 100644 --- a/include/scsi/scsi_dbg.h +++ b/include/scsi/scsi_dbg.h | |||
| @@ -5,8 +5,12 @@ struct scsi_cmnd; | |||
| 5 | struct scsi_device; | 5 | struct scsi_device; |
| 6 | struct scsi_sense_hdr; | 6 | struct scsi_sense_hdr; |
| 7 | 7 | ||
| 8 | #define SCSI_LOG_BUFSIZE 128 | ||
| 9 | |||
| 10 | extern bool scsi_opcode_sa_name(int, int, const char **, const char **); | ||
| 8 | extern void scsi_print_command(struct scsi_cmnd *); | 11 | extern void scsi_print_command(struct scsi_cmnd *); |
| 9 | extern void __scsi_print_command(const unsigned char *, size_t); | 12 | extern size_t __scsi_format_command(char *, size_t, |
| 13 | const unsigned char *, size_t); | ||
| 10 | extern void scsi_show_extd_sense(const struct scsi_device *, const char *, | 14 | extern void scsi_show_extd_sense(const struct scsi_device *, const char *, |
| 11 | unsigned char, unsigned char); | 15 | unsigned char, unsigned char); |
| 12 | extern void scsi_show_sense_hdr(const struct scsi_device *, const char *, | 16 | extern void scsi_show_sense_hdr(const struct scsi_device *, const char *, |
