public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH] Hidden scsi devices
Date: Thu, 22 Jan 2004 09:21:23 -0600	[thread overview]
Message-ID: <400FEA73.80109@us.ibm.com> (raw)

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

Here is a patch that adds a flag to struct scsi_device which prevents
upper layer drivers from binding to it. This flag can be set by LLDs
in their slave_configure routine. I plan to use this in the ipr driver
so I can have scsi disks that are in RAID arrays show up in sysfs and
have sg devices created for them, but prevent sd devices from being
created since these devices will fail reads and writes with data protect
errors. I tested this out with the ipr driver it worked as expected.



-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

[-- Attachment #2: patch-2.6.1-hidden_devs --]
[-- Type: text/plain, Size: 1147 bytes --]

diff -Naur linux-2.6.1/drivers/scsi/scsi_sysfs.c linux-2.6.1-hidden/drivers/scsi/scsi_sysfs.c
--- linux-2.6.1/drivers/scsi/scsi_sysfs.c	Fri Jan  9 00:59:10 2004
+++ linux-2.6.1-hidden/drivers/scsi/scsi_sysfs.c	Thu Jan 22 08:54:39 2004
@@ -149,7 +149,13 @@
 /* all probing is done in the individual ->probe routines */
 static int scsi_bus_match(struct device *dev, struct device_driver *gendrv)
 {
-	return 1;
+	struct scsi_device *sdev;
+	sdev = to_scsi_device(dev);
+
+	if (sdev->hidden)
+		return 0;
+	else
+		return 1;
 }
 
 struct bus_type scsi_bus_type = {
diff -Naur linux-2.6.1/include/scsi/scsi_device.h linux-2.6.1-hidden/include/scsi/scsi_device.h
--- linux-2.6.1/include/scsi/scsi_device.h	Fri Jan  9 00:59:06 2004
+++ linux-2.6.1-hidden/include/scsi/scsi_device.h	Thu Jan 22 08:50:33 2004
@@ -94,6 +94,7 @@
 	unsigned skip_ms_page_8:1;	/* do not use MODE SENSE page 0x08 */
 	unsigned skip_ms_page_3f:1;	/* do not use MODE SENSE page 0x3f */
 	unsigned no_start_on_add:1;	/* do not issue start on add */
+	unsigned hidden:1;	/* do not bind to upper level driver */
 
 	unsigned int device_blocked;	/* Device returned QUEUE_FULL. */
 

             reply	other threads:[~2004-01-22 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 15:21 Brian King [this message]
2004-01-22 15:50 ` [PATCH] Hidden scsi devices Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2004-01-22 15:57 Martin Peschke3
2004-01-22 17:07 ` Brian King
2004-01-22 17:22   ` James Bottomley
2004-01-22 17:33     ` Brian King
2004-01-22 17:50       ` James Bottomley
2004-01-22 18:42         ` Mike Anderson
2004-01-22 19:43         ` Mike Anderson
2004-01-22 19:46           ` James Bottomley
2004-01-22 20:13             ` Brian King

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=400FEA73.80109@us.ibm.com \
    --to=brking@us.ibm.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