aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-21 16:54:00 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:16 -0400
commita4804cd6eb19318ae8d08ea967cfeaaf5c5b68a6 (patch)
treea69acbfdf4e3646ebb7583f0627b7b7952d13b10 /drivers/infiniband
parent756135215ec743be6fdce2bdebe8cdb9f8a231f6 (diff)
[SCSI] iscsi: add iscsi host helpers
This finishes the host/session unbinding, by adding some helpers to add and remove hosts and the session they manage. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 5a750042e2b2..62e35e503e49 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -371,10 +371,8 @@ static void iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session)
371{ 371{
372 struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); 372 struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
373 373
374 iscsi_session_teardown(cls_session); 374 iscsi_host_remove(shost);
375 scsi_remove_host(shost); 375 iscsi_host_free(shost);
376 iscsi_host_teardown(shost);
377 scsi_host_put(shost);
378} 376}
379 377
380static struct iscsi_cls_session * 378static struct iscsi_cls_session *
@@ -396,7 +394,7 @@ iscsi_iser_session_create(struct Scsi_Host *shost,
396 return NULL; 394 return NULL;
397 } 395 }
398 396
399 shost = scsi_host_alloc(&iscsi_iser_sht, 0); 397 shost = iscsi_host_alloc(&iscsi_iser_sht, 0, ISCSI_MAX_CMD_PER_LUN);
400 if (!shost) 398 if (!shost)
401 return NULL; 399 return NULL;
402 shost->transportt = iscsi_iser_scsi_transport; 400 shost->transportt = iscsi_iser_scsi_transport;
@@ -405,9 +403,7 @@ iscsi_iser_session_create(struct Scsi_Host *shost,
405 shost->max_channel = 0; 403 shost->max_channel = 0;
406 shost->max_cmd_len = 16; 404 shost->max_cmd_len = 16;
407 405
408 iscsi_host_setup(shost, qdepth); 406 if (iscsi_host_add(shost, NULL))
409
410 if (scsi_add_host(shost, NULL))
411 goto free_host; 407 goto free_host;
412 *hostno = shost->host_no; 408 *hostno = shost->host_no;
413 409
@@ -443,10 +439,9 @@ iscsi_iser_session_create(struct Scsi_Host *shost,
443 return cls_session; 439 return cls_session;
444 440
445remove_host: 441remove_host:
446 scsi_remove_host(shost); 442 iscsi_host_remove(shost);
447free_host: 443free_host:
448 iscsi_host_teardown(shost); 444 iscsi_host_free(shost);
449 scsi_host_put(shost);
450 return NULL; 445 return NULL;
451} 446}
452 447