public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <James.Smart@Emulex.Com>
Subject: [PATCH] FC transport: Allow LLDD to disable LUN scanning
Date: Tue, 21 Aug 2007 17:37:17 +0200	[thread overview]
Message-ID: <20070821153716.GB11101@schmichrtp.de.ibm.com> (raw)

From: Christof Schmitt <christof.schmitt@de.ibm.com>

Introduce a flag that allows the SCSI low level device driver to
disable the automatic scanning for LUNs from the FC transport class.

This is for the zfcp device driver that manages the attached units on
its own and does not want to have the automatic discovery of other
LUNs.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
 drivers/scsi/scsi_transport_fc.c |    4 +++-
 include/scsi/scsi_transport_fc.h |    3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

--- linux-2.6.orig/drivers/scsi/scsi_transport_fc.c
+++ linux-2.6/drivers/scsi/scsi_transport_fc.c
@@ -2988,10 +2988,12 @@ fc_scsi_scan_rport(struct work_struct *w
 	struct fc_rport *rport =
 		container_of(work, struct fc_rport, scan_work);
 	struct Scsi_Host *shost = rport_to_shost(rport);
+	struct fc_internal *i = to_fc_internal(shost->transportt);
 	unsigned long flags;
 
 	if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
-	    (rport->roles & FC_PORT_ROLE_FCP_TARGET)) {
+	    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
+	    !(i->f->disable_target_scan)) {
 		scsi_scan_target(&rport->dev, rport->channel,
 			rport->scsi_target_id, SCAN_WILD_CARD, 1);
 	}
--- linux-2.6.orig/include/scsi/scsi_transport_fc.h
+++ linux-2.6/include/scsi/scsi_transport_fc.h
@@ -632,6 +632,9 @@ struct fc_function_template {
 	unsigned long	show_host_fabric_name:1;
 	unsigned long	show_host_symbolic_name:1;
 	unsigned long	show_host_system_hostname:1;
+
+	/* The driver can disable the LUN scanning from the FC transport class */
+	unsigned long	disable_target_scan:1;
 };
 
 

             reply	other threads:[~2007-08-21 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 15:37 Christof Schmitt [this message]
2007-08-21 15:46 ` [PATCH] FC transport: Allow LLDD to disable LUN scanning Matthew Wilcox
2007-08-22  8:28   ` Christof Schmitt
2007-08-22  8:34   ` Update: " Christof Schmitt

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=20070821153716.GB11101@schmichrtp.de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Smart@Emulex.Com \
    --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