lkml.org 
[lkml]   [2011]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] [RFC] sd: print preferred name in kernel messages.
Date
This patch modify sd_printk() and scmd_printk() to use preferred name.

Suggested-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Suggested-by: Jon Masters <jcm@redhat.com>
Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
---

drivers/scsi/sd.c | 2 +-
drivers/scsi/sd.h | 2 +-
include/scsi/scsi_device.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 953773c..6119760 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1071,7 +1071,7 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode,
int error;

SCSI_LOG_IOCTL(1, printk("sd_ioctl: disk=%s, cmd=0x%x\n",
- disk->disk_name, cmd));
+ dev_name(disk_to_dev(disk)), cmd));

/*
* If we are in the middle of error recovery, don't let anyone
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 6ad798b..3fa14f8 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -91,7 +91,7 @@ static inline struct scsi_disk *scsi_disk(struct gendisk *disk)
#define sd_printk(prefix, sdsk, fmt, a...) \
(sdsk)->disk ? \
sdev_printk(prefix, (sdsk)->device, "[%s] " fmt, \
- (sdsk)->disk->disk_name, ##a) : \
+ dev_name(disk_to_dev((sdsk)->disk)), ##a) : \
sdev_printk(prefix, (sdsk)->device, fmt, ##a)

/*
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index dd82e02..0fb955a 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -219,7 +219,7 @@ struct scsi_dh_data {
#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) : \
+ dev_name(disk_to_dev((scmd)->request->rq_disk)), ##a) : \
sdev_printk(prefix, (scmd)->device, fmt, ##a)

enum scsi_target_state {


\
 
 \ /
  Last update: 2011-06-15 10:27    [W:0.091 / U:6.908 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site