Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/efi/boot1/zfs_module.c
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *bufsize) | ||||
if ((err = zfs_dnode_stat(spa, &dn, &st)) != 0) { | if ((err = zfs_dnode_stat(spa, &dn, &st)) != 0) { | ||||
printf("Failed to stat '%s' on pool '%s' (%d)\n", filepath, | printf("Failed to stat '%s' on pool '%s' (%d)\n", filepath, | ||||
spa->spa_name, err); | spa->spa_name, err); | ||||
return (EFI_INVALID_PARAMETER); | return (EFI_INVALID_PARAMETER); | ||||
} | } | ||||
if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) | if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) | ||||
!= EFI_SUCCESS) { | != EFI_SUCCESS) { | ||||
printf("Failed to allocate load buffer %zd for pool '%s' for '%s' " | printf("Failed to allocate load buffer %jd for pool '%s' for '%s' " | ||||
"(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); | "(%lu)\n", (intmax_t)st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); | ||||
return (EFI_INVALID_PARAMETER); | return (EFI_INVALID_PARAMETER); | ||||
} | } | ||||
if ((err = dnode_read(spa, &dn, 0, buf, st.st_size)) != 0) { | if ((err = dnode_read(spa, &dn, 0, buf, st.st_size)) != 0) { | ||||
printf("Failed to read node from %s (%d)\n", spa->spa_name, | printf("Failed to read node from %s (%d)\n", spa->spa_name, | ||||
err); | err); | ||||
(void)bs->FreePool(buf); | (void)bs->FreePool(buf); | ||||
return (EFI_INVALID_PARAMETER); | return (EFI_INVALID_PARAMETER); | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |