aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
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/infiniband/ulp
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/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 62e35e503e49..9b34946eb00d 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -279,7 +279,7 @@ iscsi_iser_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
279 struct iscsi_cls_conn *cls_conn; 279 struct iscsi_cls_conn *cls_conn;
280 struct iscsi_iser_conn *iser_conn; 280 struct iscsi_iser_conn *iser_conn;
281 281
282 cls_conn = iscsi_conn_setup(cls_session, conn_idx); 282 cls_conn = iscsi_conn_setup(cls_session, sizeof(*iser_conn), conn_idx);
283 if (!cls_conn) 283 if (!cls_conn)
284 return NULL; 284 return NULL;
285 conn = cls_conn->dd_data; 285 conn = cls_conn->dd_data;
@@ -290,10 +290,7 @@ iscsi_iser_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
290 */ 290 */
291 conn->max_recv_dlength = 128; 291 conn->max_recv_dlength = 128;
292 292
293 iser_conn = kzalloc(sizeof(*iser_conn), GFP_KERNEL); 293 iser_conn = conn->dd_data;
294 if (!iser_conn)
295 goto conn_alloc_fail;
296
297 /* currently this is the only field which need to be initiated */ 294 /* currently this is the only field which need to be initiated */
298 rwlock_init(&iser_conn->lock); 295 rwlock_init(&iser_conn->lock);
299 296
@@ -301,10 +298,6 @@ iscsi_iser_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
301 iser_conn->iscsi_conn = conn; 298 iser_conn->iscsi_conn = conn;
302 299
303 return cls_conn; 300 return cls_conn;
304
305conn_alloc_fail:
306 iscsi_conn_teardown(cls_conn);
307 return NULL;
308} 301}
309 302
310static void 303static void
@@ -313,10 +306,9 @@ iscsi_iser_conn_destroy(struct iscsi_cls_conn *cls_conn)
313 struct iscsi_conn *conn = cls_conn->dd_data; 306 struct iscsi_conn *conn = cls_conn->dd_data;
314 struct iscsi_iser_conn *iser_conn = conn->dd_data; 307 struct iscsi_iser_conn *iser_conn = conn->dd_data;
315 308
316 iscsi_conn_teardown(cls_conn);
317 if (iser_conn->ib_conn) 309 if (iser_conn->ib_conn)
318 iser_conn->ib_conn->iser_conn = NULL; 310 iser_conn->ib_conn->iser_conn = NULL;
319 kfree(iser_conn); 311 iscsi_conn_teardown(cls_conn);
320} 312}
321 313
322static int 314static int
@@ -619,8 +611,6 @@ static struct iscsi_transport iscsi_iser_transport = {
619 .host_param_mask = ISCSI_HOST_HWADDRESS | 611 .host_param_mask = ISCSI_HOST_HWADDRESS |
620 ISCSI_HOST_NETDEV_NAME | 612 ISCSI_HOST_NETDEV_NAME |
621 ISCSI_HOST_INITIATOR_NAME, 613 ISCSI_HOST_INITIATOR_NAME,
622 .conndata_size = sizeof(struct iscsi_conn),
623 .sessiondata_size = sizeof(struct iscsi_session),
624 /* session management */ 614 /* session management */
625 .create_session = iscsi_iser_session_create, 615 .create_session = iscsi_iser_session_create,
626 .destroy_session = iscsi_iser_session_destroy, 616 .destroy_session = iscsi_iser_session_destroy,