mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nao Nishijima <nao.nishijima.xt@hitachi.com>
To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Cc: James.Bottomley@HansenPartnership.com, kay.sievers@vrfy.org,
	jcm@redhat.com, greg@kroah.com,
	dle-develop@lists.sourceforge.net,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	yrl.pp-manager.tt@hitachi.com, dgilbert@interlog.com,
	stefanr@s5r6.in-berlin.de, hare@suse.de,
	Nao Nishijima <nao.nishijima.xt@hitachi.com>
Subject: [RFC PATCH 2/4] sd: modify printk for alias_name
Date: Fri, 08 Jul 2011 17:46:10 +0900	[thread overview]
Message-ID: <20110708084610.2091.8405.stgit@ltc197.sdl.hitachi.co.jp> (raw)
In-Reply-To: <20110708084547.2091.55262.stgit@ltc197.sdl.hitachi.co.jp>

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@HansenPartnership.com>
Suggested-by: Jon Masters <jonathan@jonmasters.org>
Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.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 {


  parent reply	other threads:[~2011-07-08  8:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08  8:45 [RFC PATCH 0/4] Persistent device name using alias name Nao Nishijima
2011-07-08  8:46 ` [RFC PATCH 1/4] block: add a new attribute "alias name" in gendisk structure Nao Nishijima
2011-07-08  8:46 ` Nao Nishijima [this message]
2011-07-09  5:42   ` [PATCH] scsi: Make functions out of logging macros Joe Perches
2011-07-09 13:32     ` Nao Nishijima
2011-07-08  8:46 ` [RFC PATCH 3/4] fs: modify disk_name() for alias name Nao Nishijima
2011-07-08  8:46 ` [RFC PATCH 4/4] sd: cleanup " Nao Nishijima
2011-07-08 14:54 ` [RFC PATCH 0/4] Persistent device name using " Greg KH
2011-07-08 15:41   ` Kay Sievers
2011-07-08 15:47     ` Greg KH
2011-07-08 15:54       ` James Bottomley
2011-07-08 16:04         ` Greg KH
2011-07-08 16:17           ` James Bottomley
2011-07-08 16:32             ` Greg KH
2011-07-08 16:15         ` Kay Sievers
2011-07-08 16:38           ` Kay Sievers
2011-07-11 11:47             ` Hannes Reinecke
2011-07-09  6:11           ` Masami Hiramatsu
2011-08-03 17:16             ` Borislav Petkov
2011-08-10  2:01               ` Masami Hiramatsu
2011-07-08 19:45 ` Karel Zak
2011-07-08 19:58   ` Greg KH
2011-07-15  6:55   ` Nao Nishijima
2011-07-15 12:48     ` Karel Zak
2011-07-16 11:40       ` Nao Nishijima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110708084610.2091.8405.stgit@ltc197.sdl.hitachi.co.jp \
    --to=nao.nishijima.xt@hitachi.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dgilbert@interlog.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=greg@kroah.com \
    --cc=hare@suse.de \
    --cc=jcm@redhat.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=yrl.pp-manager.tt@hitachi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®