public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 1/6: scsi_largelun and scsi_sparselun
@ 2004-04-18 18:58 Kurt Garloff
  2004-04-18 19:18 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Kurt Garloff @ 2004-04-18 18:58 UTC (permalink / raw)
  To: Linux SCSI list; +Cc: James Bottomley, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 2561 bytes --]

Feature.

Three new kernel/module parameters that affect SCSI scanning, all relevant
for SCSI-2 only, as for SCSI-3, REPORT_LUNS is normally used:
* scsi_sparselun allows the user to disable the Linux scanning optimization
  that assumes that LUNs are consecutive. Equivalent to setting BLIST_SPARSELUN
  blacklist entry for all devices.
* scsi_largelun alloes the user to disable the check to need SCSI-3 to allow
  LUNs >= 8. Equivalent to a global BLIST_LARGELUN.
* max_scsi_sparseluns: Allows to set a different limit for targets with 
  sparse LUN numbering.

--- linux-2.6.5/drivers/scsi/scsi_scan.c.orig	2004-04-04 05:37:41.000000000 +0200
+++ linux-2.6.5/drivers/scsi/scsi_scan.c	2004-04-15 21:47:12.859160471 +0200
@@ -80,6 +80,21 @@ module_param_named(max_luns, max_scsi_lu
 MODULE_PARM_DESC(max_luns,
 		 "last scsi LUN (should be between 1 and 2^32-1)");
 
+static int scsi_sparselun;
+module_param_named(scsi_sparselun, scsi_sparselun, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(scsi_sparselun,
+		 "Assume sparse LUNs for all SCSI devices");
+
+static int scsi_largelun;
+module_param_named(scsi_largelun, scsi_largelun, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(scsi_largelun,
+		 "Assume all SCSI-2 devs support more than 8 LUNs");
+
+static unsigned int max_scsi_sparseluns;
+module_param_named(max_scsi_sparseluns, max_scsi_sparseluns, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(max_scsi_sparseluns,
+		 "Limit LUNs for scanning sparse LUN devices");
+
 #ifdef CONFIG_SCSI_REPORT_LUNS
 /*
  * max_scsi_report_luns: the maximum number of LUNS that will be
@@ -800,8 +815,9 @@ static void scsi_sequential_lun_scan(str
 	 * override the other settings, and scan all of them. Normally,
 	 * SCSI-3 devices should be scanned via the REPORT LUNS.
 	 */
-	if (bflags & BLIST_SPARSELUN) {
-		max_dev_lun = shost->max_lun;
+	if (bflags & BLIST_SPARSELUN || scsi_sparselun) {
+		max_dev_lun = min(shost->max_lun, max_scsi_sparseluns? 
+				  max_scsi_sparseluns: max_scsi_luns);
 		sparse_lun = 1;
 	} else
 		sparse_lun = 0;
@@ -845,7 +861,7 @@ static void scsi_sequential_lun_scan(str
 	 * Do not scan SCSI-2 or lower device past LUN 7, unless
 	 * BLIST_LARGELUN.
 	 */
-	if (scsi_level < SCSI_3 && !(bflags & BLIST_LARGELUN))
+	if (scsi_level < SCSI_3 && !(bflags & BLIST_LARGELUN) && !scsi_largelun)
 		max_dev_lun = min(8U, max_dev_lun);
 
 	/*
-- 
Kurt Garloff  <garloff@suse.de>                            Cologne, DE 
SUSE LINUX AG, Nuernberg, DE                          SUSE Labs (Head)

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-18 22:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-18 18:58 [PATCH] 1/6: scsi_largelun and scsi_sparselun Kurt Garloff
2004-04-18 19:18 ` Christoph Hellwig
2004-04-18 22:10   ` Kurt Garloff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox