summaryrefslogtreecommitdiffstats
path: root/libnvme-wrap.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:23:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:23:26 +0000
commitfab3f41b7b3f080c215157a026ee6bc7efbfe968 (patch)
treef0fafb0805c3eb11eb2a278f9f8058376c8f0f2b /libnvme-wrap.c
parentAdding upstream version 2.1.2. (diff)
downloadnvme-cli-fab3f41b7b3f080c215157a026ee6bc7efbfe968.tar.xz
nvme-cli-fab3f41b7b3f080c215157a026ee6bc7efbfe968.zip
Adding upstream version 2.2.1.upstream/2.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--libnvme-wrap.c (renamed from wrapper.c)18
1 files changed, 16 insertions, 2 deletions
diff --git a/wrapper.c b/libnvme-wrap.c
index 2ba5b32..354e7f7 100644
--- a/wrapper.c
+++ b/libnvme-wrap.c
@@ -6,6 +6,7 @@
*/
#include <dlfcn.h>
+#include <errno.h>
#include <libnvme.h>
@@ -21,14 +22,14 @@ void __attribute__((weak)) name(proto) \
fn(args); \
}
-#define FN(name, rtype, proto, args, fallback) \
+#define FN(name, rtype, proto, args, defret) \
rtype __attribute__((weak)) name(proto) \
{ \
rtype (*fn)(proto); \
fn = dlsym(RTLD_NEXT, #name); \
if (fn) \
return fn(args); \
- return fallback; \
+ return defret; \
}
FN(nvme_get_version,
@@ -40,3 +41,16 @@ VOID_FN(nvme_init_copy_range_f1,
__u64 *slbas, __u64 *eilbrts, __u32 *elbatms,
__u32 *elbats, __u16 nr),
ARGS(copy, nlbs, slbas, eilbrts, elbatms, elbats, nr))
+
+FN(nvme_get_feature_length2,
+ int,
+ PROTO(int fid, __u32 cdw11, enum nvme_data_tfr dir,
+ __u32 *len),
+ ARGS(fid, cdw11, dir, len),
+ -EEXIST)
+
+FN(nvme_ctrl_is_persistent,
+ bool,
+ PROTO(nvme_ctrl_t c),
+ ARGS(c),
+ false)