Skip to content

Commit e60e59e

Browse files
committed
libnvme: drop nvme_subsystem accessors from tree.c
The accessor functions already have implementations for the various nvme subsystem accessors, so drop them from tree.c Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 1d95fb3 commit e60e59e

12 files changed

Lines changed: 24 additions & 67 deletions

File tree

fabrics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static void nvmf_disconnect_nqn(struct nvme_global_ctx *ctx, char *nqn)
716716
continue;
717717
nvme_for_each_host(ctx, h) {
718718
nvme_for_each_subsystem(h, s) {
719-
if (strcmp(nvme_subsystem_get_nqn(s), p))
719+
if (strcmp(nvme_subsystem_get_subsysnqn(s), p))
720720
continue;
721721
nvme_subsystem_for_each_ctrl(s, c) {
722722
if (!nvme_disconnect_ctrl(c))
@@ -1062,7 +1062,7 @@ int fabrics_dim(const char *desc, int argc, char **argv)
10621062
continue;
10631063
nvme_for_each_host(ctx, h) {
10641064
nvme_for_each_subsystem(h, s) {
1065-
if (strcmp(nvme_subsystem_get_nqn(s), p))
1065+
if (strcmp(nvme_subsystem_get_subsysnqn(s), p))
10661066
continue;
10671067
nvme_subsystem_for_each_ctrl(s, c)
10681068
ret = dim_operation(c, tas, p);

libnvme/examples/display-columnar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int main()
4242
nvme_for_each_subsystem(h, s) {
4343
bool first = true;
4444
printf("%-16s %-96s ", nvme_subsystem_get_name(s),
45-
nvme_subsystem_get_nqn(s));
45+
nvme_subsystem_get_subsysnqn(s));
4646

4747
nvme_subsystem_for_each_ctrl(s, c) {
4848
printf("%s%s", first ? "": ", ",

libnvme/examples/display-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main()
3939
nvme_for_each_subsystem_safe(h, s, _s) {
4040
printf("%c-- %s - NQN=%s\n", _s ? '|' : '`',
4141
nvme_subsystem_get_name(s),
42-
nvme_subsystem_get_nqn(s));
42+
nvme_subsystem_get_subsysnqn(s));
4343

4444
nvme_subsystem_for_each_ns_safe(s, n, _n) {
4545
printf("%c |-- %s lba size:%d lba max:%" PRIu64 "\n",

libnvme/src/libnvme.ld

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ LIBNVME_3 {
199199
nvme_subsystem_first_ctrl;
200200
nvme_subsystem_first_ns;
201201
nvme_subsystem_get;
202-
nvme_subsystem_get_fw_rev;
203202
nvme_subsystem_get_host;
204-
nvme_subsystem_get_nqn;
205-
nvme_subsystem_get_type;
206203
nvme_subsystem_lookup_namespace;
207204
nvme_subsystem_next_ctrl;
208205
nvme_subsystem_next_ns;

libnvme/src/nvme/fabrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c,
10511051
*/
10521052
if (app && strcmp(app, root_app)) {
10531053
nvme_msg(h->ctx, LOG_INFO, "skip %s, not managed by %s\n",
1054-
nvme_subsystem_get_nqn(s), root_app);
1054+
nvme_subsystem_get_subsysnqn(s), root_app);
10551055
return -ENVME_CONNECT_IGNORED;
10561056
}
10571057
}

libnvme/src/nvme/json.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static void json_update_subsys(struct json_object *subsys_array,
356356
nvme_subsystem_t s)
357357
{
358358
nvme_ctrl_t c;
359-
const char *subsysnqn = nvme_subsystem_get_nqn(s), *app;
359+
const char *subsysnqn = nvme_subsystem_get_subsysnqn(s), *app;
360360
struct json_object *subsys_obj = json_object_new_object();
361361
struct json_object *port_array;
362362

@@ -602,7 +602,7 @@ static void json_dump_subsys(struct json_object *subsys_array,
602602
json_object_object_add(subsys_obj, "name",
603603
json_object_new_string(nvme_subsystem_get_name(s)));
604604
json_object_object_add(subsys_obj, "nqn",
605-
json_object_new_string(nvme_subsystem_get_nqn(s)));
605+
json_object_new_string(nvme_subsystem_get_subsysnqn(s)));
606606

607607
ns_array = json_object_new_array();
608608
if (!json_dump_subsys_multipath(s, ns_array))

libnvme/src/nvme/tree.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -429,21 +429,6 @@ void nvme_root_release_fds(struct nvme_global_ctx *ctx)
429429
nvme_host_release_fds(h);
430430
}
431431

432-
const char *nvme_subsystem_get_nqn(nvme_subsystem_t s)
433-
{
434-
return s->subsysnqn;
435-
}
436-
437-
const char *nvme_subsystem_get_type(nvme_subsystem_t s)
438-
{
439-
return s->subsystype;
440-
}
441-
442-
const char *nvme_subsystem_get_fw_rev(nvme_subsystem_t s)
443-
{
444-
return s->firmware;
445-
}
446-
447432
nvme_ctrl_t nvme_subsystem_first_ctrl(nvme_subsystem_t s)
448433
{
449434
return list_top(&s->ctrls, struct nvme_ctrl, entry);

libnvme/src/nvme/tree.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -837,32 +837,6 @@ void nvme_free_ctrl(struct nvme_ctrl *c);
837837
*/
838838
void nvme_unlink_ctrl(struct nvme_ctrl *c);
839839

840-
/**
841-
* nvme_subsystem_get_nqn() - Retrieve NQN from subsystem
842-
* @s: nvme_subsystem_t object
843-
*
844-
* Return: NQN of subsystem
845-
*/
846-
const char *nvme_subsystem_get_nqn(nvme_subsystem_t s);
847-
848-
/**
849-
* nvme_subsystem_get_type() - Returns the type of a subsystem
850-
* @s: nvme_subsystem_t object
851-
*
852-
* Returns the subsystem type of @s.
853-
*
854-
* Return: 'nvm' or 'discovery'
855-
*/
856-
const char *nvme_subsystem_get_type(nvme_subsystem_t s);
857-
858-
/**
859-
* nvme_subsystem_get_fw_rev() - Return the firmware rev of subsystem
860-
* @s: nvme_subsystem_t object
861-
*
862-
* Return: Firmware revision of the current subsystem
863-
*/
864-
const char *nvme_subsystem_get_fw_rev(nvme_subsystem_t s);
865-
866840
/**
867841
* nvme_scan_topology() - Scan NVMe topology and apply filter
868842
* @ctx: struct nvme_global_ctx object

libnvme/test/cpp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main()
3434
nvme_for_each_host(ctx, h) {
3535
nvme_for_each_subsystem(h, s) {
3636
std::cout << nvme_subsystem_get_name(s)
37-
<< " - NQN=" << nvme_subsystem_get_nqn(s)
37+
<< " - NQN=" << nvme_subsystem_get_subsysnqn(s)
3838
<< "\n";
3939
nvme_subsystem_for_each_ctrl(s, c) {
4040
std::cout << " `- " << nvme_ctrl_get_name(c)

libnvme/test/test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static bool nvme_match_subsysnqn_filter(nvme_subsystem_t s,
3333
char *nqn_match = f_args;
3434

3535
if (s)
36-
return strcmp(nvme_subsystem_get_nqn(s), nqn_match) == 0;
36+
return strcmp(nvme_subsystem_get_subsysnqn(s), nqn_match) == 0;
3737
return true;
3838
}
3939

@@ -405,7 +405,7 @@ int main(int argc, char **argv)
405405
nvme_for_each_host(ctx, h) {
406406
nvme_for_each_subsystem(h, s) {
407407
printf("%s - NQN=%s\n", nvme_subsystem_get_name(s),
408-
nvme_subsystem_get_nqn(s));
408+
nvme_subsystem_get_subsysnqn(s));
409409
nvme_subsystem_for_each_ctrl(s, c) {
410410
printf(" %s %s %s %s\n", nvme_ctrl_get_name(c),
411411
nvme_ctrl_get_transport(c),
@@ -433,7 +433,7 @@ int main(int argc, char **argv)
433433
nvme_for_each_host(ctx, h) {
434434
nvme_for_each_subsystem(h, s) {
435435
printf("%s - NQN=%s\n", nvme_subsystem_get_name(s),
436-
nvme_subsystem_get_nqn(s));
436+
nvme_subsystem_get_subsysnqn(s));
437437
nvme_subsystem_for_each_ctrl(s, c) {
438438
printf(" `- %s %s %s %s\n",
439439
nvme_ctrl_get_name(c),

0 commit comments

Comments
 (0)