Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/libefi/efizfs.c
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | efizfs_get_handle_by_guid(uint64_t guid) | ||||
STAILQ_FOREACH(zi, &zfsinfo, zi_link) { | STAILQ_FOREACH(zi, &zfsinfo, zi_link) { | ||||
if (zi->zi_pool_guid == guid) { | if (zi->zi_pool_guid == guid) { | ||||
return (zi->zi_handle); | return (zi->zi_handle); | ||||
} | } | ||||
} | } | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
bool | |||||
efizfs_get_guid_by_handle(EFI_HANDLE handle, uint64_t *guid) | |||||
tsoome: hm, better return bool there. | |||||
{ | |||||
zfsinfo_t *zi; | |||||
if (guid == NULL) | |||||
return (1); | |||||
kevansUnsubmitted Not Done Inline Actionsreturn (false) kevans: return (false) | |||||
STAILQ_FOREACH(zi, &zfsinfo, zi_link) { | |||||
if (zi->zi_handle == handle) { | |||||
*guid = zi->zi_pool_guid; | |||||
return (true); | |||||
} | |||||
} | |||||
return (false); | |||||
} | |||||
static void | static void | ||||
insert_zfs(EFI_HANDLE handle, uint64_t guid) | insert_zfs(EFI_HANDLE handle, uint64_t guid) | ||||
{ | { | ||||
zfsinfo_t *zi; | zfsinfo_t *zi; | ||||
zi = malloc(sizeof(zfsinfo_t)); | zi = malloc(sizeof(zfsinfo_t)); | ||||
zi->zi_handle = handle; | zi->zi_handle = handle; | ||||
zi->zi_pool_guid = guid; | zi->zi_pool_guid = guid; | ||||
Show All 37 Lines |
hm, better return bool there.