From fc67d3ad9a2903cc33e5cdaedaad51dd86a42236 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 24 Dec 2023 08:57:49 +0100 Subject: Adding upstream version 2.7.1. Signed-off-by: Daniel Baumann --- libnvme-wrap.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'libnvme-wrap.c') 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 #include +#include #include +#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, -- cgit v1.2.3