From 5dd0e54d7ee5016b9e1cb986ea2e8af274d0586d Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Thu, 3 Oct 2019 08:47:57 +0900 Subject: [PATCH] lib/iscsi: Remove unnecessary declaration of remove_acked_pdu() Remove unnecessary declaration of remove_acked_pdu(), and move it down to just above the caller, spdk_iscsi_execute(). Signed-off-by: Shuhei Matsumoto Change-Id: I4af2c9707735669f3baac1fa6fee9bcaaa1cd64f Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470263 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 107ee25ed..a4758df8d 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -81,8 +81,6 @@ static int create_iscsi_sess(struct spdk_iscsi_conn *conn, static uint8_t append_iscsi_sess(struct spdk_iscsi_conn *conn, const char *initiator_port_name, uint16_t tsih, uint16_t cid); -static void remove_acked_pdu(struct spdk_iscsi_conn *conn, uint32_t ExpStatSN); - static int iscsi_reject(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu, int reason); @@ -4216,23 +4214,6 @@ iscsi_op_snack(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) return rc; } -/* This function is used to refree the pdu when it is acknowledged */ -static void -remove_acked_pdu(struct spdk_iscsi_conn *conn, uint32_t ExpStatSN) -{ - struct spdk_iscsi_pdu *pdu, *pdu_temp; - uint32_t stat_sn; - - conn->exp_statsn = DMIN32(ExpStatSN, conn->StatSN); - TAILQ_FOREACH_SAFE(pdu, &conn->snack_pdu_list, tailq, pdu_temp) { - stat_sn = from_be32(&pdu->bhs.stat_sn); - if (SN32_LT(stat_sn, conn->exp_statsn)) { - TAILQ_REMOVE(&conn->snack_pdu_list, pdu, tailq); - spdk_iscsi_conn_free_pdu(conn, pdu); - } - } -} - static int iscsi_op_data(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) { @@ -4429,6 +4410,23 @@ iscsi_pdu_dump(struct spdk_iscsi_pdu *pdu) SPDK_ERRLOGDUMP("PDU", (uint8_t *)&pdu->bhs, ISCSI_BHS_LEN); } +/* This function is used to refree the pdu when it is acknowledged */ +static void +remove_acked_pdu(struct spdk_iscsi_conn *conn, uint32_t ExpStatSN) +{ + struct spdk_iscsi_pdu *pdu, *pdu_temp; + uint32_t stat_sn; + + conn->exp_statsn = DMIN32(ExpStatSN, conn->StatSN); + TAILQ_FOREACH_SAFE(pdu, &conn->snack_pdu_list, tailq, pdu_temp) { + stat_sn = from_be32(&pdu->bhs.stat_sn); + if (SN32_LT(stat_sn, conn->exp_statsn)) { + TAILQ_REMOVE(&conn->snack_pdu_list, pdu, tailq); + spdk_iscsi_conn_free_pdu(conn, pdu); + } + } +} + int spdk_iscsi_execute(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) {