All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nao Nishijima <nao.nishijima.xt@hitachi.com>
To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-hotplug@vger.kernel.org
Cc: Greg KH <greg@kroah.com>, Kay Sievers <kay.sievers@vrfy.org>,
	James Bottomley <James.Bottomley@suse.de>,
	Jon Masters <jcm@redhat.com>,
	2nddept-manager@sdl.hitachi.co.jp,
	Nao Nishijima <nao.nishijima.xt@hitachi.com>
Subject: [PATCH 2/2] SCSI: modify SCSI subsystem
Date: Tue, 05 Apr 2011 21:50:10 +0900	[thread overview]
Message-ID: <20110405125010.7969.51857.stgit@ltc233.sdl.hitachi.co.jp> (raw)
In-Reply-To: <20110405124946.7969.66796.stgit@ltc233.sdl.hitachi.co.jp>

Add a SCSI option for persistent device names in Kernel.

If scsi_mod.persistent_name=1, device names is assigned by udev.
If scsi_mod.persistent_name=0, device names is assigned the order
of logical unit recognizing.

Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
---

 drivers/scsi/sd.c |   10 +++++++---
 drivers/scsi/sr.c |    4 +++-
 drivers/scsi/st.c |    4 +++-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b61ebec..94ad290 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -65,6 +65,7 @@
 
 #include "sd.h"
 #include "scsi_logging.h"
+#include "scsi_unnamed.h"
 
 MODULE_AUTHOR("Eric Youngdale");
 MODULE_DESCRIPTION("SCSI disk (sd) driver");
@@ -2554,9 +2555,12 @@ static int sd_probe(struct device *dev)
 		goto out_free_index;
 	}
 
-	error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
-	if (error)
-		goto out_free_index;
+	if (!copy_persistent_name(gd->disk_name, dev)) {
+		error = sd_format_disk_name("sd", index,
+				gd->disk_name, DISK_NAME_LEN);
+		if (error)
+			goto out_free_index;
+	}
 
 	sdkp->device = sdp;
 	sdkp->driver = &sd_template;
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index aefadc6..682b1a4 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -58,6 +58,7 @@
 
 #include "scsi_logging.h"
 #include "sr.h"
+#include "scsi_unnamed.h"
 
 
 MODULE_DESCRIPTION("SCSI cdrom (sr) driver");
@@ -634,7 +635,8 @@ static int sr_probe(struct device *dev)
 
 	disk->major = SCSI_CDROM_MAJOR;
 	disk->first_minor = minor;
-	sprintf(disk->disk_name, "sr%d", minor);
+	if (!copy_persistent_name(disk->disk_name, dev))
+		sprintf(disk->disk_name, "sr%d", minor);
 	disk->fops = &sr_bdops;
 	disk->flags = GENHD_FL_CD;
 	disk->events = DISK_EVENT_MEDIA_CHANGE | DISK_EVENT_EJECT_REQUEST;
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 1871b8a..9acf8b2 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -74,6 +74,7 @@ static const char *verstr = "20101219";
 
 #include "st_options.h"
 #include "st.h"
+#include "scsi_unnamed.h"
 
 static DEFINE_MUTEX(st_mutex);
 static int buffer_kbs;
@@ -4051,7 +4052,8 @@ static int st_probe(struct device *dev)
 	}
 	kref_init(&tpnt->kref);
 	tpnt->disk = disk;
-	sprintf(disk->disk_name, "st%d", i);
+	if (!copy_persistent_name(disk->disk_name, dev))
+		sprintf(disk->disk_name, "st%d", i);
 	disk->private_data = &tpnt->driver;
 	disk->queue = SDp->request_queue;
 	tpnt->driver = &st_template;


WARNING: multiple messages have this Message-ID (diff)
From: Nao Nishijima <nao.nishijima.xt@hitachi.com>
To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-hotplug@vger.kernel.org
Cc: Greg KH <greg@kroah.com>, Kay Sievers <kay.sievers@vrfy.org>,
	James Bottomley <James.Bottomley@suse.de>,
	Jon Masters <jcm@redhat.com>,
	2nddept-manager@sdl.hitachi.co.jp,
	Nao Nishijima <nao.nishijima.xt@hitachi.com>
Subject: [PATCH 2/2] SCSI: modify SCSI subsystem
Date: Tue, 05 Apr 2011 12:50:10 +0000	[thread overview]
Message-ID: <20110405125010.7969.51857.stgit@ltc233.sdl.hitachi.co.jp> (raw)
In-Reply-To: <20110405124946.7969.66796.stgit@ltc233.sdl.hitachi.co.jp>

Add a SCSI option for persistent device names in Kernel.

If scsi_mod.persistent_name=1, device names is assigned by udev.
If scsi_mod.persistent_name=0, device names is assigned the order
of logical unit recognizing.

Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
---

 drivers/scsi/sd.c |   10 +++++++---
 drivers/scsi/sr.c |    4 +++-
 drivers/scsi/st.c |    4 +++-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b61ebec..94ad290 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -65,6 +65,7 @@
 
 #include "sd.h"
 #include "scsi_logging.h"
