mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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:
@@ -84,9 +84,23 @@
|
||||
#define htonll(x) BMASK_64(x)
|
||||
#define ntohll(x) BMASK_64(x)
|
||||
#else
|
||||
#ifndef __LP64__
|
||||
static __inline__ uint64_t
|
||||
htonll(uint64_t n)
|
||||
{
|
||||
return ((((uint64_t)htonl(n)) << 32) + htonl(n >> 32));
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
ntohll(uint64_t n)
|
||||
{
|
||||
return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
|
||||
}
|
||||
#else
|
||||
#define htonll(x) BSWAP_64(x)
|
||||
#define ntohll(x) BSWAP_64(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BE_IN32(xa) htonl(*((uint32_t *)(void *)(xa)))
|
||||
|
||||
|
||||
@@ -202,11 +202,14 @@ typedef int enum_t;
|
||||
#define ENODATA EINVAL
|
||||
|
||||
|
||||
#define __XSI_VISIBLE 1000
|
||||
#define __BSD_VISIBLE 1
|
||||
#ifndef IN_BASE
|
||||
#define __POSIX_VISIBLE 201808
|
||||
#define __XSI_VISIBLE 1000
|
||||
#endif
|
||||
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0]))
|
||||
#define open64 open
|
||||
#define mmap64 mmap
|
||||
#define pwrite64 pwrite
|
||||
#define ftruncate64 ftruncate
|
||||
#define lseek64 lseek
|
||||
@@ -257,7 +260,9 @@ typedef int enum_t;
|
||||
|
||||
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
||||
#define RLIM64_INFINITY RLIM_INFINITY
|
||||
#ifndef HAVE_ERESTART
|
||||
#define ERESTART EAGAIN
|
||||
#endif
|
||||
#define ABS(a) ((a) < 0 ? -(a) : (a))
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vmem.h>
|
||||
#include <sys/vmmeter.h>
|
||||
#include <sys/counter.h>
|
||||
|
||||
#include <vm/uma.h>
|
||||
#include <vm/vm.h>
|
||||
|
||||
@@ -29,7 +29,11 @@
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/systm.h>
|
||||
#ifdef __i386__
|
||||
#include <x86/fpu.h>
|
||||
#else
|
||||
#include <machine/fpu.h>
|
||||
#endif
|
||||
#include <x86/x86_var.h>
|
||||
#include <x86/specialreg.h>
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ typedef off_t off64_t;
|
||||
typedef id_t taskid_t;
|
||||
typedef id_t projid_t;
|
||||
typedef id_t poolid_t;
|
||||
typedef id_t zoneid_t;
|
||||
typedef uint_t zoneid_t;
|
||||
typedef id_t ctid_t;
|
||||
typedef mode_t o_mode_t;
|
||||
typedef uint64_t pgcnt_t;
|
||||
|
||||
@@ -49,7 +49,9 @@ enum symfollow { NO_FOLLOW = NOFOLLOW };
|
||||
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vnode_impl.h>
|
||||
#ifndef IN_BASE
|
||||
#include_next <sys/vnode.h>
|
||||
#endif
|
||||
#include <sys/mount.h>
|
||||
#include <sys/cred.h>
|
||||
#include <sys/fcntl.h>
|
||||
@@ -70,11 +72,14 @@ typedef struct vop_vector vnodeops_t;
|
||||
|
||||
#define rootvfs (rootvnode == NULL ? NULL : rootvnode->v_mount)
|
||||
|
||||
|
||||
#ifndef IN_BASE
|
||||
static __inline int
|
||||
vn_is_readonly(vnode_t *vp)
|
||||
{
|
||||
return (vp->v_mount->mnt_flag & MNT_RDONLY);
|
||||
}
|
||||
#endif
|
||||
#define vn_vfswlock(vp) (0)
|
||||
#define vn_vfsunlock(vp) do { } while (0)
|
||||
#define vn_ismntpt(vp) \
|
||||
@@ -166,6 +171,7 @@ vn_is_readonly(vnode_t *vp)
|
||||
#define AT_NOSET (AT_NLINK|AT_RDEV|AT_FSID|AT_NODEID|\
|
||||
AT_BLKSIZE|AT_NBLOCKS|AT_SEQ)
|
||||
|
||||
#ifndef IN_BASE
|
||||
static __inline void
|
||||
vattr_init_mask(vattr_t *vap)
|
||||
{
|
||||
@@ -187,6 +193,7 @@ vattr_init_mask(vattr_t *vap)
|
||||
if (vap->va_flags != VNOVAL)
|
||||
vap->va_mask |= AT_XVATTR;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define RLIM64_INFINITY 0
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ SHA2Init(uint64_t mech, SHA2_CTX *c)
|
||||
SHA512_256_Init(&c->SHA512_ctx);
|
||||
break;
|
||||
default:
|
||||
panic("unknown mechanism %lu", mech);
|
||||
panic("unknown mechanism %ju", (uintmax_t)mech);
|
||||
}
|
||||
c->algotype = (uint32_t)mech;
|
||||
}
|
||||
|
||||
@@ -88,8 +88,4 @@ typedef int fstrans_cookie_t;
|
||||
typedef struct opensolaris_utsname utsname_t;
|
||||
extern utsname_t *utsname(void);
|
||||
extern int spa_import_rootpool(const char *name);
|
||||
#else
|
||||
#if BYTE_ORDER != BIG_ENDIAN
|
||||
#undef _BIG_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user