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>
Этот коммит содержится в:

коммит произвёл
Christoph Hellwig

родитель
aa66ab35f2
Коммит
9e5ed2a5b3
@@ -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,
|
||||
|
Ссылка в новой задаче
Block a user