[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110708084610.2091.8405.stgit@ltc197.sdl.hitachi.co.jp>
Date: Fri, 08 Jul 2011 17:46:10 +0900
From: Nao Nishijima <nao.nishijima.xt@...achi.com>
To: linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Cc: James.Bottomley@...senPartnership.com, kay.sievers@...y.org,
jcm@...hat.com, greg@...ah.com, dle-develop@...ts.sourceforge.net,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
yrl.pp-manager.tt@...achi.com, dgilbert@...erlog.com,
stefanr@...6.in-berlin.de, hare@...e.de,
Nao Nishijima <nao.nishijima.xt@...achi.com>
Subject: [RFC PATCH 2/4] sd: modify printk for alias_name
This patch modify sd_printk() and scmd_printk() to use alias_name. If user set
an alias_name, those print an alias_name instead of a disk_name.
Suggested-by: James Bottomley <James.Bottomley@...senPartnership.com>
Suggested-by: Jon Masters <jonathan@...masters.org>
Signed-off-by: Nao Nishijima <nao.nishijima.xt@...achi.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
---
drivers/scsi/sd.h | 2 +-
include/scsi/scsi_device.h | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 6ad798b..66c7ae8 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) : \
+ alias_name((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..125c05c 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -6,6 +6,7 @@
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/blkdev.h>
+#include <linux/genhd.h>
#include <scsi/scsi.h>
#include <asm/atomic.h>
@@ -219,7 +220,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) : \
+ alias_name((scmd)->request->rq_disk), ##a) : \
sdev_printk(prefix, (scmd)->device, fmt, ##a)
enum scsi_target_state {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists