aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2009-03-05 15:46:06 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-13 16:29:39 -0400
commit5e7facb77ff4b6961d936773fb1f175f7abf76b7 (patch)
treed94349cb57a1ef07528e23ac043ca0e1a3eeceb3
parent40a06e755d8524cd0b24f795e8bdce5ad19fc41b (diff)
[SCSI] iscsi class: remove host no argument from session creation callout
We do not need to have llds set the host no for the session's parent, because we know the session's parent is going to be the host. This removes it from the session creation callback and converts the drivers. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c3
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_iscsi.c5
-rw-r--r--drivers/scsi/iscsi_tcp.c4
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c7
-rw-r--r--include/scsi/scsi_transport_iscsi.h2
5 files changed, 8 insertions, 13 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 6c61ed12f299..13d7674b293d 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -397,7 +397,7 @@ static void iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session)
397static struct iscsi_cls_session * 397static struct iscsi_cls_session *
398iscsi_iser_session_create(struct iscsi_endpoint *ep, 398iscsi_iser_session_create(struct iscsi_endpoint *ep,
399 uint16_t cmds_max, uint16_t qdepth, 399 uint16_t cmds_max, uint16_t qdepth,
400 uint32_t initial_cmdsn, uint32_t *hostno) 400 uint32_t initial_cmdsn)
401{ 401{
402 struct iscsi_cls_session *cls_session; 402 struct iscsi_cls_session *cls_session;
403 struct iscsi_session *session; 403 struct iscsi_session *session;
@@ -423,7 +423,6 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
423 if (iscsi_host_add(shost, 423 if (iscsi_host_add(shost,
424 ep ? ib_conn->device->ib_device->dma_device : NULL)) 424 ep ? ib_conn->device->ib_device->dma_device : NULL))
425 goto free_host; 425 goto free_host;
426 *hostno = shost->host_no;
427 426
428 /* 427 /*
429 * we do not support setting can_queue cmd_per_lun from userspace yet 428 * we do not support setting can_queue cmd_per_lun from userspace yet
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
index 307f55e329f5..ae4a93090725 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
@@ -334,13 +334,12 @@ static void cxgb3i_ep_disconnect(struct iscsi_endpoint *ep)
334 * @cmds_max: max # of commands 334 * @cmds_max: max # of commands
335 * @qdepth: scsi queue depth 335 * @qdepth: scsi queue depth
336 * @initial_cmdsn: initial iscsi CMDSN for this session 336 * @initial_cmdsn: initial iscsi CMDSN for this session
337 * @host_no: pointer to return host no
338 * 337 *
339 * Creates a new iSCSI session 338 * Creates a new iSCSI session
340 */ 339 */
341static struct iscsi_cls_session * 340static struct iscsi_cls_session *
342cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth, 341cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth,
343 u32 initial_cmdsn, u32 *host_no) 342 u32 initial_cmdsn)
344{ 343{
345 struct cxgb3i_endpoint *cep; 344 struct cxgb3i_endpoint *cep;
346 struct cxgb3i_hba *hba; 345 struct cxgb3i_hba *hba;
@@ -359,8 +358,6 @@ cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth,
359 cxgb3i_api_debug("ep 0x%p, cep 0x%p, hba 0x%p.\n", ep, cep, hba); 358 cxgb3i_api_debug("ep 0x%p, cep 0x%p, hba 0x%p.\n", ep, cep, hba);
360 BUG_ON(hba != iscsi_host_priv(shost)); 359 BUG_ON(hba != iscsi_host_priv(shost));
361 360
362 *host_no = shost->host_no;
363
364 cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost, 361 cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost,
365 cmds_max, 362 cmds_max,
366 sizeof(struct iscsi_tcp_task) + 363 sizeof(struct iscsi_tcp_task) +
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index ad8676c98c68..b3e5e08e44ab 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -765,8 +765,7 @@ iscsi_sw_tcp_conn_get_stats(struct iscsi_cls_conn *cls_conn,
765 765
766static struct iscsi_cls_session * 766static struct iscsi_cls_session *
767iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max, 767iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max,
768 uint16_t qdepth, uint32_t initial_cmdsn, 768 uint16_t qdepth, uint32_t initial_cmdsn)
769 uint32_t *hostno)
770{ 769{
771 struct iscsi_cls_session *cls_session; 770 struct iscsi_cls_session *cls_session;
772 struct iscsi_session *session; 771 struct iscsi_session *session;
@@ -789,7 +788,6 @@ iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max,
789 788
790 if (iscsi_host_add(shost, NULL)) 789 if (iscsi_host_add(shost, NULL))
791 goto free_host; 790 goto free_host;
792 *hostno = shost->host_no;
793 791
794 cls_session = iscsi_session_setup(&iscsi_sw_tcp_transport, shost, 792 cls_session = iscsi_session_setup(&iscsi_sw_tcp_transport, shost,
795 cmds_max, 793 cmds_max,
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 4f22f9e37c5a..2340e2c5c021 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1197,14 +1197,15 @@ iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_endpoint *ep,
1197{ 1197{
1198 struct iscsi_transport *transport = priv->iscsi_transport; 1198 struct iscsi_transport *transport = priv->iscsi_transport;
1199 struct iscsi_cls_session *session; 1199 struct iscsi_cls_session *session;
1200 uint32_t host_no; 1200 struct Scsi_Host *shost;
1201 1201
1202 session = transport->create_session(ep, cmds_max, queue_depth, 1202 session = transport->create_session(ep, cmds_max, queue_depth,
1203 initial_cmdsn, &host_no); 1203 initial_cmdsn);
1204 if (!session) 1204 if (!session)
1205 return -ENOMEM; 1205 return -ENOMEM;
1206 1206
1207 ev->r.c_session_ret.host_no = host_no; 1207 shost = iscsi_session_to_shost(session);
1208 ev->r.c_session_ret.host_no = shost->host_no;
1208 ev->r.c_session_ret.sid = session->sid; 1209 ev->r.c_session_ret.sid = session->sid;
1209 return 0; 1210 return 0;
1210} 1211}
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index ac29fbd35544..457588e1119b 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -88,7 +88,7 @@ struct iscsi_transport {
88 uint64_t host_param_mask; 88 uint64_t host_param_mask;
89 struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, 89 struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep,
90 uint16_t cmds_max, uint16_t qdepth, 90 uint16_t cmds_max, uint16_t qdepth,
91 uint32_t sn, uint32_t *hn); 91 uint32_t sn);
92 void (*destroy_session) (struct iscsi_cls_session *session); 92 void (*destroy_session) (struct iscsi_cls_session *session);
93 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess, 93 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess,
94 uint32_t cid); 94 uint32_t cid);