json_object_add_value_int(root, "ozcs", le16_to_cpu(ns->ozcs));
json_object_add_value_int(root, "mar", le16_to_cpu(ns->mar));
json_object_add_value_int(root, "mor", le16_to_cpu(ns->mor));
- json_object_add_value_int(root, "rrl", ns->rrl);
- json_object_add_value_int(root, "frl", ns->frl);
+ json_object_add_value_int(root, "rrl", le32_to_cpu(ns->rrl));
+ json_object_add_value_int(root, "frl", le32_to_cpu(ns->frl));
lbafs = json_create_array();
json_object_add_value_array(root, "lbafe", lbafs);
show_nvme_id_ns_zoned_ozcs(ns->ozcs);
printf("mar : %u\n", le16_to_cpu(ns->mar));
printf("mor : %u\n", le16_to_cpu(ns->mor));
- printf("rrl : %u\n", ns->rrl);
- printf("frl : %u\n", ns->frl);
+ printf("rrl : %u\n", le32_to_cpu(ns->rrl));
+ printf("frl : %u\n", le32_to_cpu(ns->frl));
for (i = 0; i <= id_ns->nlbaf; i++){
if (human)
#define CREATE_CMD
#include "zns.h"
-static const char *namespace_id = "Namespace identify to use";
+static const char *namespace_id = "Namespace identifier to use";
static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *plugin)
{
OPT_END()
};
- err = asprintf(&command, "%s-%s", plugin->name, cmd->name);
- if (err < 0)
- return errno;
-
err = fd = parse_and_open(argc, argv, desc, opts);
if (fd < 0)
- goto free;
+ return errno;
+
+ err = asprintf(&command, "%s-%s", plugin->name, cmd->name);
+ if (err < 0)
+ goto close_fd;
if (!cfg.namespace_id) {
err = cfg.namespace_id = nvme_get_nsid(fd);
nvme_show_status(err);
free:
free(command);
+close_fd:
+ close(fd);
return err;
}