@@ -504,6 +504,26 @@ snprint_dm_path_state (struct strbuf *buff, const struct path * pp)
}
}
+static int snprint_initialized(struct strbuf *buff, const struct path * pp)
+{
+ static const char *init_state_name[] = {
+ [INIT_NEW] = "new",
+ [INIT_FAILED] = "failed",
+ [INIT_MISSING_UDEV] = "udev-missing",
+ [INIT_REQUESTED_UDEV] = "udev-requested",
+ [INIT_OK] = "ok",
+ [INIT_REMOVED] = "removed",
+ [INIT_PARTIAL] = "partial",
+ };
+ const char *str;
+
+ if (pp->initialized < INIT_NEW || pp->initialized >= __INIT_LAST)
+ str = "undef";
+ else
+ str = init_state_name[pp->initialized];
+ return append_strbuf_str(buff, str);
+}
+
static int
snprint_vpr (struct strbuf *buff, const struct path * pp)
{
@@ -804,6 +824,7 @@ struct path_data pd[] = {
{'g', "vpd page data", 0, snprint_path_vpd_data},
{'0', "failures", 0, snprint_path_failures},
{'P', "protocol", 0, snprint_path_protocol},
+ {'I', "init_st", 0, snprint_initialized},
{0, NULL, 0 , NULL}
};
@@ -206,6 +206,7 @@ enum initialized_states {
* change uevent is received.
*/
INIT_PARTIAL,
+ __INIT_LAST,
};
enum prkey_sources {