]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
fix integration breakage
authorKeith Busch <kbusch@kernel.org>
Wed, 7 Apr 2021 21:24:33 +0000 (14:24 -0700)
committerKeith Busch <kbusch@kernel.org>
Wed, 7 Apr 2021 21:24:33 +0000 (14:24 -0700)
Signed-off-by: Keith Busch <kbusch@kernel.org>
src/nvme/ioctl.h
src/nvme/tree.c
test/register.c
test/test.c
test/zns.c

index 6804b775646448b866b31972335df3cec4983576..c9494ba80c0c0296c629f209e7b0abae36f484b1 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef _LIBNVME_IOCTL_H
 #define _LIBNVME_IOCTL_H
 
+#include <stddef.h>
 #include <sys/ioctl.h>
 #include "types.h"
 
@@ -1112,7 +1113,7 @@ int nvme_get_log(int fd, enum nvme_cmd_get_log_lid lid, __u32 nsid, __u64 lpo,
 static inline int nvme_get_nsid_log(int fd, enum nvme_cmd_get_log_lid lid,
                                    __u32 nsid, __u32 len, void *log)
 {
-       return nvme_get_log(fd, lid, nsid, 0, 0, 0, false, 0, 0, len,
+       return nvme_get_log(fd, lid, nsid, 0, 0, 0, false, 0, NVME_CSI_NVM, len,
                            log);
 }
 
@@ -1862,7 +1863,8 @@ int nvme_get_features(int fd, enum nvme_features_id fid, __u32 nsid,
 static inline int nvme_get_features_data(int fd, enum nvme_features_id fid,
                        __u32 nsid, __u32 data_len, void *data, __u32 *result)
 {
-       return nvme_get_features(fd, fid, nsid, 0, 0, 0, data_len, data, result);
+       return nvme_get_features(fd, fid, nsid, NVME_GET_FEATURES_SEL_CURRENT,
+                                0, 0, data_len, data, result);
 }
 static inline int nvme_get_features_simple(int fd, enum nvme_features_id fid,
                        __u32 nsid, __u32 *result)
index d0309938af1d87cb9ce4e670744027f7e9a2c437..f1bd2405a4fb25a98430bfddd8b8b9edf34b8b9b 100644 (file)
@@ -650,7 +650,9 @@ static nvme_ctrl_t __nvme_ctrl_alloc(const char *path, const char *name)
                        host_traddr = a + 12;
                a = strtok_r(NULL, ",", &e);
        }
-       c->traddr = strdup(traddr);
+
+       if (traddr)
+               c->traddr = strdup(traddr);
        if (trsvcid)
                c->trsvcid = strdup(trsvcid);
        if (host_traddr)
index b405eafa4ec2c49210ffc3fd2065862d6ca8f2b5..06244dfd5c2b8b9593f17c5ee0a9b0ece7c6261b 100644 (file)
@@ -45,7 +45,8 @@ void nvme_print_registers(void *regs)
        __u32 pmrsts    = nvme_mmio_read32(regs + NVME_REG_PMRSTS);
        __u32 pmrebs    = nvme_mmio_read32(regs + NVME_REG_PMREBS);
        __u32 pmrswtp   = nvme_mmio_read32(regs + NVME_REG_PMRSWTP);
-       __u64 pmrmsc    = nvme_mmio_read64(regs + NVME_REG_PMRMSC);
+       __u64 pmrmsc    = nvme_mmio_read32(regs + NVME_REG_PMRMSCL) |
+                  (__u64)nvme_mmio_read64(regs + NVME_REG_PMRMSCU) << 32;
 
        printf("%-10s : %llx\n", "CAP", cap);
        printf("  %-8s : %llx\n", "MQES", NVME_CAP_MQES(cap));
index a2229876d5247a77ce8eaecbc8ee9cca88720d0f..851ccb3b50b4ed0294fa37edc4bfa845a1a72410 100644 (file)
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdbool.h>
+#include <uuid/uuid.h>
 #include <libnvme.h>
 
 static char *nqn_match;
index fd186f19bfdc6ae8c389e893d3613db80b297b0a..e54c7abaf802c0cd9fdd48e6ad0b1d54a1f5646b 100644 (file)
@@ -40,7 +40,7 @@ static void show_zns_properties(nvme_ns_t n)
                return;
        }
 
-       printf("zamds:%u\n", zns_ctrl.zamds);
+       printf("zasl:%u\n", zns_ctrl.zasl);
 
        if (nvme_zns_mgmt_recv(nvme_ns_get_fd(n), nvme_ns_get_nsid(n), 0,
                               NVME_ZNS_ZRA_REPORT_ZONES, NVME_ZNS_ZRAS_REPORT_ALL,