From 7552ed51f78ca1ad311228f76e90cf8c120ee2f6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 4 Oct 2023 14:52:51 +0200 Subject: Adding upstream version 2.6. Signed-off-by: Daniel Baumann --- plugins/zns/zns.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'plugins/zns') diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 5b9d013..7b1b191 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -137,7 +137,7 @@ static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *pl err = flags = validate_output_format(cfg.output_format); if (flags < 0) - goto close_fd; + goto close_dev; err = nvme_zns_identify_ctrl(dev_fd(dev), &ctrl); if (!err) @@ -146,7 +146,7 @@ static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *pl nvme_show_status(err); else perror("zns identify controller"); -close_fd: +close_dev: dev_close(dev); return err; } @@ -190,7 +190,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug flags = validate_output_format(cfg.output_format); if (flags < 0) - goto close_fd; + goto close_dev; if (cfg.vendor_specific) flags |= VS; if (cfg.human_readable) @@ -200,14 +200,14 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug err = nvme_get_nsid(dev_fd(dev), &cfg.namespace_id); if (err < 0) { perror("get-namespace-id"); - goto close_fd; + goto close_dev; } } err = nvme_identify_ns(dev_fd(dev), cfg.namespace_id, &id_ns); if (err) { nvme_show_status(err); - goto close_fd; + goto close_dev; } err = nvme_zns_identify_ns(dev_fd(dev), cfg.namespace_id, &ns); @@ -217,7 +217,7 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug nvme_show_status(err); else perror("zns identify namespace"); -close_fd: +close_dev: dev_close(dev); return err; } @@ -839,8 +839,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi unsigned int nr_zones_chunks = 1024, /* 1024 entries * 64 bytes per entry = 64k byte transfer */ nr_zones_retrieved = 0, nr_zones, - offset, log_len; + __u64 offset; int total_nr_zones = 0; struct nvme_zns_id_ns id_zns; struct nvme_id_ns id_ns; @@ -949,7 +949,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi log_len = sizeof(struct nvme_zone_report) + ((sizeof(struct nvme_zns_desc) * nr_zones_chunks) + (nr_zones_chunks * zdes)); report_size = log_len; - report = nvme_alloc(report_size, &huge); + report = nvme_alloc_huge(report_size, &huge); if (!report) { perror("alloc"); err = -ENOMEM; @@ -997,7 +997,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi ops->zns_finish_zone_list(total_nr_zones, zone_list); } - nvme_free(report, huge); + nvme_free_huge(report, huge); free_buff: free(buff); @@ -1258,13 +1258,13 @@ static int changed_zone_list(int argc, char **argv, struct command *cmd, struct flags = validate_output_format(cfg.output_format); if (flags < 0) - goto close_fd; + goto close_dev; if (!cfg.namespace_id) { err = nvme_get_nsid(dev_fd(dev), &cfg.namespace_id); if (err < 0) { perror("get-namespace-id"); - goto close_fd; + goto close_dev; } } @@ -1277,7 +1277,7 @@ static int changed_zone_list(int argc, char **argv, struct command *cmd, struct else perror("zns changed-zone-list"); -close_fd: +close_dev: dev_close(dev); return err; } -- cgit v1.2.3