Skip to content

Commit a35dfc4

Browse files
committed
tree: make nvme_lookup_ctrl and nvme_ctrl_find private
There are no public users for these function. Make them private so we can refactor them without breaking the API in future. Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent 4755fb2 commit a35dfc4

File tree

4 files changed

+9
-52
lines changed

4 files changed

+9
-52
lines changed

libnvme/src/libnvme.ld

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ LIBNVME_2_0 {
99
nvme_create_ctrl;
1010
nvme_create_global_ctx;
1111
nvme_ctrl_config_match;
12-
nvme_ctrl_find;
1312
nvme_ctrl_first_ns;
1413
nvme_ctrl_first_path;
1514
nvme_ctrl_get_address;
@@ -126,7 +125,6 @@ LIBNVME_2_0 {
126125
nvme_insert_tls_key_compat;
127126
nvme_insert_tls_key_versioned;
128127
nvme_ipaddrs_eq;
129-
nvme_lookup_ctrl;
130128
nvme_lookup_key;
131129
nvme_lookup_keyring;
132130
nvme_mi_admin_admin_passthru;

libnvme/src/nvme/private.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,14 @@ nvme_host_t nvme_lookup_host(struct nvme_global_ctx *ctx, const char *hostnqn,
416416
nvme_subsystem_t nvme_lookup_subsystem(struct nvme_host *h,
417417
const char *name,
418418
const char *subsysnqn);
419-
419+
nvme_ctrl_t nvme_lookup_ctrl(nvme_subsystem_t s, const char *transport,
420+
const char *traddr, const char *host_traddr,
421+
const char *host_iface, const char *trsvcid,
422+
nvme_ctrl_t p);
423+
nvme_ctrl_t nvme_ctrl_find(nvme_subsystem_t s, const char *transport,
424+
const char *traddr, const char *trsvcid,
425+
const char *subsysnqn, const char *host_traddr,
426+
const char *host_iface);
420427

421428
#if (LOG_FUNCNAME == 1)
422429
#define __nvme_log_func __func__

libnvme/src/nvme/tree.h

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -300,54 +300,6 @@ nvme_path_t nvme_namespace_first_path(nvme_ns_t ns);
300300
*/
301301
nvme_path_t nvme_namespace_next_path(nvme_ns_t ns, nvme_path_t p);
302302

303-
/**
304-
* nvme_lookup_ctrl() - Lookup nvme_ctrl_t object
305-
* @s: &nvme_subsystem_t object
306-
* @transport: Transport name
307-
* @traddr: Transport address
308-
* @host_traddr: Host transport address
309-
* @host_iface: Host interface name
310-
* @trsvcid: Transport service identifier
311-
* @p: Previous controller instance
312-
*
313-
* Lookup a controller in @s based on @transport, @traddr,
314-
* @host_traddr, @host_iface, and @trsvcid. @transport must be specified,
315-
* other fields may be required depending on the transport. A new
316-
* object is created if none is found. If @p is specified the lookup
317-
* will start at @p instead of the first controller.
318-
*
319-
* Return: Controller instance
320-
*/
321-
nvme_ctrl_t nvme_lookup_ctrl(nvme_subsystem_t s, const char *transport,
322-
const char *traddr, const char *host_traddr,
323-
const char *host_iface, const char *trsvcid,
324-
nvme_ctrl_t p);
325-
326-
/**
327-
* nvme_ctrl_find() - Locate an existing controller
328-
* @s: &nvme_subsystem_t object
329-
* @transport: Transport name
330-
* @traddr: Transport address
331-
* @trsvcid: Transport service identifier
332-
* @subsysnqn: Subsystem NQN
333-
* @host_traddr: Host transport address
334-
* @host_iface: Host interface name
335-
*
336-
* Lookup a controller in @s based on @transport, @traddr, @trsvcid,
337-
* @subsysnqn, @host_traddr, and @host_iface. @transport must be specified,
338-
* other fields may be required depending on the transport. Parameters set
339-
* to NULL will be ignored.
340-
*
341-
* Unlike nvme_lookup_ctrl(), this function does not create a new object if
342-
* an existing controller cannot be found.
343-
*
344-
* Return: Controller instance on success, NULL otherwise.
345-
*/
346-
nvme_ctrl_t nvme_ctrl_find(nvme_subsystem_t s, const char *transport,
347-
const char *traddr, const char *trsvcid,
348-
const char *subsysnqn, const char *host_traddr,
349-
const char *host_iface);
350-
351303
/**
352304
* nvme_ctrl_config_match() - Check if ctrl @c matches config params
353305
* @c: An existing controller instance

libnvme/test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if conf.get('HAVE_NETDB')
130130
dependencies: [
131131
config_dep,
132132
ccan_dep,
133-
libnvme_dep,
133+
libnvme_test_dep,
134134
],
135135
link_with: mock_ifaddrs,
136136
)

0 commit comments

Comments
 (0)