Commit 4c577b1f authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic1e3d7ff435c454f40e81f9a4f90fe76589ec7b2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477189


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 7ff4d22d
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -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,
+0 −14
Original line number Diff line number Diff line
@@ -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;
}
+0 −1
Original line number Diff line number Diff line
@@ -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);
+0 −3
Original line number Diff line number Diff line
@@ -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));