diff options
author | Hannes Reinecke <hare@suse.de> | 2014-10-24 14:26:44 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 11:15:57 +0100 |
commit | 22e0d994151c3eac183625f8c1400c0c83ac414f (patch) | |
tree | e56b40c34245c0a4ef831826c9e76d1aa0459a92 /include/scsi | |
parent | f75ae8ed0853e62dff70f4d0229f8d57228c84bd (diff) | |
download | op-kernel-dev-22e0d994151c3eac183625f8c1400c0c83ac414f.zip op-kernel-dev-22e0d994151c3eac183625f8c1400c0c83ac414f.tar.gz |
scsi: introduce sdev_prefix_printk()
Like scmd_printk(), but the device name is passed in as
a string. Can be used by eg ULDs which do not have access
to the scsi_cmnd structure.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_device.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 27ecee7..0b18a09 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -244,6 +244,15 @@ struct scsi_dh_data { #define sdev_dbg(sdev, fmt, a...) \ dev_dbg(&(sdev)->sdev_gendev, fmt, ##a) +/* + * like scmd_printk, but the device name is passed in + * as a string pointer + */ +#define sdev_prefix_printk(l, sdev, p, fmt, a...) \ + (p) ? \ + sdev_printk(l, sdev, "[%s] " fmt, p, ##a) : \ + sdev_printk(l, sdev, fmt, ##a) + #define scmd_printk(prefix, scmd, fmt, a...) \ (scmd)->request->rq_disk ? \ sdev_printk(prefix, (scmd)->device, "[%s] " fmt, \ |