zfs_module.c revision 199767f8919635c4928607450d9e0abb932109ce
/*-
* Copyright (c) 2015 Eric McCorkle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <stddef.h>
#include <stdarg.h>
#include <stdbool.h>
#include <efi.h>
#include "boot_module.h"
#include "libzfs.h"
#include "zfsimpl.c"
static dev_info_t *devices;
static int
{
if (status != EFI_SUCCESS) {
DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %zu, size: %zu,"
return (-1);
}
return (0);
}
static EFI_STATUS
{
/* ZFS consumes the dev on success so we need a copy. */
(void**)&tdev)) != EFI_SUCCESS) {
DPRINTF("Failed to allocate tdev (%lu)\n",
return (status);
}
return (EFI_UNSUPPORTED);
}
return (EFI_SUCCESS);
}
static EFI_STATUS
{
int err;
void *buf;
return (EFI_NOT_FOUND);
}
return (EFI_NOT_FOUND);
}
DPRINTF("Failed to find '%s' on pool '%s' (%d)\n",
return (EFI_NOT_FOUND);
}
return (EFI_INVALID_PARAMETER);
}
return (EFI_INVALID_PARAMETER);
}
!= EFI_SUCCESS) {
printf("Failed to allocate load buffer %zd for pool '%s' for '%s' "
return (EFI_INVALID_PARAMETER);
}
err);
return (EFI_INVALID_PARAMETER);
}
return (EFI_SUCCESS);
}
static void
status()
{
return;
}
printf("\n");
}
static void
init()
{
zfs_init();
}
static dev_info_t *
_devices()
{
return (devices);
}
const boot_module_t zfs_module =
{
.name = "ZFS",
};