Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvdimm/nvdimm_spa.c
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | static struct nvdimm_SPA_uuid_list_elm { | ||||
[SPA_TYPE_PERSISTENT_VIRTUAL_CD] = { | [SPA_TYPE_PERSISTENT_VIRTUAL_CD] = { | ||||
.u_name = "PV CD ", | .u_name = "PV CD ", | ||||
.u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD, | .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD, | ||||
.u_usr_acc = true, | .u_usr_acc = true, | ||||
}, | }, | ||||
}; | }; | ||||
enum SPA_mapping_type | enum SPA_mapping_type | ||||
nvdimm_spa_type_from_name(const char *name) | |||||
{ | |||||
int j; | |||||
for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { | |||||
if (strcmp(name, nvdimm_SPA_uuid_list[j].u_name) != 0) | |||||
continue; | |||||
return (j); | |||||
} | |||||
return (SPA_TYPE_UNKNOWN); | |||||
} | |||||
enum SPA_mapping_type | |||||
nvdimm_spa_type_from_uuid(struct uuid *uuid) | nvdimm_spa_type_from_uuid(struct uuid *uuid) | ||||
{ | { | ||||
int j; | int j; | ||||
for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { | for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { | ||||
if (uuidcmp(uuid, &nvdimm_SPA_uuid_list[j].u_id) != 0) | if (uuidcmp(uuid, &nvdimm_SPA_uuid_list[j].u_id) != 0) | ||||
continue; | continue; | ||||
return (j); | return (j); | ||||
▲ Show 20 Lines • Show All 464 Lines • Show Last 20 Lines |