public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: open-iscsi <open-iscsi@googlegroups.com>, linux-scsi@vger.kernel.org
Subject: [PATCH RFC 2/2] implement transport scan callout for iscsi
Date: Sat, 21 May 2005 14:39:48 -0700	[thread overview]
Message-ID: <1116711588.6289.32.camel@mina> (raw)

Implement transport specific scanning function for open-iscsi.
This fixes the sysfs layout so it looks like this:

[root@mina host1]# tree
.
`-- session1
    |-- connection1:0
    `-- target1:0:0
        |-- 1:0:0:0

representing the relationship between a session and a target.
open-iscsi/linux-iscsi-5 uses struct devices and driver mode transport
classes like in past sumbitted patches here
http://marc.theaimsgroup.com/?l=linux-scsi&m=111618626124050&w=2

This patches against the subversion source found at
open-iscsi.org or the currect release
http://www.open-iscsi.org/bits/open-iscsi-0.3rc4-325.tar.gz
open-iscsi is not in mainline, but we are trying :). I only
post this to show an example of the callout usage since I do not
have access to a box (or really the serial line to reboot it) with
FC to fix the fc transport class today, and to make sure open-iscsi
is even doing the correct sysfs layout wrt to struct devices and
transport_classes and what should link to what.


Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>


diff -aurp open-iscsi/kernel/scsi_transport_iscsi.c open-iscsi.work/kernel/scsi_transport_iscsi.c
--- open-iscsi/kernel/scsi_transport_iscsi.c	2005-05-21 14:03:04.000000000 -0700
+++ open-iscsi.work/kernel/scsi_transport_iscsi.c	2005-05-21 14:21:00.000000000 -0700
@@ -887,6 +887,15 @@ iscsi_if_rx(struct sock *sk, int len)
 	up(&rx_queue_sema);
 }
 
+static int
+iscsi_scan(struct Scsi_Host *shost, unsigned int channel, unsigned int id,
+	   unsigned int lun, int rescan)
+{
+	struct iscsi_if_session *session = hostdata_session(shost->hostdata);
+	scsi_scan_target(&session->dev, channel, id, lun, rescan);
+	return 0;
+}
+
 /*
  * iSCSI connection attrs
  */
@@ -1039,6 +1048,7 @@ int iscsi_register_transport(struct iscs
 	INIT_LIST_HEAD(&priv->sessions);
 	spin_lock_init(&priv->session_lock);
 	priv->iscsi_transport = tt;
+	priv->t.scan = iscsi_scan;
 
 	/* setup parameters mask */
 	priv->param_mask = 0xFFFFFFFF;
diff -aurp open-iscsi/usr/initiator.c open-iscsi.work/usr/initiator.c
--- open-iscsi/usr/initiator.c	2005-05-21 14:03:05.000000000 -0700
+++ open-iscsi.work/usr/initiator.c	2005-05-21 14:03:50.000000000 -0700
@@ -181,7 +181,7 @@ __session_scan_host(iscsi_session_t *ses
 		/* child */
 		log_debug(4, "scanning host%d using %s",session->id,
 			  sysfs_file);
-		write(fd, "- - -", 5);
+		write(fd, "0 0 -", 5);
 		close(fd);
 		exit(0);
 	}



             reply	other threads:[~2005-05-21 21:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-21 21:39 Mike Christie [this message]
2005-05-24 17:09 ` [PATCH RFC 2/2] implement transport scan callout for iscsi James Bottomley
     [not found] <42936441.0b798bab.39a4.ffff9774SMTPIN_ADDED@mx.googlegroups.com>
2005-05-24 21:01 ` Mike Christie
2005-05-24 23:17   ` James Bottomley
2005-05-25  0:25     ` open_iscsi
2005-05-25  1:00       ` James Bottomley
2005-05-25  1:28         ` open_iscsi
2005-05-25  5:22           ` Dmitry Yusupov
2005-05-25 12:55             ` open_iscsi
2005-05-25 13:00           ` Ming Zhang
2005-05-25 13:08             ` open_iscsi
2005-05-25 15:18         ` Luben Tuikov
2005-05-25 18:04           ` James Bottomley
2005-05-25 18:32             ` Dmitry Yusupov
2005-05-25 19:42               ` James Bottomley
2005-05-26  1:38             ` open_iscsi
  -- strict thread matches above, loose matches on Subject: below --
2005-05-25  2:20 open_iscsi

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=1116711588.6289.32.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