From: Mike Christie <michaelc@cs.wisc.edu>
To: open-iscsi <open-iscsi@googlegroups.com>, linux-scsi@vger.kernel.org
Subject: [PATCH RFC 1/2] add transport scan callout to fix sysfs layout when scanning from userspace
Date: Sat, 21 May 2005 14:37:11 -0700 [thread overview]
Message-ID: <1116711431.6285.28.camel@mina> (raw)
When scanning hosts that implement FC rport support and
open-iscsi/linux-iscsi-5 hosts from userspace the sysfs
layout will end up placing the target's parent as the host
instead of some transport specific object. For FC the
target's parent should be the rport and for open-iscsi the
parent should be a session (that is if for open-iscsi our
using struct devices and our sysfs layout is correct).
The problem is due to the scsi host scan attribute calling
scsi_scan_host_selected, but the transports calling
scsi_scan_target. To further complicate matters iscsi does
not use a work queue for scanning since it initiates the
scanning from usersapce and it manages its channel and target
numbers from userspace. And, FC rport support is the opposite.
To fix this the inlined patch just adds a scan callout onto
the scsi_transport_template so scsi_sysfs can call it if set.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
diff -aurp linux-2.6.12-rc4/drivers/scsi/scsi_sysfs.c linux-2.6.12-rc4.work/drivers/scsi/scsi_sysfs.c
--- linux-2.6.12-rc4/drivers/scsi/scsi_sysfs.c 2005-05-06 22:20:31.000000000 -0700
+++ linux-2.6.12-rc4.work/drivers/scsi/scsi_sysfs.c 2005-05-20 23:08:08.000000000 -0700
@@ -80,7 +80,11 @@ static int scsi_scan(struct Scsi_Host *s
return -EINVAL;
if (check_set(&lun, s3))
return -EINVAL;
- res = scsi_scan_host_selected(shost, channel, id, lun, 1);
+
+ if (shost->transportt->scan)
+ res = shost->transportt->scan(shost, channel, id, lun, 1);
+ else
+ res = scsi_scan_host_selected(shost, channel, id, lun, 1);
return res;
}
diff -aurp linux-2.6.12-rc4/include/scsi/scsi_transport.h linux-2.6.12-rc4.work/include/scsi/scsi_transport.h
--- linux-2.6.12-rc4/include/scsi/scsi_transport.h 2005-05-06 22:20:31.000000000 -0700
+++ linux-2.6.12-rc4.work/include/scsi/scsi_transport.h 2005-05-20 23:12:38.000000000 -0700
@@ -39,6 +39,12 @@ struct scsi_transport_template {
* True if the transport wants to use a host-based work-queue
*/
unsigned int create_work_queue : 1;
+
+ /*
+ * optional transport specific scanning function
+ */
+ int (* scan)(struct Scsi_Host *, unsigned int, unsigned int,
+ unsigned int, int);
};
#define transport_class_to_shost(tc) \
next reply other threads:[~2005-05-21 21:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-21 21:37 Mike Christie [this message]
2005-05-24 23:01 ` [PATCH RFC 1/2] add transport scan callout to fix sysfs layout when scanning from userspace Patrick Mansfield
2005-05-25 0:30 ` Patrick Mansfield
2005-05-25 0:41 ` Mike Christie
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=1116711431.6285.28.camel@mina \
--to=michaelc@cs.wisc.edu \
--cc=linux-scsi@vger.kernel.org \
--cc=open-iscsi@googlegroups.com \
/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