diff options
Diffstat (limited to 'plugins/ymtc/ymtc-nvme.c')
-rw-r--r-- | plugins/ymtc/ymtc-nvme.c | 18 |
1 files changed, 7 insertions, 11 deletions
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 <stdlib.h> #include <unistd.h> -#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; } |