aboutsummaryrefslogtreecommitdiff
path: root/stand/i386/zfsboot
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-12-02 00:07:37 +0000
committerWarner Losh <imp@FreeBSD.org>2017-12-02 00:07:37 +0000
commit1227a4f4ea7e170248f5136529463e2bea5bda18 (patch)
tree71525a83d9870238a0e3a3e861c81dbba8ac0ce0 /stand/i386/zfsboot
parent0979948fe2d54d0614b76bc4f194536e39f1c538 (diff)
downloadsrc-1227a4f4ea7e170248f5136529463e2bea5bda18.tar.gz
src-1227a4f4ea7e170248f5136529463e2bea5bda18.zip
Fix all warnings related to geli and ZFS support on x86.
Default WARNS to 0 still, since there's still some warnings on other architectures. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13301
Notes
Notes: svn path=/head/; revision=326448
Diffstat (limited to 'stand/i386/zfsboot')
-rw-r--r--stand/i386/zfsboot/zfsboot.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c
index 88b5231efe45..a568f6886b78 100644
--- a/stand/i386/zfsboot/zfsboot.c
+++ b/stand/i386/zfsboot/zfsboot.c
@@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$");
#include <btxv86.h>
+/* Forward declared to avoid warnings -- these shouldn't be needed */
+int strcasecmp(const char *s1, const char *s2);
+void explicit_bzero(void *b, size_t len);
+
#include "lib.h"
#include "rbx.h"
#include "drv.h"
@@ -96,7 +100,6 @@ static int comspeed = SIOSPD;
static struct bootinfo bootinfo;
static uint32_t bootdev;
static struct zfs_boot_args zfsargs;
-static struct zfsmount zfsmount;
vm_offset_t high_heap_base;
uint32_t bios_basemem, bios_extmem, high_heap_size;
@@ -200,7 +203,7 @@ static vdev_t *primary_vdev;
* buffer pointer crosses a 64k boundary.
*/
static int
-vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes)
+vdev_read(void *xvdev, void *priv, off_t off, void *buf, size_t bytes)
{
char *p;
daddr_t lba, alignlba;
@@ -262,6 +265,13 @@ vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes)
return 0;
}
+/* Match the signature exactly due to signature madness */
+static int
+vdev_read2(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes)
+{
+ return vdev_read(vdev, priv, off, buf, bytes);
+}
+
static int
vdev_write(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes)
@@ -557,7 +567,7 @@ probe_drive(struct dsk *dsk)
/*
* If we find a vdev on the whole disk, stop here.
*/
- if (vdev_probe(vdev_read, dsk, NULL) == 0)
+ if (vdev_probe(vdev_read2, dsk, NULL) == 0)
return;
#ifdef LOADER_GELI_SUPPORT
@@ -572,9 +582,9 @@ probe_drive(struct dsk *dsk)
elba--;
}
if (geli_taste(vdev_read, dsk, elba) == 0) {
- if (geli_havekey(dsk) == 0 || geli_passphrase(&gelipw, dsk->unit,
+ if (geli_havekey(dsk) == 0 || geli_passphrase(gelipw, dsk->unit,
':', 0, dsk) == 0) {
- if (vdev_probe(vdev_read, dsk, NULL) == 0) {
+ if (vdev_probe(vdev_read2, dsk, NULL) == 0) {
return;
}
}
@@ -621,7 +631,7 @@ probe_drive(struct dsk *dsk)
dsk->size = ent->ent_lba_end - ent->ent_lba_start + 1;
dsk->slice = part + 1;
dsk->part = 255;
- if (vdev_probe(vdev_read, dsk, NULL) == 0) {
+ if (vdev_probe(vdev_read2, dsk, NULL) == 0) {
/*
* This slice had a vdev. We need a new dsk
* structure now since the vdev now owns this one.
@@ -631,12 +641,12 @@ probe_drive(struct dsk *dsk)
#ifdef LOADER_GELI_SUPPORT
else if (geli_taste(vdev_read, dsk, ent->ent_lba_end -
ent->ent_lba_start) == 0) {
- if (geli_havekey(dsk) == 0 || geli_passphrase(&gelipw,
+ if (geli_havekey(dsk) == 0 || geli_passphrase(gelipw,
dsk->unit, 'p', dsk->slice, dsk) == 0) {
/*
* This slice has GELI, check it for ZFS.
*/
- if (vdev_probe(vdev_read, dsk, NULL) == 0) {
+ if (vdev_probe(vdev_read2, dsk, NULL) == 0) {
/*
* This slice had a vdev. We need a new dsk
* structure now since the vdev now owns this one.
@@ -665,18 +675,18 @@ trymbr:
dsk->start = dp[i].dp_start;
dsk->size = dp[i].dp_size;
dsk->slice = i + 1;
- if (vdev_probe(vdev_read, dsk, NULL) == 0) {
+ if (vdev_probe(vdev_read2, dsk, NULL) == 0) {
dsk = copy_dsk(dsk);
}
#ifdef LOADER_GELI_SUPPORT
else if (geli_taste(vdev_read, dsk, dp[i].dp_size -
dp[i].dp_start) == 0) {
- if (geli_havekey(dsk) == 0 || geli_passphrase(&gelipw, dsk->unit,
+ if (geli_havekey(dsk) == 0 || geli_passphrase(gelipw, dsk->unit,
's', i, dsk) == 0) {
/*
* This slice has GELI, check it for ZFS.
*/
- if (vdev_probe(vdev_read, dsk, NULL) == 0) {
+ if (vdev_probe(vdev_read2, dsk, NULL) == 0) {
/*
* This slice had a vdev. We need a new dsk
* structure now since the vdev now owns this one.