+#include "scsi_unnamed.h"
 
 MODULE_AUTHOR("Eric Youngdale");
 MODULE_DESCRIPTION("SCSI disk (sd) driver");
@@ -2554,9 +2555,12 @@ static int sd_probe(struct device *dev)
 		goto out_free_index;
 	}
 
-	error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
-	if (error)
-		goto out_free_index;
+	if (!copy_persistent_name(gd->disk_name, dev)) {
+		error = sd_format_disk_name("sd", index,
+				gd->disk_name, DISK_NAME_LEN);
+		if (error)
+			goto out_free_index;
+	}
 
 	sdkp->device = sdp;
 	sdkp->driver = &sd_template;
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index aefadc6..682b1a4 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -58,6 +58,7 @@
 
 #include "scsi_logging.h"
 #include "sr.h"
+#include "scsi_unnamed.h"
 
 
 MODULE_DESCRIPTION("SCSI cdrom (sr) driver");
@@ -634,7 +635,8 @@ static int sr_probe(struct device *dev)
 
 	disk->major = SCSI_CDROM_MAJOR;
 	disk->first_minor = minor;
-	sprintf(disk->disk_name, "sr%d", minor);
+	if (!copy_persistent_name(disk->disk_name, dev))
+		sprintf(disk->disk_name, "sr%d", minor);
 	disk->fops = &sr_bdops;
 	disk->flags = GENHD_FL_CD;
 	disk->events = DISK_EVENT_MEDIA_CHANGE | DISK_EVENT_EJECT_REQUEST;
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 1871b8a..9acf8b2 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -74,6 +74,7 @@ static const char *verstr = "20101219";
 
 #include "st_options.h"
 #include "st.h"
+#include "scsi_unnamed.h"
 
 static DEFINE_MUTEX(st_mutex);
 static int buffer_kbs;
@@ -4051,7 +4052,8 @@ static int st_probe(struct device *dev)
 	}
 	kref_init(&tpnt->kref);
 	tpnt->disk = disk;
-	sprintf(disk->disk_name, "st%d", i);
+	if (!copy_persistent_name(disk->disk_name, dev))
+		sprintf(disk->disk_name, "st%d", i);
 	disk->private_data = &tpnt->driver;
 	disk->queue = SDp->request_queue;
 	tpnt->driver = &st_template;


  reply	other threads:[~2011-04-05 12:52 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 12:49 [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-05 12:49 ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Nao Nishijima
2011-04-05 12:50 ` Nao Nishijima [this message]
2011-04-05 12:50   ` [PATCH 2/2] SCSI: modify SCSI subsystem Nao Nishijima
2011-04-05 16:14 ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Greg KH
2011-04-05 16:14   ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Greg KH
2011-04-08 14:12   ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-08 14:12     ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Nao Nishijima
2011-04-08 14:12     ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-08 14:33     ` Hannes Reinecke
2011-04-08 14:33       ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Hannes Reinecke
2011-04-08 14:33       ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Hannes Reinecke
2011-04-08 15:14       ` James Bottomley
2011-04-08 15:14         ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device James Bottomley
2011-04-08 15:14         ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel James Bottomley
2011-04-08 16:14         ` Greg KH
2011-04-08 16:14           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Greg KH
2011-04-08 16:43           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Kay Sievers
2011-04-08 16:43             ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Kay Sievers
2011-04-08 16:43             ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Kay Sievers
2011-04-12 13:23         ` Nao Nishijima
2011-04-12 13:23           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Nao Nishijima
2011-04-12 13:23           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-12 13:29           ` James Bottomley
2011-04-12 13:29             ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device James Bottomley
2011-04-12 13:29             ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel James Bottomley
2011-04-14  2:06       ` Nao Nishijima
2011-04-14  2:06         ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Nao Nishijima
2011-04-14  2:06         ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-14  2:18         ` Greg KH
2011-04-14  2:18           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Greg KH
2011-04-08 17:21     ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Stefan Richter
2011-04-08 17:21       ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Stefan Richter
2011-04-18 20:10       ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Jeremy Linton
2011-04-05 16:14 ` Greg KH
2011-04-05 16:14   ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Greg KH
2011-04-08 14:07   ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-08 14:07     ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Nao Nishijima
2011-04-08 16:12     ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Greg KH
2011-04-08 16:12       ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Greg KH
2011-04-14  8:15       ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-14  8:15         ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Nao Nishijima
2011-04-14  8:15         ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Nao Nishijima
2011-04-14 20:07         ` Greg KH
2011-04-14 20:07           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names Greg KH
2011-04-14 20:07           ` [PATCH 1/2] SCSI: Add a SCSI option for persistent device names in Kernel Greg KH

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=20110405125010.7969.51857.stgit@ltc233.sdl.hitachi.co.jp \
    --to=nao.nishijima.xt@hitachi.com \
    --cc=2nddept-manager@sdl.hitachi.co.jp \
    --cc=James.Bottomley@suse.de \
    --cc=greg@kroah.com \
    --cc=jcm@redhat.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.