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/iscsi_tcp.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/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index e19d92f2d753..dfaf9fa57340 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -1490,7 +1490,7 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | |||
1490 | struct iscsi_cls_conn *cls_conn; | 1490 | struct iscsi_cls_conn *cls_conn; |
1491 | struct iscsi_tcp_conn *tcp_conn; | 1491 | struct iscsi_tcp_conn *tcp_conn; |
1492 | 1492 | ||
1493 | cls_conn = iscsi_conn_setup(cls_session, conn_idx); | 1493 | cls_conn = iscsi_conn_setup(cls_session, sizeof(*tcp_conn), conn_idx); |
1494 | if (!cls_conn) | 1494 | if (!cls_conn) |
1495 | return NULL; | 1495 | return NULL; |
1496 | conn = cls_conn->dd_data; | 1496 | conn = cls_conn->dd_data; |
@@ -1500,18 +1500,14 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | |||
1500 | */ | 1500 | */ |
1501 | conn->max_recv_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN; | 1501 | conn->max_recv_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN; |
1502 | 1502 | ||
1503 | tcp_conn = kzalloc(sizeof(*tcp_conn), GFP_KERNEL); | 1503 | tcp_conn = conn->dd_data; |
1504 | if (!tcp_conn) | ||
1505 | goto tcp_conn_alloc_fail; | ||
1506 | |||
1507 | conn->dd_data = tcp_conn; | ||
1508 | tcp_conn->iscsi_conn = conn; | 1504 | tcp_conn->iscsi_conn = conn; |
1509 | 1505 | ||
1510 | tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0, | 1506 | tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0, |
1511 | CRYPTO_ALG_ASYNC); | 1507 | CRYPTO_ALG_ASYNC); |
1512 | tcp_conn->tx_hash.flags = 0; | 1508 | tcp_conn->tx_hash.flags = 0; |
1513 | if (IS_ERR(tcp_conn->tx_hash.tfm)) | 1509 | if (IS_ERR(tcp_conn->tx_hash.tfm)) |
1514 | goto free_tcp_conn; | 1510 | goto free_conn; |
1515 | 1511 | ||
1516 | tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0, | 1512 | tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0, |
1517 | CRYPTO_ALG_ASYNC); | 1513 | CRYPTO_ALG_ASYNC); |
@@ -1523,14 +1519,12 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | |||
1523 | 1519 | ||
1524 | free_tx_tfm: | 1520 | free_tx_tfm: |
1525 | crypto_free_hash(tcp_conn->tx_hash.tfm); | 1521 | crypto_free_hash(tcp_conn->tx_hash.tfm); |
1526 | free_tcp_conn: | 1522 | free_conn: |
1527 | iscsi_conn_printk(KERN_ERR, conn, | 1523 | iscsi_conn_printk(KERN_ERR, conn, |
1528 | "Could not create connection due to crc32c " | 1524 | "Could not create connection due to crc32c " |
1529 | "loading error. Make sure the crc32c " | 1525 | "loading error. Make sure the crc32c " |
1530 | "module is built as a module or into the " | 1526 | "module is built as a module or into the " |
1531 | "kernel\n"); | 1527 | "kernel\n"); |
1532 | kfree(tcp_conn); | ||
1533 | tcp_conn_alloc_fail: | ||
1534 | iscsi_conn_teardown(cls_conn); | 1528 | iscsi_conn_teardown(cls_conn); |
1535 | return NULL; | 1529 | return NULL; |
1536 | } | 1530 | } |
@@ -1563,14 +1557,13 @@ iscsi_tcp_conn_destroy(struct iscsi_cls_conn *cls_conn) | |||
1563 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 1557 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
1564 | 1558 | ||
1565 | iscsi_tcp_release_conn(conn); | 1559 | iscsi_tcp_release_conn(conn); |
1566 | iscsi_conn_teardown(cls_conn); | ||
1567 | 1560 | ||
1568 | if (tcp_conn->tx_hash.tfm) | 1561 | if (tcp_conn->tx_hash.tfm) |
1569 | crypto_free_hash(tcp_conn->tx_hash.tfm); | 1562 | crypto_free_hash(tcp_conn->tx_hash.tfm); |
1570 | if (tcp_conn->rx_hash.tfm) | 1563 | if (tcp_conn->rx_hash.tfm) |
1571 | crypto_free_hash(tcp_conn->rx_hash.tfm); | 1564 | crypto_free_hash(tcp_conn->rx_hash.tfm); |
1572 | 1565 | ||
1573 | kfree(tcp_conn); | 1566 | iscsi_conn_teardown(cls_conn); |
1574 | } | 1567 | } |
1575 | 1568 | ||
1576 | static void | 1569 | static void |
@@ -1983,8 +1976,6 @@ static struct iscsi_transport iscsi_tcp_transport = { | |||
1983 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | | 1976 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | |
1984 | ISCSI_HOST_INITIATOR_NAME | | 1977 | ISCSI_HOST_INITIATOR_NAME | |
1985 | ISCSI_HOST_NETDEV_NAME, | 1978 | ISCSI_HOST_NETDEV_NAME, |
1986 | .conndata_size = sizeof(struct iscsi_conn), | ||
1987 | .sessiondata_size = sizeof(struct iscsi_session), | ||
1988 | /* session management */ | 1979 | /* session management */ |
1989 | .create_session = iscsi_tcp_session_create, | 1980 | .create_session = iscsi_tcp_session_create, |
1990 | .destroy_session = iscsi_tcp_session_destroy, | 1981 | .destroy_session = iscsi_tcp_session_destroy, |