Skip to content

Commit 2a3a350

Browse files
committed
nbft: use libnbft_ prefix for library types
Follow the existing pattern to different prefixes for the NVMe spec types and the library API. Thus for nbft, use libnbft_ as prefix. Signed-off-by: Daniel Wagner <[email protected]>
1 parent a161138 commit 2a3a350

6 files changed

Lines changed: 148 additions & 148 deletions

File tree

libnvme/libnvme/nvme.i

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ struct libnvmf_context {};
10531053
NBFT
10541054
******/
10551055
%{
1056-
static PyObject *ssns_to_dict(struct nbft_info_subsystem_ns *ss)
1056+
static PyObject *ssns_to_dict(struct libnbft_subsystem_ns *ss)
10571057
{
10581058
unsigned int i;
10591059
PyObject *output = PyDict_New();
@@ -1073,14 +1073,14 @@ struct libnvmf_context {};
10731073
{
10741074
PyObject *nid;
10751075
switch (ss->nid_type) {
1076-
case NBFT_INFO_NID_TYPE_EUI64:
1076+
case LIBNBFT_NID_TYPE_EUI64:
10771077
PyDict_SetItemStringDecRef(output, "nid_type", PyUnicode_FromString("eui64"));
10781078
nid = PyUnicode_FromFormat("%02x%02x%02x%02x%02x%02x%02x%02x",
10791079
ss->nid[0], ss->nid[1], ss->nid[2], ss->nid[3],
10801080
ss->nid[4], ss->nid[5], ss->nid[6], ss->nid[7]);
10811081
break;
10821082

1083-
case NBFT_INFO_NID_TYPE_NGUID:
1083+
case LIBNBFT_NID_TYPE_NGUID:
10841084
PyDict_SetItemStringDecRef(output, "nid_type", PyUnicode_FromString("nguid"));
10851085
nid = PyUnicode_FromFormat("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
10861086
ss->nid[0], ss->nid[1], ss->nid[2], ss->nid[3],
@@ -1089,7 +1089,7 @@ struct libnvmf_context {};
10891089
ss->nid[12], ss->nid[13], ss->nid[14], ss->nid[15]);
10901090
break;
10911091

1092-
case NBFT_INFO_NID_TYPE_NS_UUID:
1092+
case LIBNBFT_NID_TYPE_NS_UUID:
10931093
{
10941094
char uuid_str[NVME_UUID_LEN_STRING];
10951095
PyDict_SetItemStringDecRef(output, "nid_type", PyUnicode_FromString("uuid"));
@@ -1121,7 +1121,7 @@ struct libnvmf_context {};
11211121
return output;
11221122
}
11231123

1124-
static PyObject *hfi_to_dict(struct nbft_info_hfi *hfi)
1124+
static PyObject *hfi_to_dict(struct libnbft_hfi *hfi)
11251125
{
11261126
PyObject *output = PyDict_New();
11271127

@@ -1164,7 +1164,7 @@ struct libnvmf_context {};
11641164
return output;
11651165
}
11661166

1167-
static PyObject *discovery_to_dict(struct nbft_info_discovery *disc)
1167+
static PyObject *discovery_to_dict(struct libnbft_discovery *disc)
11681168
{
11691169
PyObject *output = PyDict_New();
11701170

@@ -1180,7 +1180,7 @@ struct libnvmf_context {};
11801180
return output;
11811181
}
11821182

1183-
static PyObject *nbft_to_pydict(struct nbft_info *nbft)
1183+
static PyObject *nbft_to_pydict(struct libnbft_info *nbft)
11841184
{
11851185
PyObject *val;
11861186
PyObject *output = PyDict_New();
@@ -1199,17 +1199,17 @@ struct libnvmf_context {};
11991199
PyDict_SetItemStringDecRef(host, "host_id_configured", PyBool_FromLong(nbft->host.host_id_configured));
12001200
PyDict_SetItemStringDecRef(host, "host_nqn_configured", PyBool_FromLong(nbft->host.host_nqn_configured));
12011201

1202-
val = PyUnicode_FromString(nbft->host.primary == NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED ? "not indicated" :
1203-
nbft->host.primary == NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED ? "unselected" :
1204-
nbft->host.primary == NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_SELECTED ? "selected" : "reserved");
1202+
val = PyUnicode_FromString(nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED ? "not indicated" :
1203+
nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED ? "unselected" :
1204+
nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED ? "selected" : "reserved");
12051205
PyDict_SetItemStringDecRef(host, "primary_admin_host_flag", val);
12061206

12071207
PyDict_SetItemStringDecRef(output, "host", host);
12081208
}
12091209

12101210
{
12111211
size_t ss_num = 0;
1212-
struct nbft_info_subsystem_ns **ss;
1212+
struct libnbft_subsystem_ns **ss;
12131213
PyObject *subsystem;
12141214

12151215
/* First, let's find how many entries there are */
@@ -1227,7 +1227,7 @@ struct libnvmf_context {};
12271227

12281228
{
12291229
size_t hfi_num = 0;
1230-
struct nbft_info_hfi **hfi;
1230+
struct libnbft_hfi **hfi;
12311231
PyObject *hfis;
12321232

12331233
/* First, let's find how many entries there are */
@@ -1245,7 +1245,7 @@ struct libnvmf_context {};
12451245

12461246
{
12471247
size_t disc_num = 0;
1248-
struct nbft_info_discovery **disc;
1248+
struct libnbft_discovery **disc;
12491249
PyObject *discovery;
12501250

12511251
/* First, let's find how many entries there are */
@@ -1268,7 +1268,7 @@ struct libnvmf_context {};
12681268

12691269
PyObject *nbft_get(struct libnvme_global_ctx *ctx, const char * filename)
12701270
{
1271-
struct nbft_info *nbft;
1271+
struct libnbft_info *nbft;
12721272
PyObject *output;
12731273
int ret;
12741274

libnvme/src/nvme/fabrics.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ __public int libnvmf_nbft_read_files(struct libnvme_global_ctx *ctx, char *path,
26022602
struct nbft_file_entry **head)
26032603
{
26042604
struct nbft_file_entry *entry = NULL;
2605-
struct nbft_info *nbft;
2605+
struct libnbft_info *nbft;
26062606
struct dirent **dent;
26072607
char filename[PATH_MAX];
26082608
int i, count, ret;
@@ -2650,7 +2650,7 @@ __public void libnvmf_nbft_free(struct libnvme_global_ctx *ctx, struct nbft_file
26502650
}
26512651

26522652
static bool validate_uri(struct libnvme_global_ctx *ctx,
2653-
struct nbft_info_discovery *dd,
2653+
struct libnbft_discovery *dd,
26542654
struct libnvmf_uri *uri)
26552655
{
26562656
if (!uri) {
@@ -2678,7 +2678,7 @@ static bool validate_uri(struct libnvme_global_ctx *ctx,
26782678
static int nbft_connect(struct libnvme_global_ctx *ctx,
26792679
struct libnvmf_context *fctx, struct libnvme_host *h,
26802680
struct nvmf_disc_log_entry *e,
2681-
struct nbft_info_subsystem_ns *ss)
2681+
struct libnbft_subsystem_ns *ss)
26822682
{
26832683
libnvme_ctrl_t c;
26842684
int saved_log_level;
@@ -2735,7 +2735,7 @@ static int nbft_connect(struct libnvme_global_ctx *ctx,
27352735
}
27362736

27372737
static int nbft_discovery(struct libnvme_global_ctx *ctx,
2738-
struct libnvmf_context *fctx, struct nbft_info_discovery *dd,
2738+
struct libnvmf_context *fctx, struct libnbft_discovery *dd,
27392739
struct libnvme_host *h, struct libnvme_ctrl *c)
27402740
{
27412741
struct nvmf_discovery_log *log = NULL;
@@ -2833,9 +2833,9 @@ __public int libnvmf_discovery_nbft(struct libnvme_global_ctx *ctx,
28332833
const char *hostnqn = NULL, *hostid = NULL, *host_traddr = NULL;
28342834
char uuid[NVME_UUID_LEN_STRING];
28352835
struct nbft_file_entry *entry = NULL;
2836-
struct nbft_info_subsystem_ns **ss;
2837-
struct nbft_info_hfi *hfi;
2838-
struct nbft_info_discovery **dd;
2836+
struct libnbft_subsystem_ns **ss;
2837+
struct libnbft_hfi *hfi;
2838+
struct libnbft_discovery **dd;
28392839
struct libnvme_host *h;
28402840
int ret, rr, i;
28412841

0 commit comments

Comments
 (0)