aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-21 16:54:12 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:20 -0400
commit7970634b81a6e3561954517bca42615542c4535b (patch)
treee8a6aea24c5db8c1198173b75945746333cdbd4d /include/scsi
parent2261ec3d686e35c1a6088ab7f00a1d02b528b994 (diff)
[SCSI] iscsi class: user device_for_each_child instead of duplicating session list
Currently we duplicate the list of sessions, because we were using the test for if a session was on the host list to indicate if the session was bound or unbound. We can instead use the target_id and fix up the class so that drivers like bnx2i do not have to manage the target id space. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libiscsi.h2
-rw-r--r--include/scsi/scsi_transport_iscsi.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 176353c117b6..13c92d7ba969 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -331,7 +331,7 @@ extern void iscsi_host_free(struct Scsi_Host *shost);
331 */ 331 */
332extern struct iscsi_cls_session * 332extern struct iscsi_cls_session *
333iscsi_session_setup(struct iscsi_transport *, struct Scsi_Host *shost, 333iscsi_session_setup(struct iscsi_transport *, struct Scsi_Host *shost,
334 uint16_t, int, uint32_t); 334 uint16_t, int, uint32_t, unsigned int);
335extern void iscsi_session_teardown(struct iscsi_cls_session *); 335extern void iscsi_session_teardown(struct iscsi_cls_session *);
336extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); 336extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
337extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn, 337extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 0553240796e9..d6b823195563 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -161,9 +161,10 @@ enum {
161 ISCSI_SESSION_FREE, 161 ISCSI_SESSION_FREE,
162}; 162};
163 163
164#define ISCSI_MAX_TARGET -1
165
164struct iscsi_cls_session { 166struct iscsi_cls_session {
165 struct list_head sess_list; /* item in session_list */ 167 struct list_head sess_list; /* item in session_list */
166 struct list_head host_list;
167 struct iscsi_transport *transport; 168 struct iscsi_transport *transport;
168 spinlock_t lock; 169 spinlock_t lock;
169 struct work_struct block_work; 170 struct work_struct block_work;
@@ -175,7 +176,7 @@ struct iscsi_cls_session {
175 int recovery_tmo; 176 int recovery_tmo;
176 struct delayed_work recovery_work; 177 struct delayed_work recovery_work;
177 178
178 int target_id; 179 unsigned int target_id;
179 180
180 int state; 181 int state;
181 int sid; /* session id */ 182 int sid; /* session id */
@@ -193,7 +194,6 @@ struct iscsi_cls_session {
193 iscsi_dev_to_session(_stgt->dev.parent) 194 iscsi_dev_to_session(_stgt->dev.parent)
194 195
195struct iscsi_cls_host { 196struct iscsi_cls_host {
196 struct list_head sessions;
197 atomic_t nr_scans; 197 atomic_t nr_scans;
198 struct mutex mutex; 198 struct mutex mutex;
199 struct workqueue_struct *scan_workq; 199 struct workqueue_struct *scan_workq;