nvme: Rename nvme_qpair_construct to nvme_qpair_init

This function initializes the members of an existing
qpair struct. It doesn't construct one from scratch.

Change-Id: I0b9afac1ad25cfb217efd146702f693c74f5f697
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2016-12-15 14:28:44 -07:00
parent 3e5c1d0a2b
commit a96a6ecf58
6 changed files with 22 additions and 22 deletions

View File

@ -529,10 +529,10 @@ int nvme_ctrlr_submit_admin_request(struct spdk_nvme_ctrlr *ctrlr,
struct nvme_request *req);
int nvme_ctrlr_get_cap(struct spdk_nvme_ctrlr *ctrlr, union spdk_nvme_cap_register *cap);
void nvme_ctrlr_init_cap(struct spdk_nvme_ctrlr *ctrlr, const union spdk_nvme_cap_register *cap);
int nvme_qpair_construct(struct spdk_nvme_qpair *qpair, uint16_t id,
uint16_t num_entries,
struct spdk_nvme_ctrlr *ctrlr,
enum spdk_nvme_qprio qprio);
int nvme_qpair_init(struct spdk_nvme_qpair *qpair, uint16_t id,
uint16_t num_entries,
struct spdk_nvme_ctrlr *ctrlr,
enum spdk_nvme_qprio qprio);
void nvme_qpair_enable(struct spdk_nvme_qpair *qpair);
void nvme_qpair_disable(struct spdk_nvme_qpair *qpair);
int nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair,

View File

@ -523,11 +523,11 @@ nvme_pcie_ctrlr_construct_admin_qpair(struct spdk_nvme_ctrlr *ctrlr)
ctrlr->adminq = &pqpair->qpair;
rc = nvme_qpair_construct(ctrlr->adminq,
0, /* qpair ID */
NVME_ADMIN_ENTRIES,
ctrlr,
SPDK_NVME_QPRIO_URGENT);
rc = nvme_qpair_init(ctrlr->adminq,
0, /* qpair ID */
NVME_ADMIN_ENTRIES,
ctrlr,
SPDK_NVME_QPRIO_URGENT);
if (rc != 0) {
return rc;
}
@ -1345,7 +1345,7 @@ nvme_pcie_ctrlr_create_io_qpair(struct spdk_nvme_ctrlr *ctrlr, uint16_t qid,
qpair = &pqpair->qpair;
rc = nvme_qpair_construct(qpair, qid, ctrlr->opts.io_queue_size, ctrlr, qprio);
rc = nvme_qpair_init(qpair, qid, ctrlr->opts.io_queue_size, ctrlr, qprio);
if (rc != 0) {
nvme_pcie_qpair_destroy(qpair);
return NULL;

View File

@ -340,10 +340,10 @@ spdk_nvme_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
}
int
nvme_qpair_construct(struct spdk_nvme_qpair *qpair, uint16_t id,
uint16_t num_entries,
struct spdk_nvme_ctrlr *ctrlr,
enum spdk_nvme_qprio qprio)
nvme_qpair_init(struct spdk_nvme_qpair *qpair, uint16_t id,
uint16_t num_entries,
struct spdk_nvme_ctrlr *ctrlr,
enum spdk_nvme_qprio qprio)
{
assert(num_entries != 0);

View File

@ -941,7 +941,7 @@ nvme_rdma_ctrlr_create_qpair(struct spdk_nvme_ctrlr *ctrlr, uint16_t qid,
num_entries = ctrlr->opts.io_queue_size;
}
rc = nvme_qpair_construct(qpair, qid, num_entries, ctrlr, qprio);
rc = nvme_qpair_init(qpair, qid, num_entries, ctrlr, qprio);
if (rc != 0) {
return NULL;
}

View File

@ -164,10 +164,10 @@ nvme_transport_qpair_reset(struct spdk_nvme_qpair *qpair)
return 0;
}
int nvme_qpair_construct(struct spdk_nvme_qpair *qpair, uint16_t id,
uint16_t num_entries,
struct spdk_nvme_ctrlr *ctrlr,
enum spdk_nvme_qprio qprio)
int nvme_qpair_init(struct spdk_nvme_qpair *qpair, uint16_t id,
uint16_t num_entries,
struct spdk_nvme_ctrlr *ctrlr,
enum spdk_nvme_qprio qprio)
{
qpair->id = id;
qpair->num_entries = num_entries;

View File

@ -223,7 +223,7 @@ prepare_submit_request_test(struct spdk_nvme_qpair *qpair,
ctrlr->free_io_qids = NULL;
TAILQ_INIT(&ctrlr->active_io_qpairs);
TAILQ_INIT(&ctrlr->active_procs);
nvme_qpair_construct(qpair, 1, 128, ctrlr, 0);
nvme_qpair_init(qpair, 1, 128, ctrlr, 0);
ut_fail_vtophys = false;
}
@ -582,11 +582,11 @@ static void test_nvme_qpair_destroy(void)
TAILQ_INIT(&ctrlr.active_io_qpairs);
TAILQ_INIT(&ctrlr.active_procs);
nvme_qpair_construct(&qpair, 1, 128, &ctrlr);
nvme_qpair_init(&qpair, 1, 128, &ctrlr);
nvme_qpair_destroy(&qpair);
nvme_qpair_construct(&qpair, 0, 128, &ctrlr);
nvme_qpair_init(&qpair, 0, 128, &ctrlr);
tr_temp = TAILQ_FIRST(&qpair.free_tr);
SPDK_CU_ASSERT_FATAL(tr_temp != NULL);
TAILQ_REMOVE(&qpair.free_tr, tr_temp, tq_list);