diff mbox

[1/2] scsi_transport_fc: implement 'disable_target_scan' module parameter

Message ID 1447238080-109942-2-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Hannes Reinecke Nov. 11, 2015, 10:34 a.m. UTC
On larger installations it makes sense to disable the target scan
per default on boot, and scan the required LUNs directly via udev
rules.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/scsi_transport_fc.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Seymour, Shane M March 1, 2016, 5:48 a.m. UTC | #1
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 454cc28..72954a8 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -71,6 +71,18 @@  MODULE_PARM_DESC(dev_loss_tmo,
 		 " fast_io_fail_tmo is not set.");
 
 /*
+ * disable_target_scan: Disable target scan per default
+ *   useful on larger installations where only a small
+ *   number of LUNs are required for booting.
+ */
+static bool fc_disable_target_scan;
+
+module_param_named(disable_target_scan, fc_disable_target_scan,
+		   bool, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(disable_target_scan,
+		 "Disable target scan on remote ports (default=0)");
+
+/*
  * Redefine so that we can have same named attributes in the
  * sdev/starget/host objects.
  */
@@ -3282,10 +3294,14 @@  fc_scsi_scan_rport(struct work_struct *work)
 	struct Scsi_Host *shost = rport_to_shost(rport);
 	struct fc_internal *i = to_fc_internal(shost->transportt);
 	unsigned long flags;
+	bool disable_target_scan;
+
+	disable_target_scan = fc_disable_target_scan ?
+		fc_disable_target_scan : i->f->disable_target_scan;
 
 	if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
 	    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
-	    !(i->f->disable_target_scan)) {
+	    !disable_target_scan) {
 		scsi_scan_target(&rport->dev, rport->channel,
 			rport->scsi_target_id, SCAN_WILD_CARD, 1);
 	}