Skip to content

Commit

Permalink
nvme: Add support for delete-ns command timeout option
Browse files Browse the repository at this point in the history
Change to pass the timeout value to libnvme API.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
  • Loading branch information
ikegami-t committed Apr 10, 2024
1 parent d48dd88 commit 65a1ded
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion nvme-wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ int nvme_cli_get_features(struct nvme_dev *dev,
return do_admin_args_op(get_features, dev, args);
}

int nvme_cli_ns_mgmt_delete(struct nvme_dev *dev, __u32 nsid)
int nvme_cli_ns_mgmt_delete(struct nvme_dev *dev, __u32 nsid, __u32 timeout)
{
if (dev->type == NVME_DEV_DIRECT)
return nvme_ns_mgmt_delete_timeout(dev_fd(dev), nsid, timeout);

return do_admin_op(ns_mgmt_delete, dev, nsid);
}

Expand Down
2 changes: 1 addition & 1 deletion nvme-wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int nvme_cli_identify_primary_ctrl(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);
int nvme_cli_ns_mgmt_delete(struct nvme_dev *dev, __u32 nsid, __u32 timeout);
int nvme_cli_ns_mgmt_create(struct nvme_dev *dev,
struct nvme_ns_mgmt_host_sw_specified *data,
__u32 *nsid, __u32 timeout, __u8 csi);
Expand Down
2 changes: 1 addition & 1 deletion nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2779,7 +2779,7 @@ static int delete_ns(int argc, char **argv, struct command *cmd, struct plugin *
}
}

err = nvme_cli_ns_mgmt_delete(dev, cfg.namespace_id);
err = nvme_cli_ns_mgmt_delete(dev, cfg.namespace_id, nvme_cfg.timeout);
if (!err)
printf("%s: Success, deleted nsid:%d\n", cmd->name, cfg.namespace_id);
else if (err > 0)
Expand Down

0 comments on commit 65a1ded

Please sign in to comment.