mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Reviewed-by: Robert Elliott <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
b0a93d96b2
commit
ded85c193a
3 changed files with 133 additions and 14 deletions
|
|
@ -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)
|
||||
extern int sdev_prefix_printk(const char *, const struct scsi_device *,
|
||||
const char *, const char *, ...);
|
||||
|
||||
#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)
|
||||
#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 { \
|
||||
|
|
|
|||
Loading…
Reference in a new issue