diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index c58d6c74b..808c8b556 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -776,7 +776,7 @@ static void iscsi_conn_check_shutdown_cb(void *arg1) { _iscsi_conns_cleanup(); - spdk_shutdown_iscsi_conns_done(); + shutdown_iscsi_conns_done(); } static int @@ -1071,7 +1071,7 @@ iscsi_conn_handle_queued_datain_tasks(struct spdk_iscsi_conn *conn) subtask->scsi.length = spdk_min(SPDK_BDEV_LARGE_BUF_MAX_SIZE, remaining_size); task->current_datain_offset += subtask->scsi.length; - spdk_iscsi_queue_task(conn, subtask); + iscsi_queue_task(conn, subtask); } if (task->current_datain_offset == task->scsi.transfer_len) { TAILQ_REMOVE(&conn->queued_datain_tasks, task, link); @@ -1085,7 +1085,7 @@ iscsi_task_mgmt_cpl(struct spdk_scsi_task *scsi_task) { struct spdk_iscsi_task *task = iscsi_task_from_scsi_task(scsi_task); - spdk_iscsi_task_mgmt_response(task->conn, task); + iscsi_task_mgmt_response(task->conn, task); iscsi_task_put(task); } @@ -1118,7 +1118,7 @@ process_completed_read_subtask_list(struct spdk_iscsi_conn *conn, if (subtask->scsi.offset == primary->bytes_completed) { TAILQ_REMOVE(&primary->subtask_list, subtask, subtask_link); primary->bytes_completed += subtask->scsi.length; - spdk_iscsi_task_response(conn, subtask); + iscsi_task_response(conn, subtask); iscsi_task_put(subtask); } else { break; @@ -1160,7 +1160,7 @@ process_read_task_completion(struct spdk_iscsi_conn *conn, primary->bytes_completed = task->scsi.length; /* For non split read I/O */ assert(primary->bytes_completed == task->scsi.transfer_len); - spdk_iscsi_task_response(conn, task); + iscsi_task_response(conn, task); iscsi_task_put(task); } else { if (task->scsi.offset != primary->bytes_completed) { @@ -1223,13 +1223,13 @@ process_non_read_task_completion(struct spdk_iscsi_conn *conn, if (primary->rsp_scsi_status != SPDK_SCSI_STATUS_GOOD) { iscsi_task_copy_from_rsp_scsi_status(&primary->scsi, primary); } - spdk_iscsi_task_response(conn, primary); + iscsi_task_response(conn, primary); TAILQ_REMOVE(&conn->active_r2t_tasks, primary, link); primary->is_r2t_active = false; iscsi_task_put(primary); } } else { - spdk_iscsi_task_response(conn, task); + iscsi_task_response(conn, task); } } iscsi_task_put(task); @@ -1510,13 +1510,13 @@ iscsi_conn_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu, if (pdu->bhs.opcode != ISCSI_OP_LOGIN_RSP) { /* Header Digest */ if (conn->header_digest) { - crc32c = spdk_iscsi_pdu_calc_header_digest(pdu); + crc32c = iscsi_pdu_calc_header_digest(pdu); MAKE_DIGEST_WORD(pdu->header_digest, crc32c); } /* Data Digest */ if (conn->data_digest && DGET24(pdu->bhs.data_segment_len) != 0) { - crc32c = spdk_iscsi_pdu_calc_data_digest(pdu); + crc32c = iscsi_pdu_calc_data_digest(pdu); MAKE_DIGEST_WORD(pdu->data_digest, crc32c); } } @@ -1528,8 +1528,8 @@ iscsi_conn_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu, if (spdk_unlikely(conn->state >= ISCSI_CONN_STATE_EXITING)) { return; } - pdu->sock_req.iovcnt = spdk_iscsi_build_iovs(conn, pdu->iov, SPDK_COUNTOF(pdu->iov), pdu, - &pdu->mapped_length); + pdu->sock_req.iovcnt = iscsi_build_iovs(conn, pdu->iov, SPDK_COUNTOF(pdu->iov), pdu, + &pdu->mapped_length); pdu->sock_req.cb_fn = _iscsi_conn_pdu_write_done; pdu->sock_req.cb_arg = pdu; @@ -1552,7 +1552,7 @@ iscsi_conn_sock_cb(void *arg, struct spdk_sock_group *group, struct spdk_sock *s } /* Handle incoming PDUs */ - rc = spdk_iscsi_handle_incoming_pdus(conn); + rc = iscsi_handle_incoming_pdus(conn); if (rc < 0) { conn->state = ISCSI_CONN_STATE_EXITING; } diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 7379dde3c..400340718 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -294,7 +294,7 @@ iscsi_reject(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu, } uint32_t -spdk_iscsi_pdu_calc_header_digest(struct spdk_iscsi_pdu *pdu) +iscsi_pdu_calc_header_digest(struct spdk_iscsi_pdu *pdu) { uint32_t crc32c; uint32_t ahs_len_bytes = pdu->bhs.total_ahs_len * 4; @@ -312,7 +312,7 @@ spdk_iscsi_pdu_calc_header_digest(struct spdk_iscsi_pdu *pdu) } uint32_t -spdk_iscsi_pdu_calc_data_digest(struct spdk_iscsi_pdu *pdu) +iscsi_pdu_calc_data_digest(struct spdk_iscsi_pdu *pdu) { uint32_t data_len = DGET24(pdu->bhs.data_segment_len); uint32_t crc32c; @@ -460,8 +460,8 @@ _iscsi_sgl_append_with_md(struct _iscsi_sgl *s, } int -spdk_iscsi_build_iovs(struct spdk_iscsi_conn *conn, struct iovec *iovs, int iovcnt, - struct spdk_iscsi_pdu *pdu, uint32_t *_mapped_length) +iscsi_build_iovs(struct spdk_iscsi_conn *conn, struct iovec *iovs, int iovcnt, + struct spdk_iscsi_pdu *pdu, uint32_t *_mapped_length) { struct _iscsi_sgl sgl; int enable_digest; @@ -931,10 +931,10 @@ iscsi_auth_params(struct spdk_iscsi_conn *conn, SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "ag_tag=%d\n", conn->chap_group); - rc = spdk_iscsi_chap_get_authinfo(&conn->auth, name, conn->chap_group); + rc = iscsi_chap_get_authinfo(&conn->auth, name, conn->chap_group); if (rc < 0) { /* SPDK_ERRLOG("auth user or secret is missing\n"); */ - SPDK_ERRLOG("spdk_iscsi_chap_get_authinfo() failed\n"); + SPDK_ERRLOG("iscsi_chap_get_authinfo() failed\n"); goto error_return; } if (conn->auth.user[0] == '\0' || conn->auth.secret[0] == '\0') { @@ -2856,7 +2856,7 @@ del_connection_queued_task(struct spdk_iscsi_conn *conn, void *tailq, task->is_r2t_active = false; if (lun != NULL && spdk_scsi_lun_is_removing(lun)) { spdk_scsi_task_process_null_lun(&task->scsi); - spdk_iscsi_task_response(conn, task); + iscsi_task_response(conn, task); } iscsi_task_put(task); } @@ -3125,8 +3125,8 @@ iscsi_transfer_in(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task) return sent_status; } -void spdk_iscsi_task_response(struct spdk_iscsi_conn *conn, - struct spdk_iscsi_task *task) +void iscsi_task_response(struct spdk_iscsi_conn *conn, + struct spdk_iscsi_task *task) { struct spdk_iscsi_pdu *rsp_pdu; struct iscsi_bhs_scsi_resp *rsph; @@ -3255,7 +3255,7 @@ iscsi_compare_pdu_bhs_within_existed_r2t_tasks(struct spdk_iscsi_conn *conn, } void -spdk_iscsi_queue_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task) +iscsi_queue_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task) { spdk_trace_record(TRACE_ISCSI_TASK_QUEUE, conn->id, task->scsi.length, (uintptr_t)task, (uintptr_t)task->pdu); @@ -3272,7 +3272,7 @@ iscsi_pdu_payload_op_scsi_read(struct spdk_iscsi_conn *conn, struct spdk_iscsi_t task->scsi.length = task->scsi.transfer_len; spdk_scsi_task_set_data(&task->scsi, NULL, 0); - spdk_iscsi_queue_task(conn, task); + iscsi_queue_task(conn, task); return 0; } else { TAILQ_INIT(&task->subtask_list); @@ -3330,7 +3330,7 @@ iscsi_pdu_payload_op_scsi_write(struct spdk_iscsi_conn *conn, struct spdk_iscsi_ task->scsi.length = transfer_len; } - spdk_iscsi_queue_task(conn, task); + iscsi_queue_task(conn, task); return 0; } @@ -3403,7 +3403,7 @@ iscsi_pdu_hdr_op_scsi(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) if ((conn->sess->ErrorRecoveryLevel >= 1) && (iscsi_compare_pdu_bhs_within_existed_r2t_tasks(conn, pdu))) { - spdk_iscsi_task_response(conn, task); + iscsi_task_response(conn, task); iscsi_task_put(task); return 0; } @@ -3469,7 +3469,7 @@ iscsi_pdu_payload_op_scsi(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p case SPDK_SCSI_DIR_TO_DEV: return iscsi_pdu_payload_op_scsi_write(conn, task); case SPDK_SCSI_DIR_NONE: - spdk_iscsi_queue_task(conn, task); + iscsi_queue_task(conn, task); return 0; default: assert(false); @@ -3506,8 +3506,8 @@ abort_transfer_task_in_task_mgmt_resp(struct spdk_iscsi_conn *conn, } void -spdk_iscsi_task_mgmt_response(struct spdk_iscsi_conn *conn, - struct spdk_iscsi_task *task) +iscsi_task_mgmt_response(struct spdk_iscsi_conn *conn, + struct spdk_iscsi_task *task) { struct spdk_iscsi_pdu *rsp_pdu; struct iscsi_bhs_task_req *reqh; @@ -3572,7 +3572,7 @@ iscsi_queue_mgmt_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task lun = spdk_scsi_dev_get_lun(conn->dev, task->lun_id); if (lun == NULL) { task->scsi.response = SPDK_SCSI_TASK_MGMT_RESP_INVALID_LUN; - spdk_iscsi_task_mgmt_response(conn, task); + iscsi_task_mgmt_response(conn, task); iscsi_task_put(task); return; } @@ -3622,7 +3622,7 @@ _iscsi_op_abort_task_set(void *arg) } void -spdk_iscsi_op_abort_task_set(struct spdk_iscsi_task *task, uint8_t function) +iscsi_op_abort_task_set(struct spdk_iscsi_task *task, uint8_t function) { task->scsi.function = function; task->mgmt_poller = SPDK_POLLER_REGISTER(_iscsi_op_abort_task_set, task, 10); @@ -3675,7 +3675,7 @@ iscsi_pdu_hdr_op_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) if (task->scsi.lun == NULL) { task->scsi.response = SPDK_SCSI_TASK_MGMT_RESP_INVALID_LUN; - spdk_iscsi_task_mgmt_response(conn, task); + iscsi_task_mgmt_response(conn, task); iscsi_task_put(task); return 0; } @@ -3692,7 +3692,7 @@ iscsi_pdu_hdr_op_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) 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); + iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_ABORT_TASK_SET); return 0; case ISCSI_TASK_FUNC_CLEAR_TASK_SET: @@ -3708,7 +3708,7 @@ iscsi_pdu_hdr_op_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) case ISCSI_TASK_FUNC_LOGICAL_UNIT_RESET: SPDK_NOTICELOG("LOGICAL_UNIT_RESET\n"); - spdk_iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_LUN_RESET); + iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_LUN_RESET); return 0; case ISCSI_TASK_FUNC_TARGET_WARM_RESET: @@ -3732,7 +3732,7 @@ iscsi_pdu_hdr_op_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) break; } - spdk_iscsi_task_mgmt_response(conn, task); + iscsi_task_mgmt_response(conn, task); iscsi_task_put(task); return 0; } @@ -4368,7 +4368,7 @@ iscsi_pdu_payload_op_data(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p return 0; } - spdk_iscsi_queue_task(conn, subtask); + iscsi_queue_task(conn, subtask); return 0; } @@ -4688,7 +4688,7 @@ iscsi_read_pdu(struct spdk_iscsi_conn *conn) } if (conn->header_digest) { - crc32c = spdk_iscsi_pdu_calc_header_digest(pdu); + crc32c = iscsi_pdu_calc_header_digest(pdu); rc = MATCH_DIGEST_WORD(pdu->header_digest, crc32c); if (rc == 0) { SPDK_ERRLOG("header digest error (%s)\n", conn->initiator_name); @@ -4768,7 +4768,7 @@ iscsi_read_pdu(struct spdk_iscsi_conn *conn) /* check data digest */ if (conn->data_digest && data_len != 0) { - crc32c = spdk_iscsi_pdu_calc_data_digest(pdu); + crc32c = iscsi_pdu_calc_data_digest(pdu); rc = MATCH_DIGEST_WORD(pdu->data_digest, crc32c); if (rc == 0) { SPDK_ERRLOG("data digest error (%s)\n", conn->initiator_name); @@ -4813,7 +4813,7 @@ iscsi_read_pdu(struct spdk_iscsi_conn *conn) #define GET_PDU_LOOP_COUNT 16 int -spdk_iscsi_handle_incoming_pdus(struct spdk_iscsi_conn *conn) +iscsi_handle_incoming_pdus(struct spdk_iscsi_conn *conn) { int i, rc; diff --git a/lib/iscsi/iscsi.h b/lib/iscsi/iscsi.h index 93678c921..c998466e8 100644 --- a/lib/iscsi/iscsi.h +++ b/lib/iscsi/iscsi.h @@ -400,35 +400,35 @@ typedef void (*spdk_iscsi_init_cb)(void *cb_arg, int rc); void spdk_iscsi_init(spdk_iscsi_init_cb cb_fn, void *cb_arg); typedef void (*spdk_iscsi_fini_cb)(void *arg); void spdk_iscsi_fini(spdk_iscsi_fini_cb cb_fn, void *cb_arg); -void spdk_shutdown_iscsi_conns_done(void); +void shutdown_iscsi_conns_done(void); void spdk_iscsi_config_text(FILE *fp); void spdk_iscsi_config_json(struct spdk_json_write_ctx *w); -struct spdk_iscsi_opts *spdk_iscsi_opts_alloc(void); -void spdk_iscsi_opts_free(struct spdk_iscsi_opts *opts); -struct spdk_iscsi_opts *spdk_iscsi_opts_copy(struct spdk_iscsi_opts *src); -void spdk_iscsi_opts_info_json(struct spdk_json_write_ctx *w); -int spdk_iscsi_set_discovery_auth(bool disable_chap, bool require_chap, - bool mutual_chap, int32_t chap_group); -int spdk_iscsi_chap_get_authinfo(struct iscsi_chap_auth *auth, const char *authuser, - int ag_tag); -int spdk_iscsi_add_auth_group(int32_t tag, struct spdk_iscsi_auth_group **_group); -struct spdk_iscsi_auth_group *spdk_iscsi_find_auth_group_by_tag(int32_t tag); -void spdk_iscsi_delete_auth_group(struct spdk_iscsi_auth_group *group); -int spdk_iscsi_auth_group_add_secret(struct spdk_iscsi_auth_group *group, - const char *user, const char *secret, - const char *muser, const char *msecret); -int spdk_iscsi_auth_group_delete_secret(struct spdk_iscsi_auth_group *group, - const char *user); -void spdk_iscsi_auth_groups_info_json(struct spdk_json_write_ctx *w); +struct spdk_iscsi_opts *iscsi_opts_alloc(void); +void iscsi_opts_free(struct spdk_iscsi_opts *opts); +struct spdk_iscsi_opts *iscsi_opts_copy(struct spdk_iscsi_opts *src); +void iscsi_opts_info_json(struct spdk_json_write_ctx *w); +int iscsi_set_discovery_auth(bool disable_chap, bool require_chap, + bool mutual_chap, int32_t chap_group); +int iscsi_chap_get_authinfo(struct iscsi_chap_auth *auth, const char *authuser, + int ag_tag); +int iscsi_add_auth_group(int32_t tag, struct spdk_iscsi_auth_group **_group); +struct spdk_iscsi_auth_group *iscsi_find_auth_group_by_tag(int32_t tag); +void iscsi_delete_auth_group(struct spdk_iscsi_auth_group *group); +int iscsi_auth_group_add_secret(struct spdk_iscsi_auth_group *group, + const char *user, const char *secret, + const char *muser, const char *msecret); +int iscsi_auth_group_delete_secret(struct spdk_iscsi_auth_group *group, + const char *user); +void iscsi_auth_groups_info_json(struct spdk_json_write_ctx *w); -void spdk_iscsi_task_response(struct spdk_iscsi_conn *conn, +void iscsi_task_response(struct spdk_iscsi_conn *conn, + struct spdk_iscsi_task *task); +int iscsi_build_iovs(struct spdk_iscsi_conn *conn, struct iovec *iovs, int iovcnt, + struct spdk_iscsi_pdu *pdu, uint32_t *mapped_length); +int iscsi_handle_incoming_pdus(struct spdk_iscsi_conn *conn); +void iscsi_task_mgmt_response(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task); -int spdk_iscsi_build_iovs(struct spdk_iscsi_conn *conn, struct iovec *iovs, int iovcnt, - struct spdk_iscsi_pdu *pdu, uint32_t *mapped_length); -int spdk_iscsi_handle_incoming_pdus(struct spdk_iscsi_conn *conn); -void spdk_iscsi_task_mgmt_response(struct spdk_iscsi_conn *conn, - struct spdk_iscsi_task *task); void iscsi_free_sess(struct spdk_iscsi_sess *sess); void iscsi_clear_all_transfer_task(struct spdk_iscsi_conn *conn, @@ -436,15 +436,15 @@ void iscsi_clear_all_transfer_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu); bool iscsi_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t CmdSN); -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); +uint32_t iscsi_pdu_calc_header_digest(struct spdk_iscsi_pdu *pdu); +uint32_t iscsi_pdu_calc_data_digest(struct spdk_iscsi_pdu *pdu); /* Memory management */ void iscsi_put_pdu(struct spdk_iscsi_pdu *pdu); struct spdk_iscsi_pdu *iscsi_get_pdu(struct spdk_iscsi_conn *conn); -void spdk_iscsi_op_abort_task_set(struct spdk_iscsi_task *task, - uint8_t function); -void spdk_iscsi_queue_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task); +void iscsi_op_abort_task_set(struct spdk_iscsi_task *task, + uint8_t function); +void iscsi_queue_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task); static inline uint32_t iscsi_get_max_immediate_data_size(void) diff --git a/lib/iscsi/iscsi_rpc.c b/lib/iscsi/iscsi_rpc.c index 4cf2082c0..70579bb77 100644 --- a/lib/iscsi/iscsi_rpc.c +++ b/lib/iscsi/iscsi_rpc.c @@ -1161,7 +1161,7 @@ spdk_rpc_iscsi_get_options(struct spdk_jsonrpc_request *request, } w = spdk_jsonrpc_begin_result(request); - spdk_iscsi_opts_info_json(w); + iscsi_opts_info_json(w); spdk_jsonrpc_end_result(request, w); } @@ -1198,8 +1198,8 @@ spdk_rpc_iscsi_set_discovery_auth(struct spdk_jsonrpc_request *request, return; } - rc = spdk_iscsi_set_discovery_auth(req.disable_chap, req.require_chap, - req.mutual_chap, req.chap_group); + rc = iscsi_set_discovery_auth(req.disable_chap, req.require_chap, + req.mutual_chap, req.chap_group); if (rc < 0) { spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid combination of CHAP params"); @@ -1310,7 +1310,7 @@ spdk_rpc_iscsi_create_auth_group(struct spdk_jsonrpc_request *request, pthread_mutex_lock(&g_iscsi.mutex); - rc = spdk_iscsi_add_auth_group(req.tag, &group); + rc = iscsi_add_auth_group(req.tag, &group); if (rc != 0) { pthread_mutex_unlock(&g_iscsi.mutex); @@ -1323,10 +1323,10 @@ spdk_rpc_iscsi_create_auth_group(struct spdk_jsonrpc_request *request, for (i = 0; i < req.secrets.num_secret; i++) { _secret = &req.secrets.secrets[i]; - rc = spdk_iscsi_auth_group_add_secret(group, _secret->user, _secret->secret, - _secret->muser, _secret->msecret); + rc = iscsi_auth_group_add_secret(group, _secret->user, _secret->secret, + _secret->muser, _secret->msecret); if (rc != 0) { - spdk_iscsi_delete_auth_group(group); + iscsi_delete_auth_group(group); pthread_mutex_unlock(&g_iscsi.mutex); spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, @@ -1374,7 +1374,7 @@ spdk_rpc_iscsi_delete_auth_group(struct spdk_jsonrpc_request *request, pthread_mutex_lock(&g_iscsi.mutex); - group = spdk_iscsi_find_auth_group_by_tag(req.tag); + group = iscsi_find_auth_group_by_tag(req.tag); if (group == NULL) { pthread_mutex_unlock(&g_iscsi.mutex); @@ -1383,7 +1383,7 @@ spdk_rpc_iscsi_delete_auth_group(struct spdk_jsonrpc_request *request, return; } - spdk_iscsi_delete_auth_group(group); + iscsi_delete_auth_group(group); pthread_mutex_unlock(&g_iscsi.mutex); @@ -1439,7 +1439,7 @@ spdk_rpc_iscsi_auth_group_add_secret(struct spdk_jsonrpc_request *request, pthread_mutex_lock(&g_iscsi.mutex); - group = spdk_iscsi_find_auth_group_by_tag(req.tag); + group = iscsi_find_auth_group_by_tag(req.tag); if (group == NULL) { pthread_mutex_unlock(&g_iscsi.mutex); @@ -1449,7 +1449,7 @@ spdk_rpc_iscsi_auth_group_add_secret(struct spdk_jsonrpc_request *request, return; } - rc = spdk_iscsi_auth_group_add_secret(group, req.user, req.secret, req.muser, req.msecret); + rc = iscsi_auth_group_add_secret(group, req.user, req.secret, req.muser, req.msecret); if (rc != 0) { pthread_mutex_unlock(&g_iscsi.mutex); @@ -1509,7 +1509,7 @@ spdk_rpc_iscsi_auth_group_remove_secret(struct spdk_jsonrpc_request *request, pthread_mutex_lock(&g_iscsi.mutex); - group = spdk_iscsi_find_auth_group_by_tag(req.tag); + group = iscsi_find_auth_group_by_tag(req.tag); if (group == NULL) { pthread_mutex_unlock(&g_iscsi.mutex); @@ -1519,7 +1519,7 @@ spdk_rpc_iscsi_auth_group_remove_secret(struct spdk_jsonrpc_request *request, return; } - rc = spdk_iscsi_auth_group_delete_secret(group, req.user); + rc = iscsi_auth_group_delete_secret(group, req.user); if (rc != 0) { pthread_mutex_unlock(&g_iscsi.mutex); @@ -1557,7 +1557,7 @@ spdk_rpc_iscsi_get_auth_groups(struct spdk_jsonrpc_request *request, w = spdk_jsonrpc_begin_result(request); spdk_json_write_array_begin(w); - spdk_iscsi_auth_groups_info_json(w); + iscsi_auth_groups_info_json(w); spdk_json_write_array_end(w); spdk_jsonrpc_end_result(request, w); @@ -1603,9 +1603,9 @@ spdk_rpc_iscsi_set_options(struct spdk_jsonrpc_request *request, return; } - opts = spdk_iscsi_opts_alloc(); + opts = iscsi_opts_alloc(); if (opts == NULL) { - SPDK_ERRLOG("spdk_iscsi_opts_alloc() failed.\n"); + SPDK_ERRLOG("iscsi_opts_alloc() failed.\n"); spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Out of memory"); return; @@ -1617,16 +1617,16 @@ spdk_rpc_iscsi_set_options(struct spdk_jsonrpc_request *request, SPDK_ERRLOG("spdk_json_decode_object() failed\n"); spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters"); - spdk_iscsi_opts_free(opts); + iscsi_opts_free(opts); return; } } - g_spdk_iscsi_opts = spdk_iscsi_opts_copy(opts); - spdk_iscsi_opts_free(opts); + g_spdk_iscsi_opts = iscsi_opts_copy(opts); + iscsi_opts_free(opts); if (g_spdk_iscsi_opts == NULL) { - SPDK_ERRLOG("spdk_iscsi_opts_copy() failed\n"); + SPDK_ERRLOG("iscsi_opts_copy() failed\n"); spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Out of memory"); return; diff --git a/lib/iscsi/iscsi_subsystem.c b/lib/iscsi/iscsi_subsystem.c index cf9b57320..66831e32c 100644 --- a/lib/iscsi/iscsi_subsystem.c +++ b/lib/iscsi/iscsi_subsystem.c @@ -401,7 +401,7 @@ iscsi_opts_init(struct spdk_iscsi_opts *opts) } struct spdk_iscsi_opts * -spdk_iscsi_opts_alloc(void) +iscsi_opts_alloc(void) { struct spdk_iscsi_opts *opts; @@ -417,7 +417,7 @@ spdk_iscsi_opts_alloc(void) } void -spdk_iscsi_opts_free(struct spdk_iscsi_opts *opts) +iscsi_opts_free(struct spdk_iscsi_opts *opts) { free(opts->authfile); free(opts->nodebase); @@ -426,7 +426,7 @@ spdk_iscsi_opts_free(struct spdk_iscsi_opts *opts) /* Deep copy of spdk_iscsi_opts */ struct spdk_iscsi_opts * -spdk_iscsi_opts_copy(struct spdk_iscsi_opts *src) +iscsi_opts_copy(struct spdk_iscsi_opts *src) { struct spdk_iscsi_opts *dst; @@ -704,9 +704,9 @@ iscsi_parse_options(struct spdk_iscsi_opts **popts) struct spdk_conf_section *sp; int rc; - opts = spdk_iscsi_opts_alloc(); + opts = iscsi_opts_alloc(); if (!opts) { - SPDK_ERRLOG("spdk_iscsi_opts_alloc_failed() failed\n"); + SPDK_ERRLOG("iscsi_opts_alloc_failed() failed\n"); return -ENOMEM; } @@ -774,8 +774,8 @@ iscsi_set_global_params(struct spdk_iscsi_opts *opts) } int -spdk_iscsi_set_discovery_auth(bool disable_chap, bool require_chap, bool mutual_chap, - int32_t chap_group) +iscsi_set_discovery_auth(bool disable_chap, bool require_chap, bool mutual_chap, + int32_t chap_group) { if (!iscsi_check_chap_params(disable_chap, require_chap, mutual_chap, chap_group)) { @@ -794,9 +794,9 @@ spdk_iscsi_set_discovery_auth(bool disable_chap, bool require_chap, bool mutual_ } int -spdk_iscsi_auth_group_add_secret(struct spdk_iscsi_auth_group *group, - const char *user, const char *secret, - const char *muser, const char *msecret) +iscsi_auth_group_add_secret(struct spdk_iscsi_auth_group *group, + const char *user, const char *secret, + const char *muser, const char *msecret) { struct spdk_iscsi_auth_secret *_secret; size_t len; @@ -867,8 +867,8 @@ spdk_iscsi_auth_group_add_secret(struct spdk_iscsi_auth_group *group, } int -spdk_iscsi_auth_group_delete_secret(struct spdk_iscsi_auth_group *group, - const char *user) +iscsi_auth_group_delete_secret(struct spdk_iscsi_auth_group *group, + const char *user) { struct spdk_iscsi_auth_secret *_secret; @@ -895,7 +895,7 @@ spdk_iscsi_auth_group_delete_secret(struct spdk_iscsi_auth_group *group, } int -spdk_iscsi_add_auth_group(int32_t tag, struct spdk_iscsi_auth_group **_group) +iscsi_add_auth_group(int32_t tag, struct spdk_iscsi_auth_group **_group) { struct spdk_iscsi_auth_group *group; @@ -922,7 +922,7 @@ spdk_iscsi_add_auth_group(int32_t tag, struct spdk_iscsi_auth_group **_group) } void -spdk_iscsi_delete_auth_group(struct spdk_iscsi_auth_group *group) +iscsi_delete_auth_group(struct spdk_iscsi_auth_group *group) { struct spdk_iscsi_auth_secret *_secret, *tmp; @@ -936,7 +936,7 @@ spdk_iscsi_delete_auth_group(struct spdk_iscsi_auth_group *group) } struct spdk_iscsi_auth_group * -spdk_iscsi_find_auth_group_by_tag(int32_t tag) +iscsi_find_auth_group_by_tag(int32_t tag) { struct spdk_iscsi_auth_group *group; @@ -955,7 +955,7 @@ iscsi_auth_groups_destroy(void) struct spdk_iscsi_auth_group *group, *tmp; TAILQ_FOREACH_SAFE(group, &g_iscsi.auth_group_head, tailq, tmp) { - spdk_iscsi_delete_auth_group(group); + iscsi_delete_auth_group(group); } } @@ -975,7 +975,7 @@ iscsi_parse_auth_group(struct spdk_conf_section *sp) tag = spdk_conf_section_get_num(sp); - rc = spdk_iscsi_add_auth_group(tag, &group); + rc = iscsi_add_auth_group(tag, &group); if (rc != 0) { SPDK_ERRLOG("Failed to add auth group\n"); return rc; @@ -992,10 +992,10 @@ iscsi_parse_auth_group(struct spdk_conf_section *sp) muser = spdk_conf_section_get_nmval(sp, "Auth", i, 2); msecret = spdk_conf_section_get_nmval(sp, "Auth", i, 3); - rc = spdk_iscsi_auth_group_add_secret(group, user, secret, muser, msecret); + rc = iscsi_auth_group_add_secret(group, user, secret, muser, msecret); if (rc != 0) { SPDK_ERRLOG("Failed to add secret to auth group\n"); - spdk_iscsi_delete_auth_group(group); + iscsi_delete_auth_group(group); return rc; } } @@ -1068,8 +1068,8 @@ iscsi_find_auth_secret(const char *authuser, int ag_tag) } int -spdk_iscsi_chap_get_authinfo(struct iscsi_chap_auth *auth, const char *authuser, - int ag_tag) +iscsi_chap_get_authinfo(struct iscsi_chap_auth *auth, const char *authuser, + int ag_tag) { struct spdk_iscsi_auth_secret *_secret; @@ -1115,17 +1115,17 @@ iscsi_initialize_global_params(void) if (!g_spdk_iscsi_opts) { rc = iscsi_parse_options(&g_spdk_iscsi_opts); if (rc != 0) { - SPDK_ERRLOG("spdk_iscsi_parse_options() failed\n"); + SPDK_ERRLOG("iscsi_parse_options() failed\n"); return rc; } } rc = iscsi_set_global_params(g_spdk_iscsi_opts); if (rc != 0) { - SPDK_ERRLOG("spdk_iscsi_set_global_params() failed\n"); + SPDK_ERRLOG("iscsi_set_global_params() failed\n"); } - spdk_iscsi_opts_free(g_spdk_iscsi_opts); + iscsi_opts_free(g_spdk_iscsi_opts); g_spdk_iscsi_opts = NULL; return rc; @@ -1150,13 +1150,13 @@ iscsi_parse_configuration(void) rc = iscsi_parse_portal_grps(); if (rc < 0) { - SPDK_ERRLOG("spdk_iscsi_parse_portal_grps() failed\n"); + SPDK_ERRLOG("iscsi_parse_portal_grps() failed\n"); goto end; } rc = iscsi_parse_init_grps(); if (rc < 0) { - SPDK_ERRLOG("spdk_iscsi_parse_init_grps() failed\n"); + SPDK_ERRLOG("iscsi_parse_init_grps() failed\n"); goto end; } @@ -1169,7 +1169,7 @@ iscsi_parse_configuration(void) if (access(g_iscsi.authfile, R_OK) == 0) { rc = iscsi_parse_auth_info(); if (rc < 0) { - SPDK_ERRLOG("spdk_iscsi_parse_auth_info() failed\n"); + SPDK_ERRLOG("iscsi_parse_auth_info() failed\n"); } } else { SPDK_INFOLOG(SPDK_LOG_ISCSI, "CHAP secret file is not found in the path %s\n", @@ -1318,7 +1318,7 @@ iscsi_parse_globals(void) rc = iscsi_initialize_global_params(); if (rc != 0) { - SPDK_ERRLOG("spdk_iscsi_initialize_iscsi_global_params() failed\n"); + SPDK_ERRLOG("iscsi_initialize_iscsi_global_params() failed\n"); return rc; } @@ -1338,7 +1338,7 @@ iscsi_parse_globals(void) rc = iscsi_initialize_all_pools(); if (rc != 0) { - SPDK_ERRLOG("spdk_initialize_all_pools() failed\n"); + SPDK_ERRLOG("initialize_all_pools() failed\n"); free(g_iscsi.session); g_iscsi.session = NULL; return -1; @@ -1346,7 +1346,7 @@ iscsi_parse_globals(void) rc = initialize_iscsi_conns(); if (rc < 0) { - SPDK_ERRLOG("spdk_initialize_iscsi_conns() failed\n"); + SPDK_ERRLOG("initialize_iscsi_conns() failed\n"); free(g_iscsi.session); g_iscsi.session = NULL; return rc; @@ -1367,12 +1367,12 @@ spdk_iscsi_init(spdk_iscsi_init_cb cb_fn, void *cb_arg) rc = iscsi_parse_globals(); if (rc < 0) { - SPDK_ERRLOG("spdk_iscsi_parse_globals() failed\n"); + SPDK_ERRLOG("iscsi_parse_globals() failed\n"); iscsi_init_complete(-1); } /* - * spdk_iscsi_parse_configuration() will be called as the callback to + * iscsi_parse_configuration() will be called as the callback to * spdk_initialize_iscsi_poll_group() and will complete iSCSI * subsystem initialization. */ @@ -1434,7 +1434,7 @@ _iscsi_fini_thread(struct spdk_io_channel_iter *i) } void -spdk_shutdown_iscsi_conns_done(void) +shutdown_iscsi_conns_done(void) { spdk_for_each_channel(&g_iscsi, _iscsi_fini_thread, NULL, _iscsi_fini_dev_unreg); } @@ -1449,7 +1449,7 @@ spdk_iscsi_config_text(FILE *fp) } void -spdk_iscsi_opts_info_json(struct spdk_json_write_ctx *w) +iscsi_opts_info_json(struct spdk_json_write_ctx *w) { spdk_json_write_object_begin(w); @@ -1530,7 +1530,7 @@ iscsi_auth_group_config_json(struct spdk_iscsi_auth_group *group, } void -spdk_iscsi_auth_groups_info_json(struct spdk_json_write_ctx *w) +iscsi_auth_groups_info_json(struct spdk_json_write_ctx *w) { struct spdk_iscsi_auth_group *group; @@ -1557,7 +1557,7 @@ iscsi_opts_config_json(struct spdk_json_write_ctx *w) spdk_json_write_named_string(w, "method", "iscsi_set_options"); spdk_json_write_name(w, "params"); - spdk_iscsi_opts_info_json(w); + iscsi_opts_info_json(w); spdk_json_write_object_end(w); } diff --git a/lib/iscsi/tgt_node.c b/lib/iscsi/tgt_node.c index 544487de1..f07b8d1d5 100644 --- a/lib/iscsi/tgt_node.c +++ b/lib/iscsi/tgt_node.c @@ -1347,7 +1347,7 @@ iscsi_tgt_node_cleanup_luns(struct spdk_iscsi_conn *conn, task->scsi.initiator_port = conn->initiator_port; task->scsi.lun = lun; - spdk_iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_LUN_RESET); + iscsi_op_abort_task_set(task, SPDK_SCSI_TASK_FUNC_LUN_RESET); } return 0; diff --git a/test/app/fuzz/iscsi_fuzz/iscsi_fuzz.c b/test/app/fuzz/iscsi_fuzz/iscsi_fuzz.c index b696d4b52..359b95981 100644 --- a/test/app/fuzz/iscsi_fuzz/iscsi_fuzz.c +++ b/test/app/fuzz/iscsi_fuzz/iscsi_fuzz.c @@ -147,14 +147,14 @@ fuzz_get_value_base_64_buffer(void *item, size_t len) } int -spdk_iscsi_chap_get_authinfo(struct iscsi_chap_auth *auth, const char *authuser, - int ag_tag) +iscsi_chap_get_authinfo(struct iscsi_chap_auth *auth, const char *authuser, + int ag_tag) { return 0; } void -spdk_shutdown_iscsi_conns_done(void) +shutdown_iscsi_conns_done(void) { return; } diff --git a/test/unit/lib/iscsi/conn.c/conn_ut.c b/test/unit/lib/iscsi/conn.c/conn_ut.c index 76c6befd8..dc016847d 100644 --- a/test/unit/lib/iscsi/conn.c/conn_ut.c +++ b/test/unit/lib/iscsi/conn.c/conn_ut.c @@ -193,26 +193,26 @@ DEFINE_STUB_V(iscsi_clear_all_transfer_task, (struct spdk_iscsi_conn *conn, struct spdk_scsi_lun *lun, struct spdk_iscsi_pdu *pdu)); -DEFINE_STUB(spdk_iscsi_build_iovs, int, +DEFINE_STUB(iscsi_build_iovs, int, (struct spdk_iscsi_conn *conn, struct iovec *iov, int num_iovs, struct spdk_iscsi_pdu *pdu, uint32_t *mapped_length), 0); -DEFINE_STUB_V(spdk_iscsi_queue_task, +DEFINE_STUB_V(iscsi_queue_task, (struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task)); -DEFINE_STUB_V(spdk_iscsi_task_response, +DEFINE_STUB_V(iscsi_task_response, (struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task)); -DEFINE_STUB_V(spdk_iscsi_task_mgmt_response, +DEFINE_STUB_V(iscsi_task_mgmt_response, (struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task)); -DEFINE_STUB_V(spdk_iscsi_send_nopin, (struct spdk_iscsi_conn *conn)); +DEFINE_STUB_V(iscsi_send_nopin, (struct spdk_iscsi_conn *conn)); DEFINE_STUB(iscsi_del_transfer_task, bool, (struct spdk_iscsi_conn *conn, uint32_t task_tag), true); -DEFINE_STUB(spdk_iscsi_handle_incoming_pdus, int, (struct spdk_iscsi_conn *conn), 0); +DEFINE_STUB(iscsi_handle_incoming_pdus, int, (struct spdk_iscsi_conn *conn), 0); DEFINE_STUB_V(iscsi_free_sess, (struct spdk_iscsi_sess *sess)); @@ -220,13 +220,13 @@ DEFINE_STUB(iscsi_tgt_node_cleanup_luns, int, (struct spdk_iscsi_conn *conn, struct spdk_iscsi_tgt_node *target), 0); -DEFINE_STUB(spdk_iscsi_pdu_calc_header_digest, uint32_t, +DEFINE_STUB(iscsi_pdu_calc_header_digest, uint32_t, (struct spdk_iscsi_pdu *pdu), 0); DEFINE_STUB(spdk_iscsi_pdu_calc_data_digest, uint32_t, (struct spdk_iscsi_pdu *pdu), 0); -DEFINE_STUB_V(spdk_shutdown_iscsi_conns_done, (void)); +DEFINE_STUB_V(shutdown_iscsi_conns_done, (void)); static struct spdk_iscsi_task * ut_conn_task_get(struct spdk_iscsi_task *parent) diff --git a/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c b/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c index 52c289da6..0d70485d7 100644 --- a/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c +++ b/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c @@ -106,7 +106,7 @@ DEFINE_STUB(iscsi_conn_abort_queued_datain_tasks, int, (struct spdk_iscsi_conn *conn, struct spdk_scsi_lun *lun, struct spdk_iscsi_pdu *pdu), 0); -DEFINE_STUB(spdk_iscsi_chap_get_authinfo, int, +DEFINE_STUB(iscsi_chap_get_authinfo, int, (struct iscsi_chap_auth *auth, const char *authuser, int ag_tag), 0); @@ -391,7 +391,7 @@ underflow_for_read_transfer_test(void) task.scsi.data_transferred = 256; task.scsi.status = SPDK_SCSI_STATUS_GOOD; - spdk_iscsi_task_response(&conn, &task); + iscsi_task_response(&conn, &task); iscsi_put_pdu(pdu); /* @@ -452,7 +452,7 @@ underflow_for_zero_read_transfer_test(void) task.scsi.data_transferred = 0; task.scsi.status = SPDK_SCSI_STATUS_GOOD; - spdk_iscsi_task_response(&conn, &task); + iscsi_task_response(&conn, &task); iscsi_put_pdu(pdu); /* @@ -521,7 +521,7 @@ underflow_for_request_sense_test(void) task.scsi.data_transferred = 18; task.scsi.status = SPDK_SCSI_STATUS_GOOD; - spdk_iscsi_task_response(&conn, &task); + iscsi_task_response(&conn, &task); iscsi_put_pdu(pdu1); /* @@ -611,7 +611,7 @@ underflow_for_check_condition_test(void) task.scsi.data_transferred = 18; task.scsi.status = SPDK_SCSI_STATUS_CHECK_CONDITION; - spdk_iscsi_task_response(&conn, &task); + iscsi_task_response(&conn, &task); iscsi_put_pdu(pdu); /* @@ -1085,7 +1085,7 @@ build_iovs_test(void) pdu.bhs.opcode = ISCSI_OP_SCSI; pdu.writev_offset = 0; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 4); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN); @@ -1098,7 +1098,7 @@ build_iovs_test(void) CU_ASSERT(mapped_length == ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 512 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN / 2; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 4); CU_ASSERT(iovs[0].iov_base == (void *)((uint8_t *)&pdu.bhs + ISCSI_BHS_LEN / 2)); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN / 2); @@ -1111,7 +1111,7 @@ build_iovs_test(void) CU_ASSERT(mapped_length == ISCSI_BHS_LEN / 2 + ISCSI_DIGEST_LEN + 512 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 3); CU_ASSERT(iovs[0].iov_base == (void *)pdu.header_digest); CU_ASSERT(iovs[0].iov_len == ISCSI_DIGEST_LEN); @@ -1122,7 +1122,7 @@ build_iovs_test(void) CU_ASSERT(mapped_length == ISCSI_DIGEST_LEN + 512 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN / 2; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 3); CU_ASSERT(iovs[0].iov_base == (void *)((uint8_t *)pdu.header_digest + ISCSI_DIGEST_LEN / 2)); CU_ASSERT(iovs[0].iov_len == ISCSI_DIGEST_LEN / 2); @@ -1133,7 +1133,7 @@ build_iovs_test(void) CU_ASSERT(mapped_length == ISCSI_DIGEST_LEN / 2 + 512 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 2); CU_ASSERT(iovs[0].iov_base == (void *)pdu.data); CU_ASSERT(iovs[0].iov_len == 512); @@ -1142,32 +1142,32 @@ build_iovs_test(void) CU_ASSERT(mapped_length == 512 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 512; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 1); CU_ASSERT(iovs[0].iov_base == (void *)pdu.data_digest); CU_ASSERT(iovs[0].iov_len == ISCSI_DIGEST_LEN); CU_ASSERT(mapped_length == ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 512 + ISCSI_DIGEST_LEN / 2; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 1); CU_ASSERT(iovs[0].iov_base == (void *)((uint8_t *)pdu.data_digest + ISCSI_DIGEST_LEN / 2)); CU_ASSERT(iovs[0].iov_len == ISCSI_DIGEST_LEN / 2); CU_ASSERT(mapped_length == ISCSI_DIGEST_LEN / 2); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 512 + ISCSI_DIGEST_LEN; - rc = spdk_iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 5, &pdu, &mapped_length); CU_ASSERT(rc == 0); CU_ASSERT(mapped_length == 0); pdu.writev_offset = 0; - rc = spdk_iscsi_build_iovs(&conn, iovs, 1, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 1, &pdu, &mapped_length); CU_ASSERT(rc == 1); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN); CU_ASSERT(mapped_length == ISCSI_BHS_LEN); - rc = spdk_iscsi_build_iovs(&conn, iovs, 2, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 2, &pdu, &mapped_length); CU_ASSERT(rc == 2); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN); @@ -1175,7 +1175,7 @@ build_iovs_test(void) CU_ASSERT(iovs[1].iov_len == ISCSI_DIGEST_LEN); CU_ASSERT(mapped_length == ISCSI_BHS_LEN + ISCSI_DIGEST_LEN); - rc = spdk_iscsi_build_iovs(&conn, iovs, 3, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 3, &pdu, &mapped_length); CU_ASSERT(rc == 3); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN); @@ -1185,7 +1185,7 @@ build_iovs_test(void) CU_ASSERT(iovs[2].iov_len == 512); CU_ASSERT(mapped_length == ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 512); - rc = spdk_iscsi_build_iovs(&conn, iovs, 4, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 4, &pdu, &mapped_length); CU_ASSERT(rc == 4); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN); @@ -1229,7 +1229,7 @@ build_iovs_with_md_test(void) pdu.dif_insert_or_strip = true; pdu.writev_offset = 0; - rc = spdk_iscsi_build_iovs(&conn, iovs, 6, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 6, &pdu, &mapped_length); CU_ASSERT(rc == 5); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN); @@ -1244,7 +1244,7 @@ build_iovs_with_md_test(void) CU_ASSERT(mapped_length == ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 4096 * 2 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 2048; - rc = spdk_iscsi_build_iovs(&conn, iovs, 6, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 6, &pdu, &mapped_length); CU_ASSERT(rc == 3); CU_ASSERT(iovs[0].iov_base == (void *)(pdu.data + 2048)); CU_ASSERT(iovs[0].iov_len == 2048); @@ -1255,14 +1255,14 @@ build_iovs_with_md_test(void) CU_ASSERT(mapped_length == 2048 + 4096 + ISCSI_DIGEST_LEN); pdu.writev_offset = ISCSI_BHS_LEN + ISCSI_DIGEST_LEN + 4096 * 2; - rc = spdk_iscsi_build_iovs(&conn, iovs, 6, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 6, &pdu, &mapped_length); CU_ASSERT(rc == 1); CU_ASSERT(iovs[0].iov_base == (void *)pdu.data_digest); CU_ASSERT(iovs[0].iov_len == ISCSI_DIGEST_LEN); CU_ASSERT(mapped_length == ISCSI_DIGEST_LEN); pdu.writev_offset = 0; - rc = spdk_iscsi_build_iovs(&conn, iovs, 3, &pdu, &mapped_length); + rc = iscsi_build_iovs(&conn, iovs, 3, &pdu, &mapped_length); CU_ASSERT(rc == 3); CU_ASSERT(iovs[0].iov_base == (void *)&pdu.bhs); CU_ASSERT(iovs[0].iov_len == ISCSI_BHS_LEN);