summaryrefslogtreecommitdiff
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2015-01-08 07:43:42 +0100
committerChristoph Hellwig <hch@lst.de>2015-01-09 15:44:28 +0100
commitded85c193a391a84076d5c6a7a5668fe164a490e (patch)
treea8f7796e5dcd0c1263155cb8fc62c4d68cc9ec49 /include/scsi/scsi_device.h
parentb0a93d96b2814c725161f91a4e35d0c29ec0f95b (diff)
scsi: Implement per-cpu logging buffer
Implement a per-cpu buffer for formatting messages to avoid line breaks up under high load. This patch implements scmd_printk() and sdev_prefix_printk() using the per-cpu buffer and makes sdev_printk() a wrapper for sdev_prefix_printk(). 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/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 3a4edd1f7dbb..d1aad4d04334 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -230,9 +230,6 @@ struct scsi_dh_data {
#define transport_class_to_sdev(class_dev) \
to_scsi_device(class_dev->parent)
-#define sdev_printk(prefix, sdev, fmt, a...) \
- dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
-
#define sdev_dbg(sdev, fmt, a...) \
dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
@@ -240,16 +237,14 @@ struct scsi_dh_data {
* 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, \
- (scmd)->request->rq_disk->disk_name, ##a) : \
- sdev_printk(prefix, (scmd)->device, fmt, ##a)
+extern int sdev_prefix_printk(const char *, const struct scsi_device *,
+ const char *, const char *, ...);
+
+#define sdev_printk(l, sdev, fmt, a...) \
+ sdev_prefix_printk(l, sdev, NULL, fmt, ##a)
+
+extern int scmd_printk(const char *, const struct scsi_cmnd *,
+ const char *, ...);
#define scmd_dbg(scmd, fmt, a...) \
do { \