Remove libefi __linux__ wrappers

The ZoL version of libefi has been modified for Linux in several
places outside the existing __linux__ wrappers.  Remove them to
make the code easier to read and so as not to mislead anyone that
these are the sole modifications for Linux.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7625
This commit is contained in:
Brian Behlendorf 2018-06-14 09:43:32 -07:00 committed by GitHub
parent c91cf36fc2
commit 7e0594a3da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 17 deletions

View File

@ -42,9 +42,7 @@
#include <sys/dktp/fdisk.h> #include <sys/dktp/fdisk.h>
#include <sys/efi_partition.h> #include <sys/efi_partition.h>
#include <sys/byteorder.h> #include <sys/byteorder.h>
#if defined(__linux__)
#include <linux/fs.h> #include <linux/fs.h>
#endif
static struct uuid_to_ptag { static struct uuid_to_ptag {
struct uuid uuid; struct uuid uuid;
@ -213,7 +211,6 @@ read_disk_info(int fd, diskaddr_t *capacity, uint_t *lbsize)
static int static int
efi_get_info(int fd, struct dk_cinfo *dki_info) efi_get_info(int fd, struct dk_cinfo *dki_info)
{ {
#if defined(__linux__)
char *path; char *path;
char *dev_path; char *dev_path;
int rval = 0; int rval = 0;
@ -332,10 +329,7 @@ efi_get_info(int fd, struct dk_cinfo *dki_info)
} }
free(dev_path); free(dev_path);
#else
if (ioctl(fd, DKIOCINFO, (caddr_t)dki_info) == -1)
goto error;
#endif
return (0); return (0);
error: error:
if (efi_debug) if (efi_debug)
@ -375,7 +369,6 @@ efi_alloc_and_init(int fd, uint32_t nparts, struct dk_gpt **vtoc)
if (read_disk_info(fd, &capacity, &lbsize) != 0) if (read_disk_info(fd, &capacity, &lbsize) != 0)
return (-1); return (-1);
#if defined(__linux__)
if (efi_get_info(fd, &dki_info) != 0) if (efi_get_info(fd, &dki_info) != 0)
return (-1); return (-1);
@ -386,7 +379,6 @@ efi_alloc_and_init(int fd, uint32_t nparts, struct dk_gpt **vtoc)
(dki_info.dki_ctype == DKC_VBD) || (dki_info.dki_ctype == DKC_VBD) ||
(dki_info.dki_ctype == DKC_UNKNOWN)) (dki_info.dki_ctype == DKC_UNKNOWN))
return (-1); return (-1);
#endif
nblocks = NBLOCKS(nparts, lbsize); nblocks = NBLOCKS(nparts, lbsize);
if ((nblocks * lbsize) < EFI_MIN_ARRAY_SIZE + lbsize) { if ((nblocks * lbsize) < EFI_MIN_ARRAY_SIZE + lbsize) {
@ -482,7 +474,6 @@ efi_ioctl(int fd, int cmd, dk_efi_t *dk_ioc)
{ {
void *data = dk_ioc->dki_data; void *data = dk_ioc->dki_data;
int error; int error;
#if defined(__linux__)
diskaddr_t capacity; diskaddr_t capacity;
uint_t lbsize; uint_t lbsize;
@ -586,18 +577,13 @@ efi_ioctl(int fd, int cmd, dk_efi_t *dk_ioc)
errno = EIO; errno = EIO;
return (-1); return (-1);
} }
#else
dk_ioc->dki_data_64 = (uint64_t)(uintptr_t)data;
error = ioctl(fd, cmd, (void *)dk_ioc);
dk_ioc->dki_data = data;
#endif
return (error); return (error);
} }
int int
efi_rescan(int fd) efi_rescan(int fd)
{ {
#if defined(__linux__)
int retry = 10; int retry = 10;
int error; int error;
@ -610,7 +596,6 @@ efi_rescan(int fd)
} }
usleep(50000); usleep(50000);
} }
#endif
return (0); return (0);
} }