aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_iscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-21 16:54:01 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:16 -0400
commit5d91e209fb21fb9cc765729d4c6a85a9fb6c9187 (patch)
tree870367c290c1392fbe0d3762981553f0e24aa752 /drivers/scsi/scsi_transport_iscsi.c
parenta4804cd6eb19318ae8d08ea967cfeaaf5c5b68a6 (diff)
[SCSI] iscsi: remove session/conn_data_size from iscsi_transport
This removes the session and conn data_size fields from the iscsi_transport. Just pass in the value like with host allocation. This patch also makes it so the LLD iscsi_conn data is allocated with the iscsi_cls_conn. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 6fdaa2ee6632..6b8516a0970b 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -483,12 +483,12 @@ static int iscsi_unbind_session(struct iscsi_cls_session *session)
483} 483}
484 484
485struct iscsi_cls_session * 485struct iscsi_cls_session *
486iscsi_alloc_session(struct Scsi_Host *shost, 486iscsi_alloc_session(struct Scsi_Host *shost, struct iscsi_transport *transport,
487 struct iscsi_transport *transport) 487 int dd_size)
488{ 488{
489 struct iscsi_cls_session *session; 489 struct iscsi_cls_session *session;
490 490
491 session = kzalloc(sizeof(*session) + transport->sessiondata_size, 491 session = kzalloc(sizeof(*session) + dd_size,
492 GFP_KERNEL); 492 GFP_KERNEL);
493 if (!session) 493 if (!session)
494 return NULL; 494 return NULL;
@@ -510,7 +510,7 @@ iscsi_alloc_session(struct Scsi_Host *shost,
510 session->dev.parent = &shost->shost_gendev; 510 session->dev.parent = &shost->shost_gendev;
511 session->dev.release = iscsi_session_release; 511 session->dev.release = iscsi_session_release;
512 device_initialize(&session->dev); 512 device_initialize(&session->dev);
513 if (transport->sessiondata_size) 513 if (dd_size)
514 session->dd_data = &session[1]; 514 session->dd_data = &session[1];
515 return session; 515 return session;
516} 516}
@@ -558,18 +558,18 @@ EXPORT_SYMBOL_GPL(iscsi_add_session);
558 * iscsi_create_session - create iscsi class session 558 * iscsi_create_session - create iscsi class session
559 * @shost: scsi host 559 * @shost: scsi host
560 * @transport: iscsi transport 560 * @transport: iscsi transport
561 * @dd_size: private driver data size
561 * @target_id: which target 562 * @target_id: which target
562 * 563 *
563 * This can be called from a LLD or iscsi_transport. 564 * This can be called from a LLD or iscsi_transport.
564 */ 565 */
565struct iscsi_cls_session * 566struct iscsi_cls_session *
566iscsi_create_session(struct Scsi_Host *shost, 567iscsi_create_session(struct Scsi_Host *shost, struct iscsi_transport *transport,
567 struct iscsi_transport *transport, 568 int dd_size, unsigned int target_id)
568 unsigned int target_id)
569{ 569{
570 struct iscsi_cls_session *session; 570 struct iscsi_cls_session *session;
571 571
572 session = iscsi_alloc_session(shost, transport); 572 session = iscsi_alloc_session(shost, transport, dd_size);
573 if (!session) 573 if (!session)
574 return NULL; 574 return NULL;
575 575
@@ -671,6 +671,7 @@ EXPORT_SYMBOL_GPL(iscsi_destroy_session);
671/** 671/**
672 * iscsi_create_conn - create iscsi class connection 672 * iscsi_create_conn - create iscsi class connection
673 * @session: iscsi cls session 673 * @session: iscsi cls session
674 * @dd_size: private driver data size
674 * @cid: connection id 675 * @cid: connection id
675 * 676 *
676 * This can be called from a LLD or iscsi_transport. The connection 677 * This can be called from a LLD or iscsi_transport. The connection
@@ -683,18 +684,17 @@ EXPORT_SYMBOL_GPL(iscsi_destroy_session);
683 * non-zero. 684 * non-zero.
684 */ 685 */
685struct iscsi_cls_conn * 686struct iscsi_cls_conn *
686iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid) 687iscsi_create_conn(struct iscsi_cls_session *session, int dd_size, uint32_t cid)
687{ 688{
688 struct iscsi_transport *transport = session->transport; 689 struct iscsi_transport *transport = session->transport;
689 struct iscsi_cls_conn *conn; 690 struct iscsi_cls_conn *conn;
690 unsigned long flags; 691 unsigned long flags;
691 int err; 692 int err;
692 693
693 conn = kzalloc(sizeof(*conn) + transport->conndata_size, GFP_KERNEL); 694 conn = kzalloc(sizeof(*conn) + dd_size, GFP_KERNEL);
694 if (!conn) 695 if (!conn)
695 return NULL; 696 return NULL;
696 697 if (dd_size)
697 if (transport->conndata_size)
698 conn->dd_data = &conn[1]; 698 conn->dd_data = &conn[1];
699 699
700 INIT_LIST_HEAD(&conn->conn_list); 700 INIT_LIST_HEAD(&conn->conn_list);