From: Kurt Garloff <garloff@suse.de>
To: Linux SCSI list <linux-scsi@vger.kernel.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH] 1/6: scsi_largelun and scsi_sparselun
Date: Sun, 18 Apr 2004 20:58:20 +0200 [thread overview]
Message-ID: <20040418185820.GD4868@tpkurt.garloff.de> (raw)
[-- 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 --]
next reply other threads:[~2004-04-18 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-18 18:58 Kurt Garloff [this message]
2004-04-18 19:18 ` [PATCH] 1/6: scsi_largelun and scsi_sparselun Christoph Hellwig
2004-04-18 22:10 ` Kurt Garloff
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=20040418185820.GD4868@tpkurt.garloff.de \
--to=garloff@suse.de \
--cc=James.Bottomley@steeleye.com \
--cc=akpm@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox