summaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2007-02-27 22:40:27 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-03-11 11:17:49 -0500
commita4d04a4cd9881e89fdc62107b6b57053438f2b30 (patch)
tree79deaf3e73439105f5b824eb7a7f00b7e8afc934 /include/scsi/scsi_device.h
parent684b7fe976554d12e6266d7280c87a0f3feff02e (diff)
downloadop-kernel-dev-a4d04a4cd9881e89fdc62107b6b57053438f2b30.zip
op-kernel-dev-a4d04a4cd9881e89fdc62107b6b57053438f2b30.tar.gz
[SCSI] Make error printing more verbose
This patch enhances SCSI error printing by: - Making use of scsi_print_result() in the completion functions. - Having scmd_printk() output the disk name (when applicable). Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 9dd37e2..c86e6ce 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -5,6 +5,7 @@
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
+#include <linux/blkdev.h>
#include <asm/atomic.h>
struct request_queue;
@@ -154,8 +155,11 @@ struct scsi_device {
#define sdev_printk(prefix, sdev, fmt, a...) \
dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
-#define scmd_printk(prefix, scmd, fmt, a...) \
- dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a)
+#define scmd_printk(prefix, scmd, fmt, a...) \
+ (scmd)->request->rq_disk ? \
+ sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \
+ (scmd)->request->rq_disk->disk_name, ##a) : \
+ sdev_printk(prefix, (scmd)->device, fmt, ##a)
enum scsi_target_state {
STARGET_RUNNING = 1,
OpenPOWER on IntegriCloud