Adding upstream version 2.7.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
83f51a6dde
commit
e08cb5ae68
663 changed files with 15529 additions and 6994 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "nvme.h"
|
||||
#include "libnvme.h"
|
||||
#include "nvme-print.h"
|
||||
#include "util/cleanup.h"
|
||||
|
||||
#define CREATE_CMD
|
||||
#include "zns.h"
|
||||
|
@ -135,8 +136,8 @@ static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *pl
|
|||
if (err)
|
||||
return errno;
|
||||
|
||||
err = flags = validate_output_format(cfg.output_format);
|
||||
if (flags < 0)
|
||||
err = validate_output_format(cfg.output_format, &flags);
|
||||
if (err < 0)
|
||||
goto close_dev;
|
||||
|
||||
err = nvme_zns_identify_ctrl(dev_fd(dev), &ctrl);
|
||||
|
@ -188,8 +189,8 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug
|
|||
if (err)
|
||||
return errno;
|
||||
|
||||
flags = validate_output_format(cfg.output_format);
|
||||
if (flags < 0)
|
||||
err = validate_output_format(cfg.output_format, &flags);
|
||||
if (err < 0)
|
||||
goto close_dev;
|
||||
if (cfg.vendor_specific)
|
||||
flags |= VS;
|
||||
|
@ -560,7 +561,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug
|
|||
const char *desc = "Set Zone Descriptor Extension\n";
|
||||
const char *zslba = "starting LBA of the zone for this command";
|
||||
const char *zrwaa = "Allocate Zone Random Write Area to zone";
|
||||
const char *data = "optional file for zone extention data (default stdin)";
|
||||
const char *data = "optional file for zone extension data (default stdin)";
|
||||
const char *timeout = "timeout value, in milliseconds";
|
||||
|
||||
int ffd = STDIN_FILENO, err;
|
||||
|
@ -603,7 +604,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug
|
|||
|
||||
if (!data_len || data_len < 0) {
|
||||
fprintf(stderr,
|
||||
"zone format does not provide descriptor extention\n");
|
||||
"zone format does not provide descriptor extension\n");
|
||||
errno = EINVAL;
|
||||
err = -1;
|
||||
goto close_dev;
|
||||
|
@ -765,8 +766,8 @@ static int zone_mgmt_recv(int argc, char **argv, struct command *cmd, struct plu
|
|||
if (err)
|
||||
return errno;
|
||||
|
||||
flags = validate_output_format(cfg.output_format);
|
||||
if (flags < 0)
|
||||
err = validate_output_format(cfg.output_format, &flags);
|
||||
if (err < 0)
|
||||
goto close_dev;
|
||||
|
||||
if (!cfg.namespace_id) {
|
||||
|
@ -833,8 +834,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi
|
|||
int zdes = 0, err = -1;
|
||||
struct nvme_dev *dev;
|
||||
__u32 report_size;
|
||||
bool huge = false;
|
||||
struct nvme_zone_report *report, *buff;
|
||||
_cleanup_huge_ struct nvme_mem_huge mh = { 0, };
|
||||
|
||||
unsigned int nr_zones_chunks = 1024, /* 1024 entries * 64 bytes per entry = 64k byte transfer */
|
||||
nr_zones_retrieved = 0,
|
||||
|
@ -846,7 +847,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi
|
|||
struct nvme_id_ns id_ns;
|
||||
uint8_t lbaf;
|
||||
__le64 zsze;
|
||||
struct json_object *zone_list = 0;
|
||||
struct json_object *zone_list = NULL;
|
||||
|
||||
struct config {
|
||||
char *output_format;
|
||||
|
@ -880,8 +881,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi
|
|||
if (err)
|
||||
return errno;
|
||||
|
||||
flags = validate_output_format(cfg.output_format);
|
||||
if (flags < 0)
|
||||
err = validate_output_format(cfg.output_format, &flags);
|
||||
if (err < 0)
|
||||
goto close_dev;
|
||||
if (cfg.verbose)
|
||||
flags |= VERBOSE;
|
||||
|
@ -949,7 +950,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_huge(report_size, &huge);
|
||||
report = nvme_alloc_huge(report_size, &mh);
|
||||
if (!report) {
|
||||
perror("alloc");
|
||||
err = -ENOMEM;
|
||||
|
@ -957,10 +958,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi
|
|||
}
|
||||
|
||||
offset = cfg.zslba;
|
||||
if (flags & JSON)
|
||||
zone_list = json_create_array();
|
||||
else
|
||||
printf("nr_zones: %"PRIu64"\n", (uint64_t)le64_to_cpu(total_nr_zones));
|
||||
|
||||
nvme_zns_start_zone_list(total_nr_zones, &zone_list, flags);
|
||||
|
||||
while (nr_zones_retrieved < nr_zones) {
|
||||
if (nr_zones_retrieved >= nr_zones)
|
||||
|
@ -989,15 +988,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi
|
|||
offset = le64_to_cpu(report->entries[nr_zones_chunks-1].zslba) + zsze;
|
||||
}
|
||||
|
||||
if (flags & JSON) {
|
||||
struct print_ops *ops;
|
||||
|
||||
ops = nvme_get_json_print_ops(flags);
|
||||
if (ops)
|
||||
ops->zns_finish_zone_list(total_nr_zones, zone_list);
|
||||
}
|
||||
|
||||
nvme_free_huge(report, huge);
|
||||
nvme_zns_finish_zone_list(total_nr_zones, zone_list, flags);
|
||||
|
||||
free_buff:
|
||||
free(buff);
|
||||
|
@ -1256,8 +1247,8 @@ static int changed_zone_list(int argc, char **argv, struct command *cmd, struct
|
|||
if (err)
|
||||
return errno;
|
||||
|
||||
flags = validate_output_format(cfg.output_format);
|
||||
if (flags < 0)
|
||||
err = validate_output_format(cfg.output_format, &flags);
|
||||
if (err < 0)
|
||||
goto close_dev;
|
||||
|
||||
if (!cfg.namespace_id) {
|
||||
|
|
|
@ -15,7 +15,7 @@ PLUGIN(NAME("zns", "Zoned Namespace Command Set", NVME_VERSION),
|
|||
ENTRY("report-zones", "Report zones associated to a Zoned Namespace", report_zones)
|
||||
ENTRY("reset-zone", "Reset one or more zones", reset_zone)
|
||||
ENTRY("close-zone", "Close one or more zones", close_zone)
|
||||
ENTRY("finish-zone", "Finishe one or more zones", finish_zone)
|
||||
ENTRY("finish-zone", "Finish one or more zones", finish_zone)
|
||||
ENTRY("open-zone", "Open one or more zones", open_zone)
|
||||
ENTRY("offline-zone", "Offline one or more zones", offline_zone)
|
||||
ENTRY("set-zone-desc", "Attach zone descriptor extension data to a zone", set_zone_desc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue