summaryrefslogtreecommitdiffstats
path: root/libnvme-wrap.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:54 +0000
commit66e4b69042cd3b44acd42f1fad2109180c1bc48b (patch)
tree8bd8e664ae856167566375357963062e8112f181 /libnvme-wrap.c
parentReleasing debian version 2.5-1. (diff)
downloadnvme-cli-66e4b69042cd3b44acd42f1fad2109180c1bc48b.tar.xz
nvme-cli-66e4b69042cd3b44acd42f1fad2109180c1bc48b.zip
Merging upstream version 2.7.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnvme-wrap.c')
-rw-r--r--libnvme-wrap.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/libnvme-wrap.c b/libnvme-wrap.c
index 354e7f7..b5b4838 100644
--- a/libnvme-wrap.c
+++ b/libnvme-wrap.c
@@ -7,19 +7,24 @@
#include <dlfcn.h>
#include <errno.h>
+#include <stdlib.h>
#include <libnvme.h>
+#include "nvme-print.h"
#define PROTO(args...) args
#define ARGS(args...) args
-#define VOID_FN(name, proto, args) \
-void __attribute__((weak)) name(proto) \
-{ \
- void (*fn)(proto); \
- fn = dlsym(RTLD_NEXT, #name); \
- if (fn) \
- fn(args); \
+#define VOID_FN(name, proto, args) \
+void __attribute__((weak)) name(proto) \
+{ \
+ void (*fn)(proto); \
+ fn = dlsym(RTLD_NEXT, #name); \
+ if (!fn) { \
+ nvme_show_error("libnvme function " #name " not found");\
+ exit(EXIT_FAILURE); \
+ } \
+ fn(args); \
}
#define FN(name, rtype, proto, args, defret) \
@@ -42,6 +47,18 @@ VOID_FN(nvme_init_copy_range_f1,
__u32 *elbats, __u16 nr),
ARGS(copy, nlbs, slbas, eilbrts, elbatms, elbats, nr))
+VOID_FN(nvme_init_copy_range_f2,
+ PROTO(struct nvme_copy_range_f2 *copy, __u32 *snsids,
+ __u16 *nlbs, __u64 *slbas, __u16 *sopts, __u32 *eilbrts,
+ __u32 *elbatms, __u32 *elbats, __u16 nr),
+ ARGS(copy, snsids, nlbs, slbas, sopts, eilbrts, elbatms, elbats, nr))
+
+VOID_FN(nvme_init_copy_range_f3,
+ PROTO(struct nvme_copy_range_f3 *copy, __u32 *snsids,
+ __u16 *nlbs, __u64 *slbas, __u16 *sopts, __u64 *eilbrts,
+ __u32 *elbatms, __u32 *elbats, __u16 nr),
+ ARGS(copy, snsids, nlbs, slbas, sopts, eilbrts, elbatms, elbats, nr))
+
FN(nvme_get_feature_length2,
int,
PROTO(int fid, __u32 cdw11, enum nvme_data_tfr dir,