diff options
author | Hannes Reinecke <hare@suse.de> | 2015-01-08 07:43:42 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 15:44:28 +0100 |
commit | ded85c193a391a84076d5c6a7a5668fe164a490e (patch) | |
tree | a8f7796e5dcd0c1263155cb8fc62c4d68cc9ec49 /include/scsi | |
parent | b0a93d96b2814c725161f91a4e35d0c29ec0f95b (diff) | |
download | linux-stable-ded85c193a391a84076d5c6a7a5668fe164a490e.tar.gz linux-stable-ded85c193a391a84076d5c6a7a5668fe164a490e.tar.bz2 linux-stable-ded85c193a391a84076d5c6a7a5668fe164a490e.zip |
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')
-rw-r--r-- | include/scsi/scsi_device.h | 21 |
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 { \ |