lib/iscsi: Move get_scsi_task_from_itt/ttt() down in the file
Move get_scsi_task_from_ttt() and get_scsi_task_from_itt() down in the file close to the location that uses them. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I5218eac3fda85e238d40eed7282d126ebe81c16b Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470267 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
c9e90fd05e
commit
058b13081e
@ -3060,47 +3060,6 @@ void spdk_clear_all_transfer_task(struct spdk_iscsi_conn *conn,
|
|||||||
start_queued_transfer_tasks(conn);
|
start_queued_transfer_tasks(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function returns the spdk_scsi_task by searching the snack list via
|
|
||||||
* task transfertag and the pdu's opcode
|
|
||||||
*/
|
|
||||||
static struct spdk_iscsi_task *
|
|
||||||
get_scsi_task_from_ttt(struct spdk_iscsi_conn *conn, uint32_t transfer_tag)
|
|
||||||
{
|
|
||||||
struct spdk_iscsi_pdu *pdu;
|
|
||||||
struct iscsi_bhs_data_in *datain_bhs;
|
|
||||||
|
|
||||||
TAILQ_FOREACH(pdu, &conn->snack_pdu_list, tailq) {
|
|
||||||
if (pdu->bhs.opcode == ISCSI_OP_SCSI_DATAIN) {
|
|
||||||
datain_bhs = (struct iscsi_bhs_data_in *)&pdu->bhs;
|
|
||||||
if (from_be32(&datain_bhs->ttt) == transfer_tag) {
|
|
||||||
return pdu->task;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function returns the spdk_scsi_task by searching the snack list via
|
|
||||||
* initiator task tag and the pdu's opcode
|
|
||||||
*/
|
|
||||||
static struct spdk_iscsi_task *
|
|
||||||
get_scsi_task_from_itt(struct spdk_iscsi_conn *conn,
|
|
||||||
uint32_t task_tag, enum iscsi_op opcode)
|
|
||||||
{
|
|
||||||
struct spdk_iscsi_pdu *pdu;
|
|
||||||
|
|
||||||
TAILQ_FOREACH(pdu, &conn->snack_pdu_list, tailq) {
|
|
||||||
if (pdu->bhs.opcode == opcode &&
|
|
||||||
pdu->task != NULL &&
|
|
||||||
pdu->task->tag == task_tag) {
|
|
||||||
return pdu->task;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
iscsi_send_datain(struct spdk_iscsi_conn *conn,
|
iscsi_send_datain(struct spdk_iscsi_conn *conn,
|
||||||
struct spdk_iscsi_task *task, int datain_flag,
|
struct spdk_iscsi_task *task, int datain_flag,
|
||||||
@ -4140,6 +4099,47 @@ iscsi_op_nopout(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This function returns the spdk_scsi_task by searching the snack list via
|
||||||
|
* task transfertag and the pdu's opcode
|
||||||
|
*/
|
||||||
|
static struct spdk_iscsi_task *
|
||||||
|
get_scsi_task_from_ttt(struct spdk_iscsi_conn *conn, uint32_t transfer_tag)
|
||||||
|
{
|
||||||
|
struct spdk_iscsi_pdu *pdu;
|
||||||
|
struct iscsi_bhs_data_in *datain_bhs;
|
||||||
|
|
||||||
|
TAILQ_FOREACH(pdu, &conn->snack_pdu_list, tailq) {
|
||||||
|
if (pdu->bhs.opcode == ISCSI_OP_SCSI_DATAIN) {
|
||||||
|
datain_bhs = (struct iscsi_bhs_data_in *)&pdu->bhs;
|
||||||
|
if (from_be32(&datain_bhs->ttt) == transfer_tag) {
|
||||||
|
return pdu->task;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This function returns the spdk_scsi_task by searching the snack list via
|
||||||
|
* initiator task tag and the pdu's opcode
|
||||||
|
*/
|
||||||
|
static struct spdk_iscsi_task *
|
||||||
|
get_scsi_task_from_itt(struct spdk_iscsi_conn *conn,
|
||||||
|
uint32_t task_tag, enum iscsi_op opcode)
|
||||||
|
{
|
||||||
|
struct spdk_iscsi_pdu *pdu;
|
||||||
|
|
||||||
|
TAILQ_FOREACH(pdu, &conn->snack_pdu_list, tailq) {
|
||||||
|
if (pdu->bhs.opcode == opcode &&
|
||||||
|
pdu->task != NULL &&
|
||||||
|
pdu->task->tag == task_tag) {
|
||||||
|
return pdu->task;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* This function is used to handle the r2t snack */
|
/* This function is used to handle the r2t snack */
|
||||||
static int
|
static int
|
||||||
iscsi_handle_r2t_snack(struct spdk_iscsi_conn *conn,
|
iscsi_handle_r2t_snack(struct spdk_iscsi_conn *conn,
|
||||||
|
Loading…
Reference in New Issue
Block a user