diff options
author | Hannes Reinecke <hare@suse.de> | 2015-01-08 07:43:44 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 15:44:29 +0100 |
commit | 9e5ed2a5b3662c6f398023042c02aaa527099a3d (patch) | |
tree | 494155845e8fd696e96642bd08667e48038e31d8 /drivers/scsi/ch.c | |
parent | aa66ab35f2b31e96f4b60e675b2d6ffc51d472eb (diff) | |
download | lwn-9e5ed2a5b3662c6f398023042c02aaa527099a3d.tar.gz lwn-9e5ed2a5b3662c6f398023042c02aaa527099a3d.zip |
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 'drivers/scsi/ch.c')
-rw-r--r-- | drivers/scsi/ch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 6bac8a746ee2..79e462feae0a 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -195,8 +195,10 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, retry: errno = 0; if (debug) { - DPRINTK("command: "); - __scsi_print_command(cmd, cmd_len); + char logbuf[SCSI_LOG_BUFSIZE]; + + __scsi_format_command(logbuf, sizeof(logbuf), cmd, cmd_len); + DPRINTK("command: %s", logbuf); } result = scsi_execute_req(ch->device, cmd, direction, buffer, |