lib/iscsi: Change spdk_iscsi_is_deferred_free_pdu() to private and rename it

spdk_iscsi_is_deferred_free_pdu() is called only in a single
place of conn.c.  So change it to private in conn.c.  Additionally,
iscsi_is_free_pdu()_deferred() may be a little more meaningful
and rename to it.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic1e3d7ff435c454f40e81f9a4f90fe76589ec7b2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477189
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-12-08 20:20:54 -05:00 committed by Tomasz Zawadzki
parent 7ff4d22d4c
commit 4c577b1fce
4 changed files with 16 additions and 19 deletions
lib/iscsi
test/unit/lib/iscsi/conn.c

@ -1257,6 +1257,21 @@ spdk_iscsi_conn_handle_nop(struct spdk_iscsi_conn *conn)
}
}
static bool
iscsi_is_free_pdu_deferred(struct spdk_iscsi_pdu *pdu)
{
if (pdu == NULL) {
return false;
}
if (pdu->bhs.opcode == ISCSI_OP_R2T ||
pdu->bhs.opcode == ISCSI_OP_SCSI_DATAIN) {
return true;
}
return false;
}
/**
* \brief Makes one attempt to flush response PDUs back to the initiator.
*
@ -1355,7 +1370,7 @@ iscsi_conn_flush_pdus_internal(struct spdk_iscsi_conn *conn)
TAILQ_REMOVE(&completed_pdus_list, pdu, tailq);
if ((conn->full_feature) &&
(conn->sess->ErrorRecoveryLevel >= 1) &&
spdk_iscsi_is_deferred_free_pdu(pdu)) {
iscsi_is_free_pdu_deferred(pdu)) {
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "stat_sn=%d\n",
from_be32(&pdu->bhs.stat_sn));
TAILQ_INSERT_TAIL(&conn->snack_pdu_list, pdu,

@ -4961,17 +4961,3 @@ spdk_iscsi_handle_incoming_pdus(struct spdk_iscsi_conn *conn)
return i;
}
bool spdk_iscsi_is_deferred_free_pdu(struct spdk_iscsi_pdu *pdu)
{
if (pdu == NULL) {
return false;
}
if (pdu->bhs.opcode == ISCSI_OP_R2T ||
pdu->bhs.opcode == ISCSI_OP_SCSI_DATAIN) {
return true;
}
return false;
}

@ -427,7 +427,6 @@ void spdk_clear_all_transfer_task(struct spdk_iscsi_conn *conn,
struct spdk_scsi_lun *lun,
struct spdk_iscsi_pdu *pdu);
bool spdk_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t CmdSN);
bool spdk_iscsi_is_deferred_free_pdu(struct spdk_iscsi_pdu *pdu);
uint32_t spdk_iscsi_pdu_calc_header_digest(struct spdk_iscsi_pdu *pdu);
uint32_t spdk_iscsi_pdu_calc_data_digest(struct spdk_iscsi_pdu *pdu);

@ -153,9 +153,6 @@ DEFINE_STUB(spdk_iscsi_build_iovs, int,
struct spdk_iscsi_pdu *pdu, uint32_t *mapped_length),
0);
DEFINE_STUB(spdk_iscsi_is_deferred_free_pdu, bool,
(struct spdk_iscsi_pdu *pdu), false);
DEFINE_STUB_V(spdk_iscsi_task_response,
(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task));