From 589986012c4b3ab68e299a2eadca18f90080113b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 14 Jul 2022 20:28:04 +0200 Subject: Merging upstream version 2.0. Signed-off-by: Daniel Baumann --- plugins/ymtc/ymtc-nvme.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'plugins/ymtc/ymtc-nvme.c') diff --git a/plugins/ymtc/ymtc-nvme.c b/plugins/ymtc/ymtc-nvme.c index 91e52be..dd5f004 100644 --- a/plugins/ymtc/ymtc-nvme.c +++ b/plugins/ymtc/ymtc-nvme.c @@ -4,15 +4,11 @@ #include #include -#include "linux/nvme_ioctl.h" - #include "nvme.h" -#include "nvme-print.h" -#include "nvme-ioctl.h" +#include "libnvme.h" #include "plugin.h" - -#include "argconfig.h" -#include "suffix.h" +#include "linux/types.h" +#include "nvme-print.h" #define CREATE_CMD #include "ymtc-nvme.h" @@ -116,7 +112,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd, const char *raw = "dump output in binary format"; struct config { __u32 namespace_id; - int raw_binary; + bool raw_binary; }; struct config cfg = { @@ -133,8 +129,8 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd, if (fd < 0) return fd; - err = nvme_get_log(fd, cfg.namespace_id, 0xca, false, - NVME_NO_LOG_LSP, sizeof(smart_log), &smart_log); + err = nvme_get_nsid_log(fd, false, 0xca, cfg.namespace_id, + sizeof(smart_log), &smart_log); if (!err) { if (!cfg.raw_binary) err = show_ymtc_smart_log(fd, cfg.namespace_id, devicename, &smart_log); @@ -142,7 +138,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd, d_raw((unsigned char *)&smart_log, sizeof(smart_log)); } if (err > 0) - fprintf(stderr, "NVMe Status:%s(%x)\n", nvme_status_to_string(err), err); + nvme_show_status(err); return err; } -- cgit v1.2.3