Merging upstream version 2.5.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
3d70d3c76b
commit
ee6621a5b2
507 changed files with 19440 additions and 17258 deletions
|
@ -121,7 +121,7 @@ static int fdp_usage(int argc, char **argv, struct command *cmd, struct plugin *
|
|||
};
|
||||
|
||||
struct config cfg = {
|
||||
.egid = 0,
|
||||
.egid = 0,
|
||||
.output_format = "normal",
|
||||
.raw_binary = false,
|
||||
};
|
||||
|
@ -192,7 +192,7 @@ static int fdp_stats(int argc, char **argv, struct command *cmd, struct plugin *
|
|||
};
|
||||
|
||||
struct config cfg = {
|
||||
.egid = 0,
|
||||
.egid = 0,
|
||||
.output_format = "normal",
|
||||
.raw_binary = false,
|
||||
};
|
||||
|
@ -251,8 +251,8 @@ static int fdp_events(int argc, char **argv, struct command *cmd, struct plugin
|
|||
};
|
||||
|
||||
struct config cfg = {
|
||||
.egid = 0,
|
||||
.host_events = false,
|
||||
.egid = 0,
|
||||
.host_events = false,
|
||||
.output_format = "normal",
|
||||
.raw_binary = false,
|
||||
};
|
||||
|
@ -424,9 +424,8 @@ static int fdp_update(int argc, char **argv, struct command *cmd, struct plugin
|
|||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < npids; i++) {
|
||||
for (unsigned int i = 0; i < npids; i++)
|
||||
buf[i] = cpu_to_le16(pids[i]);
|
||||
}
|
||||
|
||||
err = nvme_fdp_reclaim_unit_handle_update(dev_fd(dev), cfg.namespace_id, npids, buf);
|
||||
if (err) {
|
||||
|
@ -449,6 +448,7 @@ static int fdp_set_events(int argc, char **argv, struct command *cmd, struct plu
|
|||
const char *enable = "Enable/disable event";
|
||||
const char *event_types = "Comma-separated list of event types";
|
||||
const char *ph = "Placement Handle";
|
||||
const char *save = "specifies that the controller shall save the attribute";
|
||||
|
||||
struct nvme_dev *dev;
|
||||
int err = -1;
|
||||
|
@ -458,19 +458,22 @@ static int fdp_set_events(int argc, char **argv, struct command *cmd, struct plu
|
|||
|
||||
struct config {
|
||||
__u32 namespace_id;
|
||||
__u16 ph;
|
||||
char *event_types;
|
||||
bool enable;
|
||||
__u16 ph;
|
||||
char *event_types;
|
||||
bool enable;
|
||||
bool save;
|
||||
};
|
||||
|
||||
struct config cfg = {
|
||||
.enable = false,
|
||||
.enable = false,
|
||||
.save = false,
|
||||
};
|
||||
|
||||
OPT_ARGS(opts) = {
|
||||
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id),
|
||||
OPT_SHRT("placement-handle", 'p', &cfg.ph, ph),
|
||||
OPT_FLAG("enable", 'e', &cfg.enable, enable),
|
||||
OPT_FLAG("save", 's', &cfg.save, save),
|
||||
OPT_LIST("event-types", 't', &cfg.event_types, event_types),
|
||||
OPT_END()
|
||||
};
|
||||
|
@ -506,14 +509,14 @@ static int fdp_set_events(int argc, char **argv, struct command *cmd, struct plu
|
|||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < nev; i++) {
|
||||
for (unsigned int i = 0; i < nev; i++)
|
||||
buf[i] = (__u8)evts[i];
|
||||
}
|
||||
|
||||
struct nvme_set_features_args args = {
|
||||
.args_size = sizeof(args),
|
||||
.fd = dev_fd(dev),
|
||||
.fid = NVME_FEAT_FID_FDP_EVENTS,
|
||||
.save = cfg.save,
|
||||
.nsid = cfg.namespace_id,
|
||||
.cdw11 = (nev << 16) | cfg.ph,
|
||||
.cdw12 = cfg.enable ? 0x1 : 0x0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue