From 7015e6b5d55c54469d124f6594933989cde01320 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Wed, 16 Oct 2019 17:19:10 +0900 Subject: [PATCH] lib/iscsi: Use rsp_pdu->data_buf_len in iscsi_op_login_rsp_handle() Use rsp_pdu->data_buf_len in iscsi_op_login_rsp_handle() and its calling functions. This makes the code a little clearer. Signed-off-by: Shuhei Matsumoto Change-Id: I89aa7155e97c1b770b333f7f12e84e13811af953 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471470 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 87e038d988..950ed74afe 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -1927,7 +1927,7 @@ iscsi_op_login_store_incoming_params(struct spdk_iscsi_conn *conn, static int iscsi_op_login_rsp_handle_csg_bit(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *rsp_pdu, - struct iscsi_param *params, int alloc_len) + struct iscsi_param *params) { const char *auth_method; int rc; @@ -1949,7 +1949,7 @@ iscsi_op_login_rsp_handle_csg_bit(struct spdk_iscsi_conn *conn, conn->authenticated = true; } else { rc = iscsi_auth_params(conn, params, auth_method, - rsp_pdu->data, alloc_len, + rsp_pdu->data, rsp_pdu->data_buf_len, rsp_pdu->data_segment_len); if (rc < 0) { SPDK_ERRLOG("iscsi_auth_params() failed\n"); @@ -2120,15 +2120,15 @@ iscsi_op_login_rsp_handle_t_bit(struct spdk_iscsi_conn *conn, */ static int iscsi_op_login_rsp_handle(struct spdk_iscsi_conn *conn, - struct spdk_iscsi_pdu *rsp_pdu, struct iscsi_param **params, - int alloc_len) + struct spdk_iscsi_pdu *rsp_pdu, struct iscsi_param **params) { int rc; struct iscsi_bhs_login_rsp *rsph; rsph = (struct iscsi_bhs_login_rsp *)&rsp_pdu->bhs; /* negotiate parameters */ - rc = spdk_iscsi_negotiate_params(conn, params, rsp_pdu->data, alloc_len, + rc = spdk_iscsi_negotiate_params(conn, params, rsp_pdu->data, + rsp_pdu->data_buf_len, rsp_pdu->data_segment_len); if (rc < 0) { /* @@ -2145,8 +2145,7 @@ iscsi_op_login_rsp_handle(struct spdk_iscsi_conn *conn, SPDK_LOGDUMP(SPDK_LOG_ISCSI, "Negotiated Params", rsp_pdu->data, rc); /* handle the CSG bit case */ - rc = iscsi_op_login_rsp_handle_csg_bit(conn, rsp_pdu, *params, - alloc_len); + rc = iscsi_op_login_rsp_handle_csg_bit(conn, rsp_pdu, *params); if (rc < 0) { return rc; } @@ -2207,7 +2206,7 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) } } - rc = iscsi_op_login_rsp_handle(conn, rsp_pdu, ¶ms, rsp_pdu->data_buf_len); + rc = iscsi_op_login_rsp_handle(conn, rsp_pdu, ¶ms); if (rc == SPDK_ISCSI_LOGIN_ERROR_RESPONSE) { iscsi_op_login_response(conn, rsp_pdu, params); return rc;