Skip to content

Commit b0f2040

Browse files
committed
src: rework nvme_capacity_mgmt command
libnvme changed the API for the nvme_capacity_mgmt command. Update the callsite accordingly. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 12f5d0e commit b0f2040

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

nvme.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8730,6 +8730,7 @@ static int capacity_mgmt(int argc, char **argv, struct command *acmd, struct plu
87308730

87318731
_cleanup_nvme_global_ctx_ struct nvme_global_ctx *ctx = NULL;
87328732
_cleanup_nvme_transport_handle_ struct nvme_transport_handle *hdl = NULL;
8733+
struct nvme_passthru_cmd cmd;
87338734
int err = -1;
87348735
__u32 result;
87358736
nvme_print_flags_t flags;
@@ -8770,16 +8771,9 @@ static int capacity_mgmt(int argc, char **argv, struct command *acmd, struct plu
87708771
return -1;
87718772
}
87728773

8773-
struct nvme_capacity_mgmt_args args = {
8774-
.args_size = sizeof(args),
8775-
.op = cfg.operation,
8776-
.element_id = cfg.element_id,
8777-
.cdw11 = cfg.dw11,
8778-
.cdw12 = cfg.dw12,
8779-
.timeout = nvme_cfg.timeout,
8780-
.result = &result,
8781-
};
8782-
err = nvme_capacity_mgmt(hdl, &args);
8774+
nvme_init_capacity_mgmt(&cmd, cfg.operation, cfg.element_id,
8775+
(__u64)cfg.dw12 << 32 | cfg.dw11);
8776+
err = nvme_submit_admin_passthru(hdl, &cmd, &result);
87838777
if (!err) {
87848778
printf("Capacity Management Command is Success\n");
87858779
if (cfg.operation == 1)

0 commit comments

Comments
 (0)