nvmf: rename trsvc -> trsvcid for spec consistency

Change-Id: I5f73ef20ba231a7b1721562964dfd50de9b2c735
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-08-22 12:58:12 -07:00
parent 20bee521a6
commit 39cda18718
4 changed files with 15 additions and 15 deletions

View File

@ -419,7 +419,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
/* Parse Listen sections */
for (i = 0; i < MAX_LISTEN_ADDRESSES; i++) {
char *transport_name, *listen_addr;
char *traddr, *trsvc;
char *traddr, *trsvcid;
const struct spdk_nvmf_transport *transport;
transport_name = spdk_conf_section_get_nmval(sp, "Listen", i, 0);
@ -435,16 +435,16 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
continue;
}
ret = spdk_nvmf_parse_addr(listen_addr, &traddr, &trsvc);
ret = spdk_nvmf_parse_addr(listen_addr, &traddr, &trsvcid);
if (ret < 0) {
SPDK_ERRLOG("Unable to parse transport address '%s'\n", listen_addr);
continue;
}
spdk_nvmf_subsystem_add_listener(subsystem, transport, traddr, trsvc);
spdk_nvmf_subsystem_add_listener(subsystem, transport, traddr, trsvcid);
free(traddr);
free(trsvc);
free(trsvcid);
}
/* Parse Host sections */

View File

@ -139,7 +139,7 @@ struct spdk_nvmf_rdma_session {
struct spdk_nvmf_rdma_listen_addr {
char *traddr;
char *trsvc;
char *trsvcid;
struct rdma_cm_id *id;
TAILQ_ENTRY(spdk_nvmf_rdma_listen_addr) link;
};
@ -1013,7 +1013,7 @@ spdk_nvmf_rdma_acceptor_init(void)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr(listen_addr->traddr);
addr.sin_port = htons((uint16_t)strtoul(listen_addr->trsvc, NULL, 10));
addr.sin_port = htons((uint16_t)strtoul(listen_addr->trsvcid, NULL, 10));
rc = rdma_create_id(g_rdma.acceptor_event_channel, &listen_addr->id, NULL,
RDMA_PS_TCP);
@ -1470,7 +1470,7 @@ spdk_nvmf_rdma_discover(struct spdk_nvmf_listen_addr *listen_addr,
entry->adrfam = SPDK_NVMF_ADRFAM_IPV4;
entry->treq.secure_channel = SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED;
spdk_strcpy_pad(entry->trsvcid, listen_addr->trsvc, sizeof(entry->trsvcid), ' ');
spdk_strcpy_pad(entry->trsvcid, listen_addr->trsvcid, sizeof(entry->trsvcid), ' ');
spdk_strcpy_pad(entry->traddr, listen_addr->traddr, sizeof(entry->traddr), ' ');
entry->tsas.rdma.rdma_qptype = SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED;
@ -1486,7 +1486,7 @@ spdk_nvmf_rdma_listen(struct spdk_nvmf_listen_addr *listen_addr)
pthread_mutex_lock(&g_rdma.lock);
TAILQ_FOREACH_SAFE(addr, &g_rdma.listen_addrs, link, tmp) {
if ((!strcasecmp(addr->traddr, listen_addr->traddr)) &&
(!strcasecmp(addr->trsvc, listen_addr->trsvc))) {
(!strcasecmp(addr->trsvcid, listen_addr->trsvcid))) {
pthread_mutex_unlock(&g_rdma.lock);
return 0;
}
@ -1499,7 +1499,7 @@ spdk_nvmf_rdma_listen(struct spdk_nvmf_listen_addr *listen_addr)
}
addr->traddr = listen_addr->traddr;
addr->trsvc = listen_addr->trsvc;
addr->trsvcid = listen_addr->trsvcid;
TAILQ_INSERT_TAIL(&g_rdma.listen_addrs, addr, link);
pthread_mutex_unlock(&g_rdma.lock);

View File

@ -142,7 +142,7 @@ nvmf_delete_subsystem_poller_unreg(struct spdk_event *event)
TAILQ_FOREACH_SAFE(listen_addr, &subsystem->listen_addrs, link, listen_addr_tmp) {
TAILQ_REMOVE(&subsystem->listen_addrs, listen_addr, link);
free(listen_addr->traddr);
free(listen_addr->trsvc);
free(listen_addr->trsvcid);
free(listen_addr);
subsystem->num_listen_addrs--;
}
@ -192,7 +192,7 @@ nvmf_delete_subsystem(struct spdk_nvmf_subsystem *subsystem)
int
spdk_nvmf_subsystem_add_listener(struct spdk_nvmf_subsystem *subsystem,
const struct spdk_nvmf_transport *transport,
char *traddr, char *trsvc)
char *traddr, char *trsvcid)
{
struct spdk_nvmf_listen_addr *listen_addr;
int rc;
@ -208,8 +208,8 @@ spdk_nvmf_subsystem_add_listener(struct spdk_nvmf_subsystem *subsystem,
return -1;
}
listen_addr->trsvc = strdup(trsvc);
if (!listen_addr->trsvc) {
listen_addr->trsvcid = strdup(trsvcid);
if (!listen_addr->trsvcid) {
free(listen_addr->traddr);
free(listen_addr);
return -1;

View File

@ -55,7 +55,7 @@ enum spdk_nvmf_subsystem_mode {
struct spdk_nvmf_listen_addr {
char *traddr;
char *trsvc; /* TODO: Change to trsvcid */
char *trsvcid;
const struct spdk_nvmf_transport *transport;
TAILQ_ENTRY(spdk_nvmf_listen_addr) link;
};
@ -150,7 +150,7 @@ nvmf_find_subsystem(const char *subnqn, const char *hostnqn);
int
spdk_nvmf_subsystem_add_listener(struct spdk_nvmf_subsystem *subsystem,
const struct spdk_nvmf_transport *transport,
char *traddr, char *trsvc);
char *traddr, char *trsvcid);
int
spdk_nvmf_subsystem_add_host(struct spdk_nvmf_subsystem *subsystem,