1
0
Fork 0

Adding upstream version 2.4+really2.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 12:22:01 +01:00
parent 69f45f5c7c
commit 85727a4155
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
458 changed files with 5141 additions and 7138 deletions

View file

@ -19,7 +19,6 @@
#include "nvme-print.h"
#include "solidigm-smart.h"
#include "solidigm-util.h"
struct __attribute__((packed)) nvme_additional_smart_log_item {
__u8 id;
@ -180,13 +179,12 @@ static void vu_smart_log_show_json(vu_smart_log_t *payload, unsigned int nsid, c
json_free_object(root);
}
static void vu_smart_log_show(vu_smart_log_t *payload, unsigned int nsid, const char *devname,
__u8 uuid_index)
static void vu_smart_log_show(vu_smart_log_t *payload, unsigned int nsid, const char *devname)
{
smart_log_item_t *item = payload->item;
printf("Additional Smart Log for NVMe device:%s namespace-id:%x UUID-idx:%d\n",
devname, nsid, uuid_index);
printf("Additional Smart Log for NVME device:%s namespace-id:%x\n",
devname, nsid);
printf("ID KEY Normalized Raw\n");
for (int i = 0; i < VU_SMART_MAX_ITEMS; i++) {
@ -203,7 +201,6 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd
enum nvme_print_flags flags;
struct nvme_dev *dev;
int err;
__u8 uuid_index;
struct config {
__u32 namespace_id;
@ -232,27 +229,8 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd
return flags;
}
uuid_index = solidigm_get_vu_uuid_index(dev);
struct nvme_get_log_args args = {
.lpo = 0,
.result = NULL,
.log = &smart_log_payload,
.args_size = sizeof(args),
.fd = dev_fd(dev),
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
.lid = solidigm_vu_smart_log_id,
.len = sizeof(smart_log_payload),
.nsid = NVME_NSID_ALL,
.csi = NVME_CSI_NVM,
.lsi = NVME_LOG_LSI_NONE,
.lsp = NVME_LOG_LSP_NONE,
.uuidx = uuid_index,
.rae = false,
.ot = false,
};
err = nvme_get_log(&args);
err = nvme_get_log_simple(dev_fd(dev), solidigm_vu_smart_log_id,
sizeof(smart_log_payload), &smart_log_payload);
if (!err) {
if (flags & JSON) {
vu_smart_log_show_json(&smart_log_payload,
@ -261,7 +239,7 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd
d_raw((unsigned char *)&smart_log_payload, sizeof(smart_log_payload));
} else {
vu_smart_log_show(&smart_log_payload, cfg.namespace_id,
dev->name, uuid_index);
dev->name);
}
} else if (err > 0) {
nvme_show_status(err);