Skip to content

Commit ef61562

Browse files
committed
tree: move nvme_ns_*_transport_handle to private header
There is no user left for this interface, thus move it to the private header and reduce the API. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 859c015 commit ef61562

6 files changed

Lines changed: 28 additions & 26 deletions

File tree

libnvme/src/libnvme.ld

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ LIBNVME_2_0 {
189189
nvme_ns_get_serial;
190190
nvme_ns_get_subsystem;
191191
nvme_ns_get_sysfs_dir;
192-
nvme_ns_get_transport_handle;
193192
nvme_ns_get_uuid;
194193
nvme_ns_identify;
195194
nvme_ns_read;
196-
nvme_ns_release_transport_handle;
197195
nvme_ns_rescan;
198196
nvme_ns_verify;
199197
nvme_ns_write;

libnvme/src/nvme/private.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,3 +732,25 @@ static inline __u16 nvmf_exat_size(size_t val_len)
732732
{
733733
return (__u16)(sizeof(struct nvmf_ext_attr) + nvmf_exat_len(val_len));
734734
}
735+
736+
/**
737+
* nvme_ns_get_transport_handle() - Get associated transport handle
738+
* @n: Namespace instance
739+
*
740+
* libnvme will open() the file (if not already opened) and keep
741+
* an internal copy of the link handle. Following calls to
742+
* this API retrieve the internal cached copy of the link
743+
* handle. The file will remain opened and the device handle will
744+
* remain cached until the ns object is deleted or
745+
* nvme_ns_release_transport_handle() is called.
746+
*
747+
* Return: Link handle with @n or NULL
748+
*/
749+
struct nvme_transport_handle *nvme_ns_get_transport_handle(nvme_ns_t n);
750+
751+
/**
752+
* nvme_ns_release_transport_handle() - Free transport handle from ns object
753+
* @n: Namespace instance
754+
*
755+
*/
756+
void nvme_ns_release_transport_handle(nvme_ns_t n);

libnvme/src/nvme/tree.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -502,28 +502,6 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
502502
for (p = nvme_namespace_first_path(n); p != NULL; \
503503
p = nvme_namespace_next_path(n, p))
504504

505-
/**
506-
* nvme_ns_get_transport_handle() - Get associated transport handle
507-
* @n: Namespace instance
508-
*
509-
* libnvme will open() the file (if not already opened) and keep
510-
* an internal copy of the link handle. Following calls to
511-
* this API retrieve the internal cached copy of the link
512-
* handle. The file will remain opened and the device handle will
513-
* remain cached until the ns object is deleted or
514-
* nvme_ns_release_transport_handle() is called.
515-
*
516-
* Return: Link handle with @n or NULL
517-
*/
518-
struct nvme_transport_handle *nvme_ns_get_transport_handle(nvme_ns_t n);
519-
520-
/**
521-
* nvme_ns_release_transport_handle() - Free transport handle from ns object
522-
* @n: Namespace instance
523-
*
524-
*/
525-
void nvme_ns_release_transport_handle(nvme_ns_t n);
526-
527505
/**
528506
* nvme_ns_get_nsid() - NSID of a namespace
529507
* @n: Namespace instance

libnvme/test/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ main = executable(
1515
dependencies: [
1616
config_dep,
1717
ccan_dep,
18-
libnvme_dep,
18+
libnvme_test_dep,
1919
],
2020
)
2121

@@ -61,7 +61,7 @@ zns = executable(
6161
dependencies: [
6262
config_dep,
6363
ccan_dep,
64-
libnvme_dep,
64+
libnvme_test_dep,
6565
],
6666
)
6767

libnvme/test/test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
#include <libnvme.h>
1919

20+
#include "nvme/private.h"
21+
2022
#include <stdio.h>
2123
#include <stdlib.h>
2224
#include <string.h>

libnvme/test/zns.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
#include <libnvme.h>
1313

14+
#include "nvme/private.h"
15+
1416
#include <stdio.h>
1517
#include <string.h>
1618
#include <stdbool.h>

0 commit comments

Comments
 (0)