iscsi: Remove SPDK_SUCCESS and use 0 instead
SPDK_SUCCESS is a remnant and all other SPDK libraries have used just 0. So this patch removes SPDK_SUCCESS from iSCSI library and uses 0 instead. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Ie33fd26238411e994ea9ea0c898da1abb502cad6 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456928 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
872d8d8ea7
commit
2761079168
@ -3467,14 +3467,14 @@ iscsi_op_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
SPDK_NOTICELOG("ABORT_TASK\n");
|
||||
|
||||
iscsi_op_abort_task(task, ref_task_tag);
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
|
||||
/* abort all tasks issued via this session on the LUN */
|
||||
case ISCSI_TASK_FUNC_ABORT_TASK_SET:
|
||||
SPDK_NOTICELOG("ABORT_TASK_SET\n");
|
||||
|
||||
spdk_iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_ABORT_TASK_SET);
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
|
||||
case ISCSI_TASK_FUNC_CLEAR_TASK_SET:
|
||||
task->scsi.response = SPDK_SCSI_TASK_MGMT_RESP_REJECT_FUNC_NOT_SUPPORTED;
|
||||
@ -3490,7 +3490,7 @@ iscsi_op_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
SPDK_NOTICELOG("LOGICAL_UNIT_RESET\n");
|
||||
|
||||
spdk_iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_LUN_RESET);
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
|
||||
case ISCSI_TASK_FUNC_TARGET_WARM_RESET:
|
||||
SPDK_NOTICELOG("TARGET_WARM_RESET (Unsupported)\n");
|
||||
@ -3598,7 +3598,7 @@ iscsi_op_nopout(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
if (task_tag == 0xffffffffU) {
|
||||
if (I_bit == 1) {
|
||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "got NOPOUT ITT=0xffffffff\n");
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
} else {
|
||||
SPDK_ERRLOG("got NOPOUT ITT=0xffffffff, I=0\n");
|
||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||
@ -3647,7 +3647,7 @@ iscsi_op_nopout(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
spdk_iscsi_conn_write_pdu(conn, rsp_pdu);
|
||||
conn->last_nopin = spdk_get_ticks();
|
||||
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -3676,7 +3676,7 @@ add_transfer_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task)
|
||||
*/
|
||||
if (conn->pending_r2t >= DEFAULT_MAXR2T) {
|
||||
TAILQ_INSERT_TAIL(&conn->queued_r2t_tasks, task, link);
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
conn->data_out_cnt += data_out_req;
|
||||
@ -3711,7 +3711,7 @@ add_transfer_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task)
|
||||
}
|
||||
|
||||
TAILQ_INSERT_TAIL(&conn->active_r2t_tasks, task, link);
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If there are additional large writes queued for R2Ts, start them now.
|
||||
@ -4385,7 +4385,7 @@ iscsi_send_r2t(struct spdk_iscsi_conn *conn,
|
||||
|
||||
spdk_iscsi_conn_write_pdu(conn, rsp_pdu);
|
||||
|
||||
return SPDK_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void spdk_iscsi_send_nopin(struct spdk_iscsi_conn *conn)
|
||||
|
@ -353,7 +353,6 @@ struct spdk_iscsi_globals {
|
||||
#define ISCSI_FULL_FEATURE_PHASE 3
|
||||
|
||||
enum spdk_error_codes {
|
||||
SPDK_SUCCESS = 0,
|
||||
SPDK_ISCSI_CONNECTION_FATAL = -1,
|
||||
SPDK_PDU_FATAL = -2,
|
||||
};
|
||||
|
@ -566,7 +566,7 @@ add_transfer_task_test(void)
|
||||
|
||||
rc = add_transfer_task(&conn, &task);
|
||||
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
CU_ASSERT(TAILQ_FIRST(&conn.queued_r2t_tasks) == &task);
|
||||
|
||||
TAILQ_REMOVE(&conn.queued_r2t_tasks, &task, link);
|
||||
@ -577,7 +577,7 @@ add_transfer_task_test(void)
|
||||
|
||||
rc = add_transfer_task(&conn, &task);
|
||||
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
CU_ASSERT(TAILQ_FIRST(&conn.active_r2t_tasks) == &task);
|
||||
|
||||
TAILQ_REMOVE(&conn.active_r2t_tasks, &task, link);
|
||||
@ -644,7 +644,7 @@ get_transfer_task_test(void)
|
||||
spdk_iscsi_task_set_pdu(&task1, pdu1);
|
||||
|
||||
rc = add_transfer_task(&conn, &task1);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
pdu2 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(pdu2 != NULL);
|
||||
@ -654,7 +654,7 @@ get_transfer_task_test(void)
|
||||
spdk_iscsi_task_set_pdu(&task2, pdu2);
|
||||
|
||||
rc = add_transfer_task(&conn, &task2);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
task = get_transfer_task(&conn, 1);
|
||||
CU_ASSERT(task == &task1);
|
||||
@ -710,7 +710,7 @@ del_transfer_task_test(void)
|
||||
task1.tag = 11;
|
||||
|
||||
rc = add_transfer_task(&conn, &task1);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
pdu2 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(pdu2 != NULL);
|
||||
@ -721,7 +721,7 @@ del_transfer_task_test(void)
|
||||
task2.tag = 12;
|
||||
|
||||
rc = add_transfer_task(&conn, &task2);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
pdu3 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(pdu3 != NULL);
|
||||
@ -732,7 +732,7 @@ del_transfer_task_test(void)
|
||||
task3.tag = 13;
|
||||
|
||||
rc = add_transfer_task(&conn, &task3);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
pdu4 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(pdu4 != NULL);
|
||||
@ -743,7 +743,7 @@ del_transfer_task_test(void)
|
||||
task4.tag = 14;
|
||||
|
||||
rc = add_transfer_task(&conn, &task4);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
pdu5 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(pdu5 != NULL);
|
||||
@ -754,7 +754,7 @@ del_transfer_task_test(void)
|
||||
task5.tag = 15;
|
||||
|
||||
rc = add_transfer_task(&conn, &task5);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
CU_ASSERT(get_transfer_task(&conn, 1) == &task1);
|
||||
CU_ASSERT(get_transfer_task(&conn, 5) == NULL);
|
||||
@ -835,7 +835,7 @@ clear_all_transfer_tasks_test(void)
|
||||
spdk_iscsi_task_set_pdu(task1, pdu1);
|
||||
|
||||
rc = add_transfer_task(&conn, task1);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
mgmt_pdu1 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(mgmt_pdu1 != NULL);
|
||||
@ -856,7 +856,7 @@ clear_all_transfer_tasks_test(void)
|
||||
spdk_iscsi_task_set_pdu(task2, pdu2);
|
||||
|
||||
rc = add_transfer_task(&conn, task2);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
task3 = spdk_iscsi_task_get(&conn, NULL, NULL);
|
||||
SPDK_CU_ASSERT_FATAL(task3 != NULL);
|
||||
@ -871,7 +871,7 @@ clear_all_transfer_tasks_test(void)
|
||||
spdk_iscsi_task_set_pdu(task3, pdu3);
|
||||
|
||||
rc = add_transfer_task(&conn, task3);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
task4 = spdk_iscsi_task_get(&conn, NULL, NULL);
|
||||
SPDK_CU_ASSERT_FATAL(task4 != NULL);
|
||||
@ -886,7 +886,7 @@ clear_all_transfer_tasks_test(void)
|
||||
spdk_iscsi_task_set_pdu(task4, pdu4);
|
||||
|
||||
rc = add_transfer_task(&conn, task4);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
task5 = spdk_iscsi_task_get(&conn, NULL, NULL);
|
||||
SPDK_CU_ASSERT_FATAL(task5 != NULL);
|
||||
@ -901,7 +901,7 @@ clear_all_transfer_tasks_test(void)
|
||||
spdk_iscsi_task_set_pdu(task5, pdu5);
|
||||
|
||||
rc = add_transfer_task(&conn, task5);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
mgmt_pdu2 = spdk_get_pdu();
|
||||
SPDK_CU_ASSERT_FATAL(mgmt_pdu2 != NULL);
|
||||
@ -922,7 +922,7 @@ clear_all_transfer_tasks_test(void)
|
||||
spdk_iscsi_task_set_pdu(task6, pdu6);
|
||||
|
||||
rc = add_transfer_task(&conn, task6);
|
||||
CU_ASSERT(rc == SPDK_SUCCESS);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
CU_ASSERT(conn.ttt == 4);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user