Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions libnvme/src/accessors.ld
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,17 @@ LIBNVME_ACCESSORS_3 {
nvme_ns_get_lba_util;
nvme_ns_set_lba_util;
nvme_ctrl_get_name;
nvme_ctrl_set_name;
nvme_ctrl_get_sysfs_dir;
nvme_ctrl_set_sysfs_dir;
nvme_ctrl_get_firmware;
nvme_ctrl_set_firmware;
nvme_ctrl_get_model;
nvme_ctrl_set_model;
nvme_ctrl_get_numa_node;
nvme_ctrl_set_numa_node;
nvme_ctrl_get_queue_count;
nvme_ctrl_set_queue_count;
nvme_ctrl_get_serial;
nvme_ctrl_set_serial;
nvme_ctrl_get_sqsize;
nvme_ctrl_set_sqsize;
nvme_ctrl_get_transport;
nvme_ctrl_set_transport;
nvme_ctrl_get_subsysnqn;
nvme_ctrl_get_traddr;
nvme_ctrl_set_traddr;
nvme_ctrl_get_trsvcid;
nvme_ctrl_set_trsvcid;
nvme_ctrl_get_dhchap_host_key;
nvme_ctrl_set_dhchap_host_key;
nvme_ctrl_get_dhchap_ctrl_key;
Expand All @@ -69,15 +59,10 @@ LIBNVME_ACCESSORS_3 {
nvme_ctrl_get_tls_key;
nvme_ctrl_set_tls_key;
nvme_ctrl_get_cntrltype;
nvme_ctrl_set_cntrltype;
nvme_ctrl_get_cntlid;
nvme_ctrl_set_cntlid;
nvme_ctrl_get_dctype;
nvme_ctrl_set_dctype;
nvme_ctrl_get_host_traddr;
nvme_ctrl_set_host_traddr;
nvme_ctrl_get_host_iface;
nvme_ctrl_set_host_iface;
nvme_ctrl_get_discovery_ctrl;
nvme_ctrl_set_discovery_ctrl;
nvme_ctrl_get_unique_discovery_ctrl;
Expand All @@ -86,28 +71,20 @@ LIBNVME_ACCESSORS_3 {
nvme_ctrl_set_discovered;
nvme_ctrl_get_persistent;
nvme_ctrl_set_persistent;
nvme_ctrl_get_phy_slot;
nvme_subsystem_get_name;
nvme_subsystem_set_name;
nvme_subsystem_get_sysfs_dir;
nvme_subsystem_set_sysfs_dir;
nvme_subsystem_get_subsysnqn;
nvme_subsystem_set_subsysnqn;
nvme_subsystem_get_model;
nvme_subsystem_set_model;
nvme_subsystem_get_serial;
nvme_subsystem_set_serial;
nvme_subsystem_get_firmware;
nvme_subsystem_set_firmware;
nvme_subsystem_get_subsystype;
nvme_subsystem_set_subsystype;
nvme_subsystem_get_application;
nvme_subsystem_set_application;
nvme_subsystem_get_iopolicy;
nvme_subsystem_set_iopolicy;
nvme_host_get_hostnqn;
nvme_host_set_hostnqn;
nvme_host_get_hostid;
nvme_host_set_hostid;
nvme_host_get_dhchap_host_key;
nvme_host_set_dhchap_host_key;
nvme_host_get_hostsymname;
Expand Down
154 changes: 4 additions & 150 deletions libnvme/src/nvme/accessors.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,122 +171,61 @@ uint64_t nvme_ns_get_lba_util(const struct nvme_ns *p)
* Accessors for: struct nvme_ctrl
****************************************************************************/

void nvme_ctrl_set_name(struct nvme_ctrl *p, const char *name)
{
free(p->name);
p->name = name ? strdup(name) : NULL;
}

const char *nvme_ctrl_get_name(const struct nvme_ctrl *p)
{
return p->name;
}

void nvme_ctrl_set_sysfs_dir(struct nvme_ctrl *p, const char *sysfs_dir)
{
free(p->sysfs_dir);
p->sysfs_dir = sysfs_dir ? strdup(sysfs_dir) : NULL;
}

const char *nvme_ctrl_get_sysfs_dir(const struct nvme_ctrl *p)
{
return p->sysfs_dir;
}

void nvme_ctrl_set_firmware(struct nvme_ctrl *p, const char *firmware)
{
free(p->firmware);
p->firmware = firmware ? strdup(firmware) : NULL;
}

const char *nvme_ctrl_get_firmware(const struct nvme_ctrl *p)
{
return p->firmware;
}

void nvme_ctrl_set_model(struct nvme_ctrl *p, const char *model)
{
free(p->model);
p->model = model ? strdup(model) : NULL;
}

const char *nvme_ctrl_get_model(const struct nvme_ctrl *p)
{
return p->model;
}

void nvme_ctrl_set_numa_node(struct nvme_ctrl *p, const char *numa_node)
{
free(p->numa_node);
p->numa_node = numa_node ? strdup(numa_node) : NULL;
}

const char *nvme_ctrl_get_numa_node(const struct nvme_ctrl *p)
{
return p->numa_node;
}

void nvme_ctrl_set_queue_count(struct nvme_ctrl *p, const char *queue_count)
{
free(p->queue_count);
p->queue_count = queue_count ? strdup(queue_count) : NULL;
}

const char *nvme_ctrl_get_queue_count(const struct nvme_ctrl *p)
{
return p->queue_count;
}

void nvme_ctrl_set_serial(struct nvme_ctrl *p, const char *serial)
{
free(p->serial);
p->serial = serial ? strdup(serial) : NULL;
}

const char *nvme_ctrl_get_serial(const struct nvme_ctrl *p)
{
return p->serial;
}

void nvme_ctrl_set_sqsize(struct nvme_ctrl *p, const char *sqsize)
{
free(p->sqsize);
p->sqsize = sqsize ? strdup(sqsize) : NULL;
}

const char *nvme_ctrl_get_sqsize(const struct nvme_ctrl *p)
{
return p->sqsize;
}

void nvme_ctrl_set_transport(struct nvme_ctrl *p, const char *transport)
{
free(p->transport);
p->transport = transport ? strdup(transport) : NULL;
}

const char *nvme_ctrl_get_transport(const struct nvme_ctrl *p)
{
return p->transport;
}

void nvme_ctrl_set_traddr(struct nvme_ctrl *p, const char *traddr)
const char *nvme_ctrl_get_subsysnqn(const struct nvme_ctrl *p)
{
free(p->traddr);
p->traddr = traddr ? strdup(traddr) : NULL;
return p->subsysnqn;
}

const char *nvme_ctrl_get_traddr(const struct nvme_ctrl *p)
{
return p->traddr;
}

void nvme_ctrl_set_trsvcid(struct nvme_ctrl *p, const char *trsvcid)
{
free(p->trsvcid);
p->trsvcid = trsvcid ? strdup(trsvcid) : NULL;
}

const char *nvme_ctrl_get_trsvcid(const struct nvme_ctrl *p)
{
return p->trsvcid;
Expand Down Expand Up @@ -354,56 +293,31 @@ const char *nvme_ctrl_get_tls_key(const struct nvme_ctrl *p)
return p->tls_key;
}

void nvme_ctrl_set_cntrltype(struct nvme_ctrl *p, const char *cntrltype)
{
free(p->cntrltype);
p->cntrltype = cntrltype ? strdup(cntrltype) : NULL;
}

const char *nvme_ctrl_get_cntrltype(const struct nvme_ctrl *p)
{
return p->cntrltype;
}

void nvme_ctrl_set_cntlid(struct nvme_ctrl *p, const char *cntlid)
{
free(p->cntlid);
p->cntlid = cntlid ? strdup(cntlid) : NULL;
}

const char *nvme_ctrl_get_cntlid(const struct nvme_ctrl *p)
{
return p->cntlid;
}

void nvme_ctrl_set_dctype(struct nvme_ctrl *p, const char *dctype)
{
free(p->dctype);
p->dctype = dctype ? strdup(dctype) : NULL;
}

const char *nvme_ctrl_get_dctype(const struct nvme_ctrl *p)
{
return p->dctype;
}

void nvme_ctrl_set_host_traddr(struct nvme_ctrl *p, const char *host_traddr)
const char *nvme_ctrl_get_phy_slot(const struct nvme_ctrl *p)
{
free(p->host_traddr);
p->host_traddr = host_traddr ? strdup(host_traddr) : NULL;
return p->phy_slot;
}

const char *nvme_ctrl_get_host_traddr(const struct nvme_ctrl *p)
{
return p->host_traddr;
}

void nvme_ctrl_set_host_iface(struct nvme_ctrl *p, const char *host_iface)
{
free(p->host_iface);
p->host_iface = host_iface ? strdup(host_iface) : NULL;
}

const char *nvme_ctrl_get_host_iface(const struct nvme_ctrl *p)
{
return p->host_iface;
Expand Down Expand Up @@ -455,84 +369,36 @@ bool nvme_ctrl_get_persistent(const struct nvme_ctrl *p)
* Accessors for: struct nvme_subsystem
****************************************************************************/

void nvme_subsystem_set_name(struct nvme_subsystem *p, const char *name)
{
free(p->name);
p->name = name ? strdup(name) : NULL;
}

const char *nvme_subsystem_get_name(const struct nvme_subsystem *p)
{
return p->name;
}

void nvme_subsystem_set_sysfs_dir(
struct nvme_subsystem *p,
const char *sysfs_dir)
{
free(p->sysfs_dir);
p->sysfs_dir = sysfs_dir ? strdup(sysfs_dir) : NULL;
}

const char *nvme_subsystem_get_sysfs_dir(const struct nvme_subsystem *p)
{
return p->sysfs_dir;
}

void nvme_subsystem_set_subsysnqn(
struct nvme_subsystem *p,
const char *subsysnqn)
{
free(p->subsysnqn);
p->subsysnqn = subsysnqn ? strdup(subsysnqn) : NULL;
}

const char *nvme_subsystem_get_subsysnqn(const struct nvme_subsystem *p)
{
return p->subsysnqn;
}

void nvme_subsystem_set_model(struct nvme_subsystem *p, const char *model)
{
free(p->model);
p->model = model ? strdup(model) : NULL;
}

const char *nvme_subsystem_get_model(const struct nvme_subsystem *p)
{
return p->model;
}

void nvme_subsystem_set_serial(struct nvme_subsystem *p, const char *serial)
{
free(p->serial);
p->serial = serial ? strdup(serial) : NULL;
}

const char *nvme_subsystem_get_serial(const struct nvme_subsystem *p)
{
return p->serial;
}

void nvme_subsystem_set_firmware(struct nvme_subsystem *p, const char *firmware)
{
free(p->firmware);
p->firmware = firmware ? strdup(firmware) : NULL;
}

const char *nvme_subsystem_get_firmware(const struct nvme_subsystem *p)
{
return p->firmware;
}

void nvme_subsystem_set_subsystype(
struct nvme_subsystem *p,
const char *subsystype)
{
free(p->subsystype);
p->subsystype = subsystype ? strdup(subsystype) : NULL;
}

const char *nvme_subsystem_get_subsystype(const struct nvme_subsystem *p)
{
return p->subsystype;
Expand Down Expand Up @@ -566,23 +432,11 @@ const char *nvme_subsystem_get_iopolicy(const struct nvme_subsystem *p)
* Accessors for: struct nvme_host
****************************************************************************/

void nvme_host_set_hostnqn(struct nvme_host *p, const char *hostnqn)
{
free(p->hostnqn);
p->hostnqn = hostnqn ? strdup(hostnqn) : NULL;
}

const char *nvme_host_get_hostnqn(const struct nvme_host *p)
{
return p->hostnqn;
}

void nvme_host_set_hostid(struct nvme_host *p, const char *hostid)
{
free(p->hostid);
p->hostid = hostid ? strdup(hostid) : NULL;
}

const char *nvme_host_get_hostid(const struct nvme_host *p)
{
return p->hostid;
Expand Down
Loading