diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-05-21 16:54:01 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 09:22:16 -0400 |
commit | 5d91e209fb21fb9cc765729d4c6a85a9fb6c9187 (patch) | |
tree | 870367c290c1392fbe0d3762981553f0e24aa752 /drivers/scsi/libiscsi.c | |
parent | a4804cd6eb19318ae8d08ea967cfeaaf5c5b68a6 (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/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 73c37c04ca66..784a935fad4a 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -1867,7 +1867,8 @@ iscsi_session_setup(struct iscsi_transport *iscsit, struct Scsi_Host *shost, | |||
1867 | cmds_max = ISCSI_DEF_XMIT_CMDS_MAX; | 1867 | cmds_max = ISCSI_DEF_XMIT_CMDS_MAX; |
1868 | } | 1868 | } |
1869 | 1869 | ||
1870 | cls_session = iscsi_alloc_session(shost, iscsit); | 1870 | cls_session = iscsi_alloc_session(shost, iscsit, |
1871 | sizeof(struct iscsi_session)); | ||
1871 | if (!cls_session) | 1872 | if (!cls_session) |
1872 | return NULL; | 1873 | return NULL; |
1873 | session = cls_session->dd_data; | 1874 | session = cls_session->dd_data; |
@@ -1968,22 +1969,26 @@ EXPORT_SYMBOL_GPL(iscsi_session_teardown); | |||
1968 | /** | 1969 | /** |
1969 | * iscsi_conn_setup - create iscsi_cls_conn and iscsi_conn | 1970 | * iscsi_conn_setup - create iscsi_cls_conn and iscsi_conn |
1970 | * @cls_session: iscsi_cls_session | 1971 | * @cls_session: iscsi_cls_session |
1972 | * @dd_size: private driver data size | ||
1971 | * @conn_idx: cid | 1973 | * @conn_idx: cid |
1972 | **/ | 1974 | */ |
1973 | struct iscsi_cls_conn * | 1975 | struct iscsi_cls_conn * |
1974 | iscsi_conn_setup(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | 1976 | iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size, |
1977 | uint32_t conn_idx) | ||
1975 | { | 1978 | { |
1976 | struct iscsi_session *session = cls_session->dd_data; | 1979 | struct iscsi_session *session = cls_session->dd_data; |
1977 | struct iscsi_conn *conn; | 1980 | struct iscsi_conn *conn; |
1978 | struct iscsi_cls_conn *cls_conn; | 1981 | struct iscsi_cls_conn *cls_conn; |
1979 | char *data; | 1982 | char *data; |
1980 | 1983 | ||
1981 | cls_conn = iscsi_create_conn(cls_session, conn_idx); | 1984 | cls_conn = iscsi_create_conn(cls_session, sizeof(*conn) + dd_size, |
1985 | conn_idx); | ||
1982 | if (!cls_conn) | 1986 | if (!cls_conn) |
1983 | return NULL; | 1987 | return NULL; |
1984 | conn = cls_conn->dd_data; | 1988 | conn = cls_conn->dd_data; |
1985 | memset(conn, 0, sizeof(*conn)); | 1989 | memset(conn, 0, sizeof(*conn) + dd_size); |
1986 | 1990 | ||
1991 | conn->dd_data = cls_conn->dd_data + sizeof(*conn); | ||
1987 | conn->session = session; | 1992 | conn->session = session; |
1988 | conn->cls_conn = cls_conn; | 1993 | conn->cls_conn = cls_conn; |
1989 | conn->c_stage = ISCSI_CONN_INITIAL_STAGE; | 1994 | conn->c_stage = ISCSI_CONN_INITIAL_STAGE; |