Skip to content

Commit

Permalink
nvme-print-json: add get feature pls mode print
Browse files Browse the repository at this point in the history
This change required libnvme FEAT_PLS_MODE definition added.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Jan 13, 2025
1 parent fbb34d3 commit fe3b962
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nvme-print-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -3518,6 +3518,12 @@ static void json_feature_show_fields_spinup_control(struct json_object *r, unsig
obj_add_str(r, "Spinup control feature Enabled", result & 1 ? "True" : "False");
}

static void json_feature_show_fields_power_loss_signal(struct json_object *r, unsigned int result)
{
obj_add_str(r, "Power Loss Signaling Mode (PLSM)",
nvme_pls_mode_to_string(NVME_GET(result, FEAT_PLS_MODE)));
}

static void json_host_metadata(struct json_object *r, enum nvme_features_id fid,
struct nvme_host_metadata *data)
{
Expand Down Expand Up @@ -3728,6 +3734,9 @@ static void json_feature_show_fields(enum nvme_features_id fid, unsigned int res
case NVME_FEAT_FID_SPINUP_CONTROL:
json_feature_show_fields_spinup_control(r, result);
break;
case NVME_FEAT_FID_POWER_LOSS_SIGNAL:
json_feature_show_fields_power_loss_signal(r, result);
break;
case NVME_FEAT_FID_ENH_CTRL_METADATA:
case NVME_FEAT_FID_CTRL_METADATA:
case NVME_FEAT_FID_NS_METADATA:
Expand Down

0 comments on commit fe3b962

Please sign in to comment.