aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/iscsi_tcp.c
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/scsi/iscsi_tcp.c
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/scsi/iscsi_tcp.c')
-rw-r--r--drivers/scsi/iscsi_tcp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 8cdcaf33fb4e..e19d92f2d753 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -1866,7 +1866,7 @@ iscsi_tcp_session_create(struct Scsi_Host *shost, uint16_t cmds_max,
1866 return NULL; 1866 return NULL;
1867 } 1867 }
1868 1868
1869 shost = scsi_host_alloc(&iscsi_sht, sizeof(struct iscsi_host)); 1869 shost = iscsi_host_alloc(&iscsi_sht, 0, qdepth);
1870 if (!shost) 1870 if (!shost)
1871 return NULL; 1871 return NULL;
1872 shost->transportt = iscsi_tcp_scsi_transport; 1872 shost->transportt = iscsi_tcp_scsi_transport;
@@ -1874,10 +1874,9 @@ iscsi_tcp_session_create(struct Scsi_Host *shost, uint16_t cmds_max,
1874 shost->max_id = 0; 1874 shost->max_id = 0;
1875 shost->max_channel = 0; 1875 shost->max_channel = 0;
1876 shost->max_cmd_len = 16; 1876 shost->max_cmd_len = 16;
1877 shost->can_queue = cmds_max;
1877 1878
1878 iscsi_host_setup(shost, qdepth); 1879 if (iscsi_host_add(shost, NULL))
1879
1880 if (scsi_add_host(shost, NULL))
1881 goto free_host; 1880 goto free_host;
1882 *hostno = shost->host_no; 1881 *hostno = shost->host_no;
1883 1882
@@ -1912,10 +1911,9 @@ iscsi_tcp_session_create(struct Scsi_Host *shost, uint16_t cmds_max,
1912remove_session: 1911remove_session:
1913 iscsi_session_teardown(cls_session); 1912 iscsi_session_teardown(cls_session);
1914remove_host: 1913remove_host:
1915 scsi_remove_host(shost); 1914 iscsi_host_remove(shost);
1916free_host: 1915free_host:
1917 iscsi_host_teardown(shost); 1916 iscsi_host_free(shost);
1918 scsi_host_put(shost);
1919 return NULL; 1917 return NULL;
1920} 1918}
1921 1919
@@ -1924,11 +1922,9 @@ static void iscsi_tcp_session_destroy(struct iscsi_cls_session *cls_session)
1924 struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); 1922 struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
1925 1923
1926 iscsi_r2tpool_free(cls_session->dd_data); 1924 iscsi_r2tpool_free(cls_session->dd_data);
1927 iscsi_session_teardown(cls_session);
1928 1925
1929 scsi_remove_host(shost); 1926 iscsi_host_remove(shost);
1930 iscsi_host_teardown(shost); 1927 iscsi_host_free(shost);
1931 scsi_host_put(shost);
1932} 1928}
1933 1929
1934static int iscsi_tcp_slave_configure(struct scsi_device *sdev) 1930static int iscsi_tcp_slave_configure(struct scsi_device *sdev)