Changes to make openzfs build within FreeBSD buildworld

A collection of header changes to enable FreeBSD to build
with vendored OpenZFS.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10635
This commit is contained in:
Matthew Macy
2020-07-31 21:30:31 -07:00
committed by GitHub
parent 0cc3454821
commit 47ed79ff60
21 changed files with 79 additions and 29 deletions
+5 -1
View File
@@ -28,8 +28,12 @@
.file "%M%"
#define _ASM
#ifdef __linux__
#include <ia32/sys/asm_linkage.h>
#elif __FreeBSD__
#include <machine/asmacros.h>
#define SET_SIZE(x)
#endif
ENTRY(atomic_inc_8)
ALTENTRY(atomic_inc_uchar)
movl 4(%esp), %eax
@@ -45,8 +45,10 @@
*/
#define MAXNAMELEN 256
#ifndef IN_BASE
#define UID_NOBODY 60001 /* user ID no body */
#define GID_NOBODY UID_NOBODY
#endif
#define UID_NOACCESS 60002 /* user ID no access */
#define MAXUID UINT32_MAX /* max user id */
+5 -2
View File
@@ -40,10 +40,13 @@
#define XDR_GET_BYTES_AVAIL 1
typedef struct xdr_bytesrec {
#ifndef HAVE_XDR_BYTESREC
struct xdr_bytesrec {
bool_t xc_is_last_record;
size_t xc_num_avail;
} xdr_bytesrec_t;
};
#endif
typedef struct xdr_bytesrec xdr_bytesrec_t;
/*
* This functionality is not required and is disabled in user space.
+1 -1
View File
@@ -208,7 +208,7 @@ extern "C" {
#error MIPS no endian specified
#endif
#ifndef _LP64
#if !defined(_LP64) && !defined(_ILP32)
#define _ILP32
#endif
+2 -1
View File
@@ -141,7 +141,8 @@ static inline offset_t
uio_index_at_offset(uio_t *uio, offset_t off, uint_t *vec_idx)
{
*vec_idx = 0;
while (*vec_idx < uio_iovcnt(uio) && off >= uio_iovlen(uio, *vec_idx)) {
while (*vec_idx < (uint_t)uio_iovcnt(uio) &&
off >= (offset_t)uio_iovlen(uio, *vec_idx)) {
off -= uio_iovlen(uio, *vec_idx);
(*vec_idx)++;
}