From 4308b9119fccb254dd12b6ad57bbb72b9dd75d59 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Sun, 1 Dec 2019 17:52:13 -0500 Subject: [PATCH] lib/iscsi: Move up iscsi_op_login_store_incoming_params in a file This patch series orders login related functions top down in iscsi.c. Signed-off-by: Shuhei Matsumoto Change-Id: I2f7dd681ca430c810dac6fcea122f84a142152d7 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476411 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index cec29bfe86..f988c3ffe0 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -1298,6 +1298,31 @@ iscsi_op_login_rsp_init(struct spdk_iscsi_conn *conn, return 0; } +static int +iscsi_op_login_store_incoming_params(struct spdk_iscsi_conn *conn, + struct spdk_iscsi_pdu *pdu, struct spdk_iscsi_pdu *rsp_pdu, + struct iscsi_param **params) +{ + struct iscsi_bhs_login_req *reqh; + struct iscsi_bhs_login_rsp *rsph; + int rc; + + reqh = (struct iscsi_bhs_login_req *)&pdu->bhs; + rsph = (struct iscsi_bhs_login_rsp *)&rsp_pdu->bhs; + + rc = spdk_iscsi_parse_params(params, pdu->data, + pdu->data_segment_len, ISCSI_BHS_LOGIN_GET_CBIT(reqh->flags), + &conn->partial_text_parameter); + if (rc < 0) { + SPDK_ERRLOG("iscsi_parse_params() failed\n"); + rsph->status_class = ISCSI_CLASS_INITIATOR_ERROR; + rsph->status_detail = ISCSI_LOGIN_INITIATOR_ERROR; + return SPDK_ISCSI_LOGIN_ERROR_PARAMETER; + } + + return 0; +} + /* * This function is used to del the original param and update it with new * value @@ -1891,31 +1916,6 @@ iscsi_op_login_phase_none(struct spdk_iscsi_conn *conn, return iscsi_op_login_set_target_info(conn, rsp_pdu, session_type); } -static int -iscsi_op_login_store_incoming_params(struct spdk_iscsi_conn *conn, - struct spdk_iscsi_pdu *pdu, struct spdk_iscsi_pdu *rsp_pdu, - struct iscsi_param **params) -{ - struct iscsi_bhs_login_req *reqh; - struct iscsi_bhs_login_rsp *rsph; - int rc; - - reqh = (struct iscsi_bhs_login_req *)&pdu->bhs; - rsph = (struct iscsi_bhs_login_rsp *)&rsp_pdu->bhs; - - rc = spdk_iscsi_parse_params(params, pdu->data, - pdu->data_segment_len, ISCSI_BHS_LOGIN_GET_CBIT(reqh->flags), - &conn->partial_text_parameter); - if (rc < 0) { - SPDK_ERRLOG("iscsi_parse_params() failed\n"); - rsph->status_class = ISCSI_CLASS_INITIATOR_ERROR; - rsph->status_detail = ISCSI_LOGIN_INITIATOR_ERROR; - return SPDK_ISCSI_LOGIN_ERROR_PARAMETER; - } - - return 0; -} - /* * This function is used to set the csg bit case in rsp * return: