Skip to content

Commit

Permalink
nvme: Update list secondary command
Browse files Browse the repository at this point in the history
The nsid argument of the  nvme_{mi_admin}_identify_secondary_ctrl_list
command has been removed. Update the call side accordingly.

Signed-off-by: Daniel Wagner <[email protected]>
  • Loading branch information
igaw committed Aug 19, 2023
1 parent f9e6a06 commit 6c59d12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nvme-wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ int nvme_cli_identify_primary_ctrl(struct nvme_dev *dev, __u32 nsid,
return do_admin_op(identify_primary_ctrl, dev, nsid, cap);
}

int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev, __u32 nsid,
int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev,
__u16 ctrl_id,
struct nvme_secondary_ctrl_list *sc_list)
{
return do_admin_op(identify_secondary_ctrl_list, dev, nsid, ctrl_id,
return do_admin_op(identify_secondary_ctrl_list, dev, ctrl_id,
sc_list);
}

Expand Down
2 changes: 1 addition & 1 deletion nvme-wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int nvme_cli_identify_allocated_ns_list(struct nvme_dev *dev, __u32 nsid,
struct nvme_ns_list *list);
int nvme_cli_identify_primary_ctrl(struct nvme_dev *dev, __u32 nsid,
struct nvme_primary_ctrl_cap *cap);
int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev, __u32 nsid,
int nvme_cli_identify_secondary_ctrl_list(struct nvme_dev *dev,
__u16 ctrl_id,
struct nvme_secondary_ctrl_list *sc_list);
int nvme_cli_ns_mgmt_delete(struct nvme_dev *dev, __u32 nsid);
Expand Down
5 changes: 1 addition & 4 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -4314,21 +4314,18 @@ static int list_secondary_ctrl(int argc, char **argv, struct command *cmd, struc

struct config {
__u16 cntid;
__u32 namespace_id;
__u32 num_entries;
char *output_format;
};

struct config cfg = {
.cntid = 0,
.namespace_id = 0,
.num_entries = ARRAY_SIZE(sc_list->sc_entry),
.output_format = "normal",
};

OPT_ARGS(opts) = {
OPT_SHRT("cntid", 'c', &cfg.cntid, controller),
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id_optional),
OPT_UINT("num-entries", 'e', &cfg.num_entries, num_entries),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_END()
Expand Down Expand Up @@ -4356,7 +4353,7 @@ static int list_secondary_ctrl(int argc, char **argv, struct command *cmd, struc
goto close_err;
}

err = nvme_cli_identify_secondary_ctrl_list(dev, cfg.namespace_id, cfg.cntid, sc_list);
err = nvme_cli_identify_secondary_ctrl_list(dev, cfg.cntid, sc_list);
if (!err)
nvme_show_list_secondary_ctrl(sc_list, cfg.num_entries, flags);
else if (err > 0)
Expand Down

0 comments on commit 6c59d12

Please sign in to comment.