Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146092741
D25477.1779196712.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
185 KB
Referenced Files
None
Subscribers
None
D25477.1779196712.diff
View Options
Index: sys/cddl/compat/opensolaris/kern/opensolaris.c
===================================================================
--- sys/cddl/compat/opensolaris/kern/opensolaris.c
+++ sys/cddl/compat/opensolaris/kern/opensolaris.c
@@ -37,6 +37,8 @@
#include <sys/module.h>
#include <sys/mutex.h>
+extern struct opensolaris_utsname utsname;
+
cpu_core_t cpu_core[MAXCPU];
kmutex_t cpu_lock;
solaris_cpu_t solaris_cpu[MAXCPU];
@@ -82,7 +84,6 @@
switch (type) {
case MOD_LOAD:
- utsname.nodename = prison0.pr_hostname;
break;
case MOD_UNLOAD:
Index: sys/cddl/compat/opensolaris/sys/acl.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/acl.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * Copyright (c) 2008, 2009 Edward Tomasz Napierała <trasz@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * 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$
- */
-
-#ifndef OPENSOLARIS_SYS_ACL_H
-#define OPENSOLARIS_SYS_ACL_H
-
-#include_next <sys/acl.h>
-
-struct acl;
-
-void aces_from_acl(ace_t *aces, int *nentries, const struct acl *aclp);
-int acl_from_aces(struct acl *aclp, const ace_t *aces, int nentries);
-
-#endif /* OPENSOLARIS_SYS_ACL_H */
Index: sys/cddl/compat/opensolaris/sys/file.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/file.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_FILE_H_
-#define _OPENSOLARIS_SYS_FILE_H_
-
-#include_next <sys/file.h>
-
-#define FKIOCTL 0x80000000 /* ioctl addresses are from kernel */
-
-#ifdef _KERNEL
-typedef struct file file_t;
-
-#include <sys/capsicum.h>
-
-static __inline file_t *
-getf(int fd, cap_rights_t *rightsp)
-{
- struct file *fp;
-
- if (fget(curthread, fd, rightsp, &fp) == 0)
- return (fp);
- return (NULL);
-}
-
-static __inline void
-releasef(int fd)
-{
- struct file *fp;
-
- /* No CAP_ rights required, as we're only releasing. */
- if (fget(curthread, fd, &cap_no_rights, &fp) == 0) {
- fdrop(fp, curthread);
- fdrop(fp, curthread);
- }
-}
-#endif /* _KERNEL */
-
-#endif /* !_OPENSOLARIS_SYS_FILE_H_ */
Index: sys/cddl/compat/opensolaris/sys/kobj.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/kobj.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_KOBJ_H_
-#define _OPENSOLARIS_SYS_KOBJ_H_
-
-#include <sys/types.h>
-#include <sys/kmem.h>
-#include_next <sys/kobj.h>
-#ifdef AT_UID
-#undef AT_UID
-#endif
-#ifdef AT_GID
-#undef AT_GID
-#endif
-#include <sys/vnode.h>
-
-#define KM_NOWAIT 0x01
-#define KM_TMP 0x02
-
-void kobj_free(void *address, size_t size);
-void *kobj_alloc(size_t size, int flag);
-void *kobj_zalloc(size_t size, int flag);
-
-struct _buf {
- void *ptr;
- int mounted;
-};
-
-struct _buf *kobj_open_file(const char *path);
-int kobj_get_filesize(struct _buf *file, uint64_t *size);
-int kobj_read_file(struct _buf *file, char *buf, unsigned size, unsigned off);
-void kobj_close_file(struct _buf *file);
-
-#endif /* _OPENSOLARIS_SYS_KOBJ_H_ */
Index: sys/cddl/compat/opensolaris/sys/lock.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/lock.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_LOCK_H_
-#define _OPENSOLARIS_SYS_LOCK_H_
-
-#include_next <sys/lock.h>
-
-#ifdef _KERNEL
-
-#define LO_ALLMASK (LO_INITIALIZED | LO_WITNESS | LO_QUIET | \
- LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE | \
- LO_DUPOK | LO_CLASSMASK | LO_NOPROFILE)
-#define LO_EXPECTED (LO_INITIALIZED | LO_WITNESS | LO_RECURSABLE | \
- LO_SLEEPABLE | LO_UPGRADABLE | LO_DUPOK | \
- /* sx lock class */(2 << LO_CLASSSHIFT))
-
-#endif /* defined(_KERNEL) */
-
-#endif /* _OPENSOLARIS_SYS_LOCK_H_ */
Index: sys/cddl/compat/opensolaris/sys/misc.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/misc.h
+++ sys/cddl/compat/opensolaris/sys/misc.h
@@ -55,7 +55,6 @@
};
extern char hw_serial[11];
-extern struct opensolaris_utsname utsname;
#endif
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
Index: sys/cddl/compat/opensolaris/sys/modctl.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/modctl.h
+++ sys/cddl/compat/opensolaris/sys/modctl.h
@@ -31,6 +31,7 @@
#define _COMPAT_OPENSOLARIS_SYS_MODCTL_H
#include <sys/param.h>
+#include <sys/queue.h>
#include <sys/linker.h>
typedef struct linker_file modctl_t;
Index: sys/cddl/compat/opensolaris/sys/mount.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/mount.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_MOUNT_H_
-#define _OPENSOLARIS_SYS_MOUNT_H_
-
-#include <sys/param.h>
-
-#include_next <sys/mount.h>
-
-#define MS_FORCE MNT_FORCE
-#define MS_REMOUNT MNT_UPDATE
-
-typedef struct fid fid_t;
-
-#endif /* !_OPENSOLARIS_SYS_MOUNT_H_ */
Index: sys/cddl/compat/opensolaris/sys/mutex.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/mutex.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_MUTEX_H_
-#define _OPENSOLARIS_SYS_MUTEX_H_
-
-#ifdef _KERNEL
-
-#include <sys/param.h>
-#include <sys/lock.h>
-#include_next <sys/mutex.h>
-#include <sys/proc.h>
-#include <sys/sx.h>
-
-typedef enum {
- MUTEX_DEFAULT = 6 /* kernel default mutex */
-} kmutex_type_t;
-
-#define MUTEX_HELD(x) (mutex_owned(x))
-#define MUTEX_NOT_HELD(x) (!mutex_owned(x) || KERNEL_PANICKED())
-
-typedef struct sx kmutex_t;
-
-#ifndef OPENSOLARIS_WITNESS
-#define MUTEX_FLAGS (SX_DUPOK | SX_NEW | SX_NOWITNESS)
-#else
-#define MUTEX_FLAGS (SX_DUPOK | SX_NEW)
-#endif
-
-#define mutex_init(lock, desc, type, arg) do { \
- const char *_name; \
- ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \
- KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
- LO_EXPECTED, ("lock %s already initialized", #lock)); \
- for (_name = #lock; *_name != '\0'; _name++) { \
- if (*_name >= 'a' && *_name <= 'z') \
- break; \
- } \
- if (*_name == '\0') \
- _name = #lock; \
- sx_init_flags((lock), _name, MUTEX_FLAGS); \
-} while (0)
-#define mutex_destroy(lock) sx_destroy(lock)
-#define mutex_enter(lock) sx_xlock(lock)
-#define mutex_tryenter(lock) sx_try_xlock(lock)
-#define mutex_exit(lock) sx_xunlock(lock)
-#define mutex_owned(lock) sx_xlocked(lock)
-#define mutex_owner(lock) sx_xholder(lock)
-
-#endif /* _KERNEL */
-
-#endif /* _OPENSOLARIS_SYS_MUTEX_H_ */
Index: sys/cddl/compat/opensolaris/sys/param.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/param.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 John Birrell <jb@freebsd.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY 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 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$
- *
- */
-
-#ifndef _COMPAT_OPENSOLARIS_SYS_PARAM_H_
-#define _COMPAT_OPENSOLARIS_SYS_PARAM_H_
-
-#include_next <sys/param.h>
-
-#define PAGESIZE PAGE_SIZE
-
-#ifdef _KERNEL
-#define ptob(x) ((uint64_t)(x) << PAGE_SHIFT)
-#endif
-
-#endif
Index: sys/cddl/compat/opensolaris/sys/proc.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/proc.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_PROC_H_
-#define _OPENSOLARIS_SYS_PROC_H_
-
-#include <sys/param.h>
-#include <sys/kthread.h>
-#include_next <sys/proc.h>
-#include <sys/stdint.h>
-#include <sys/smp.h>
-#include <sys/sched.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
-#include <sys/unistd.h>
-#include <sys/debug.h>
-
-#ifdef _KERNEL
-
-#define CPU curcpu
-#define minclsyspri PRIBIO
-#define maxclsyspri PVM
-#define max_ncpus (mp_maxid + 1)
-#define boot_max_ncpus (mp_maxid + 1)
-#define syscid 1
-
-#define TS_RUN 0
-
-#define p0 proc0
-
-#define t_did td_tid
-
-typedef short pri_t;
-typedef struct thread _kthread;
-typedef struct thread kthread_t;
-typedef struct thread *kthread_id_t;
-typedef struct proc proc_t;
-
-extern struct proc *system_proc;
-
-static __inline kthread_t *
-do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
- size_t len, proc_t *pp, int state, pri_t pri)
-{
- kthread_t *td = NULL;
- proc_t **ppp;
- int error;
-
- /*
- * Be sure there are no surprises.
- */
- ASSERT(stk == NULL);
- ASSERT(len == 0);
- ASSERT(state == TS_RUN);
- ASSERT(pp != NULL);
-
- if (pp == &p0)
- ppp = &system_proc;
- else
- ppp = &pp;
- error = kproc_kthread_add(proc, arg, ppp, &td, RFSTOPPED,
- stksize / PAGE_SIZE, "zfskern", "solthread %p", proc);
- if (error == 0) {
- thread_lock(td);
- sched_prio(td, pri);
- sched_add(td, SRQ_BORING);
- }
- return (td);
-}
-
-#define thread_create(stk, stksize, proc, arg, len, pp, state, pri) \
- do_thread_create(stk, stksize, proc, arg, len, pp, state, pri)
-#define thread_exit() kthread_exit()
-
-int uread(proc_t *, void *, size_t, uintptr_t);
-int uwrite(proc_t *, void *, size_t, uintptr_t);
-
-#endif /* _KERNEL */
-
-#endif /* _OPENSOLARIS_SYS_PROC_H_ */
Index: sys/cddl/compat/opensolaris/sys/systm.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/systm.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_SYSTM_H_
-#define _OPENSOLARIS_SYS_SYSTM_H_
-
-#ifdef _KERNEL
-
-#include <sys/param.h>
-#include_next <sys/systm.h>
-
-#include <sys/string.h>
-
-#define PAGESIZE PAGE_SIZE
-#define PAGEOFFSET (PAGESIZE - 1)
-#define PAGEMASK (~PAGEOFFSET)
-
-#define delay(x) pause("soldelay", (x))
-
-#endif /* _KERNEL */
-
-#endif /* _OPENSOLARIS_SYS_SYSTM_H_ */
Index: sys/cddl/compat/opensolaris/sys/time.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/time.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_TIME_H_
-#define _OPENSOLARIS_SYS_TIME_H_
-
-#include_next <sys/time.h>
-
-#define SEC 1
-#define MILLISEC 1000
-#define MICROSEC 1000000
-#define NANOSEC 1000000000
-#define TIME_MAX LLONG_MAX
-
-#define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC))
-#define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC))
-
-#define USEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MICROSEC))
-#define NSEC2USEC(n) ((n) / (NANOSEC / MICROSEC))
-
-#define NSEC2SEC(n) ((n) / (NANOSEC / SEC))
-#define SEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC))
-
-typedef longlong_t hrtime_t;
-
-#if defined(__i386__) || defined(__powerpc__)
-#define TIMESPEC_OVERFLOW(ts) \
- ((ts)->tv_sec < INT32_MIN || (ts)->tv_sec > INT32_MAX)
-#else
-#define TIMESPEC_OVERFLOW(ts) \
- ((ts)->tv_sec < INT64_MIN || (ts)->tv_sec > INT64_MAX)
-#endif
-
-#define SEC_TO_TICK(sec) ((sec) * hz)
-#define NSEC_TO_TICK(nsec) ((nsec) / (NANOSEC / hz))
-
-#ifdef _KERNEL
-static __inline hrtime_t
-gethrtime(void) {
-
- struct timespec ts;
- hrtime_t nsec;
-
- getnanouptime(&ts);
- nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec;
- return (nsec);
-}
-
-#define gethrestime_sec() (time_second)
-#define gethrestime(ts) getnanotime(ts)
-#define gethrtime_waitfree() gethrtime()
-
-extern int nsec_per_tick; /* nanoseconds per clock tick */
-
-#define ddi_get_lbolt64() \
- (int64_t)(((getsbinuptime() >> 16) * hz) >> 16)
-#define ddi_get_lbolt() (clock_t)ddi_get_lbolt64()
-
-#else
-
-static __inline hrtime_t gethrtime(void) {
- struct timespec ts;
- clock_gettime(CLOCK_UPTIME,&ts);
- return (((u_int64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
-}
-
-#endif /* _KERNEL */
-
-#endif /* !_OPENSOLARIS_SYS_TIME_H_ */
Index: sys/cddl/compat/opensolaris/sys/types.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/types.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_TYPES_H_
-#define _OPENSOLARIS_SYS_TYPES_H_
-
-/*
- * This is a bag of dirty hacks to keep things compiling.
- */
-
-#include <sys/stdint.h>
-
-#ifdef _KERNEL
-typedef int64_t clock_t;
-#define _CLOCK_T_DECLARED
-#endif
-
-#include_next <sys/types.h>
-
-#define MAXNAMELEN 256
-
-typedef struct timespec timestruc_t;
-typedef struct timespec timespec_t;
-typedef u_int uint_t;
-typedef u_char uchar_t;
-typedef u_short ushort_t;
-typedef u_long ulong_t;
-typedef long long longlong_t;
-typedef unsigned long long u_longlong_t;
-#ifndef _OFF64_T_DECLARED
-#define _OFF64_T_DECLARED
-typedef off_t off64_t;
-#endif
-typedef id_t taskid_t;
-typedef id_t projid_t;
-typedef id_t poolid_t;
-typedef id_t zoneid_t;
-typedef id_t ctid_t;
-typedef mode_t o_mode_t;
-typedef uint64_t pgcnt_t;
-typedef u_int minor_t;
-
-#ifdef _KERNEL
-
-#define B_FALSE 0
-#define B_TRUE 1
-
-typedef short index_t;
-typedef off_t offset_t;
-#ifndef _PTRDIFF_T_DECLARED
-typedef __ptrdiff_t ptrdiff_t; /* pointer difference */
-#define _PTRDIFF_T_DECLARED
-#endif
-typedef int64_t rlim64_t;
-typedef int major_t;
-
-#else
-#ifdef NEED_SOLARIS_BOOLEAN
-#if defined(__XOPEN_OR_POSIX)
-typedef enum { _B_FALSE, _B_TRUE } boolean_t;
-#else
-typedef enum { B_FALSE, B_TRUE } boolean_t;
-#endif /* defined(__XOPEN_OR_POSIX) */
-#endif
-
-typedef longlong_t offset_t;
-typedef u_longlong_t u_offset_t;
-typedef uint64_t upad64_t;
-typedef short pri_t;
-typedef int32_t daddr32_t;
-typedef int32_t time32_t;
-typedef u_longlong_t diskaddr_t;
-
-#endif /* !_KERNEL */
-
-#endif /* !_OPENSOLARIS_SYS_TYPES_H_ */
Index: sys/cddl/compat/opensolaris/sys/uio.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/uio.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_UIO_H_
-#define _OPENSOLARIS_SYS_UIO_H_
-
-#include_next <sys/uio.h>
-#include <sys/debug.h>
-
-#ifndef _KERNEL
-#define FOF_OFFSET 1 /* Use the offset in uio argument */
-
-struct uio {
- struct iovec *uio_iov;
- int uio_iovcnt;
- off_t uio_offset;
- int uio_resid;
- enum uio_seg uio_segflg;
- enum uio_rw uio_rw;
- void *uio_td;
-};
-#endif
-
-#define uio_loffset uio_offset
-
-typedef struct uio uio_t;
-typedef struct iovec iovec_t;
-
-typedef enum xuio_type {
- UIOTYPE_ASYNCIO,
- UIOTYPE_ZEROCOPY
-} xuio_type_t;
-
-typedef struct xuio {
- uio_t xu_uio;
-
- /* Extended uio fields */
- enum xuio_type xu_type; /* What kind of uio structure? */
- union {
- struct {
- int xu_zc_rw;
- void *xu_zc_priv;
- } xu_zc;
- } xu_ext;
-} xuio_t;
-
-#define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv
-#define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw
-
-#ifdef BUILDING_ZFS
-static __inline int
-zfs_uiomove(void *cp, size_t n, enum uio_rw dir, uio_t *uio)
-{
-
- ASSERT(uio->uio_rw == dir);
- return (uiomove(cp, (int)n, uio));
-}
-#define uiomove(cp, n, dir, uio) zfs_uiomove((cp), (n), (dir), (uio))
-
-int uiocopy(void *p, size_t n, enum uio_rw rw, struct uio *uio, size_t *cbytes);
-void uioskip(uio_t *uiop, size_t n);
-#endif /* BUILDING_ZFS */
-
-#endif /* !_OPENSOLARIS_SYS_UIO_H_ */
Index: sys/cddl/compat/opensolaris/sys/vnode.h
===================================================================
--- sys/cddl/compat/opensolaris/sys/vnode.h
+++ /dev/null
@@ -1,287 +0,0 @@
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * 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
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$
- */
-
-#ifndef _OPENSOLARIS_SYS_VNODE_H_
-#define _OPENSOLARIS_SYS_VNODE_H_
-
-#ifdef _KERNEL
-
-struct vnode;
-struct vattr;
-
-typedef struct vnode vnode_t;
-typedef struct vattr vattr_t;
-typedef enum vtype vtype_t;
-
-#include <sys/namei.h>
-enum symfollow { NO_FOLLOW = NOFOLLOW };
-
-#include <sys/proc.h>
-#include_next <sys/vnode.h>
-#include <sys/mount.h>
-#include <sys/cred.h>
-#include <sys/fcntl.h>
-#include <sys/file.h>
-#include <sys/filedesc.h>
-#include <sys/syscallsubr.h>
-
-typedef struct vop_vector vnodeops_t;
-#define VOP_FID VOP_VPTOFH
-#define vop_fid vop_vptofh
-#define vop_fid_args vop_vptofh_args
-#define a_fid a_fhp
-
-#define IS_XATTRDIR(dvp) (0)
-
-#define v_count v_usecount
-
-#define V_APPEND VAPPEND
-
-#define rootvfs (rootvnode == NULL ? NULL : rootvnode->v_mount)
-
-static __inline int
-vn_is_readonly(vnode_t *vp)
-{
- return (vp->v_mount->mnt_flag & MNT_RDONLY);
-}
-#define vn_vfswlock(vp) (0)
-#define vn_vfsunlock(vp) do { } while (0)
-#define vn_ismntpt(vp) ((vp)->v_type == VDIR && (vp)->v_mountedhere != NULL)
-#define vn_mountedvfs(vp) ((vp)->v_mountedhere)
-#define vn_has_cached_data(vp) \
- ((vp)->v_object != NULL && \
- (vp)->v_object->resident_page_count > 0)
-#define vn_exists(vp) do { } while (0)
-#define vn_invalid(vp) do { } while (0)
-#define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0)
-#define vn_free(vp) do { } while (0)
-#define vn_matchops(vp, vops) ((vp)->v_op == &(vops))
-
-#define VN_HOLD(v) vref(v)
-#define VN_RELE(v) vrele(v)
-#define VN_URELE(v) vput(v)
-
-#define vnevent_create(vp, ct) do { } while (0)
-#define vnevent_link(vp, ct) do { } while (0)
-#define vnevent_remove(vp, dvp, name, ct) do { } while (0)
-#define vnevent_rmdir(vp, dvp, name, ct) do { } while (0)
-#define vnevent_rename_src(vp, dvp, name, ct) do { } while (0)
-#define vnevent_rename_dest(vp, dvp, name, ct) do { } while (0)
-#define vnevent_rename_dest_dir(vp, ct) do { } while (0)
-
-#define specvp(vp, rdev, type, cr) (VN_HOLD(vp), (vp))
-#define MANDMODE(mode) (0)
-#define MANDLOCK(vp, mode) (0)
-#define chklock(vp, op, offset, size, mode, ct) (0)
-#define cleanlocks(vp, pid, foo) do { } while (0)
-#define cleanshares(vp, pid) do { } while (0)
-
-/*
- * We will use va_spare is place of Solaris' va_mask.
- * This field is initialized in zfs_setattr().
- */
-#define va_mask va_spare
-/* TODO: va_fileid is shorter than va_nodeid !!! */
-#define va_nodeid va_fileid
-/* TODO: This field needs conversion! */
-#define va_nblocks va_bytes
-#define va_blksize va_blocksize
-#define va_seq va_gen
-
-#define MAXOFFSET_T OFF_MAX
-#define EXCL 0
-
-#define ACCESSED (AT_ATIME)
-#define STATE_CHANGED (AT_CTIME)
-#define CONTENT_MODIFIED (AT_MTIME | AT_CTIME)
-
-static __inline void
-vattr_init_mask(vattr_t *vap)
-{
-
- vap->va_mask = 0;
-
- if (vap->va_type != VNON)
- vap->va_mask |= AT_TYPE;
- if (vap->va_uid != (uid_t)VNOVAL)
- vap->va_mask |= AT_UID;
- if (vap->va_gid != (gid_t)VNOVAL)
- vap->va_mask |= AT_GID;
- if (vap->va_size != (u_quad_t)VNOVAL)
- vap->va_mask |= AT_SIZE;
- if (vap->va_atime.tv_sec != VNOVAL)
- vap->va_mask |= AT_ATIME;
- if (vap->va_mtime.tv_sec != VNOVAL)
- vap->va_mask |= AT_MTIME;
- if (vap->va_mode != (u_short)VNOVAL)
- vap->va_mask |= AT_MODE;
- if (vap->va_flags != VNOVAL)
- vap->va_mask |= AT_XVATTR;
-}
-
-#define FCREAT O_CREAT
-#define FTRUNC O_TRUNC
-#define FEXCL O_EXCL
-#define FDSYNC FFSYNC
-#define FRSYNC FFSYNC
-#define FSYNC FFSYNC
-#define FOFFMAX 0x00
-#define FIGNORECASE 0x00
-
-static __inline int
-vn_openat(char *pnamep, enum uio_seg seg, int filemode, int createmode,
- vnode_t **vpp, enum create crwhy, mode_t umask, struct vnode *startvp,
- int fd)
-{
- struct thread *td = curthread;
- struct nameidata nd;
- int error, operation;
-
- ASSERT(seg == UIO_SYSSPACE);
- if ((filemode & FCREAT) != 0) {
- ASSERT(filemode == (FWRITE | FCREAT | FTRUNC | FOFFMAX));
- ASSERT(crwhy == CRCREAT);
- operation = CREATE;
- } else {
- ASSERT(filemode == (FREAD | FOFFMAX) ||
- filemode == (FREAD | FWRITE | FOFFMAX));
- ASSERT(crwhy == 0);
- operation = LOOKUP;
- }
- ASSERT(umask == 0);
-
- pwd_ensure_dirs();
-
- if (startvp != NULL)
- vref(startvp);
- NDINIT_ATVP(&nd, operation, 0, UIO_SYSSPACE, pnamep, startvp, td);
- filemode |= O_NOFOLLOW;
- error = vn_open_cred(&nd, &filemode, createmode, 0, td->td_ucred, NULL);
- NDFREE(&nd, NDF_ONLY_PNBUF);
- if (error == 0) {
- /* We just unlock so we hold a reference. */
- VOP_UNLOCK(nd.ni_vp);
- *vpp = nd.ni_vp;
- }
- return (error);
-}
-
-static __inline int
-zfs_vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode,
- vnode_t **vpp, enum create crwhy, mode_t umask)
-{
-
- return (vn_openat(pnamep, seg, filemode, createmode, vpp, crwhy,
- umask, NULL, -1));
-}
-#define vn_open(pnamep, seg, filemode, createmode, vpp, crwhy, umask) \
- zfs_vn_open((pnamep), (seg), (filemode), (createmode), (vpp), (crwhy), (umask))
-
-#define RLIM64_INFINITY 0
-static __inline int
-zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, caddr_t base, ssize_t len,
- offset_t offset, enum uio_seg seg, int ioflag, int ulimit, cred_t *cr,
- ssize_t *residp)
-{
- struct thread *td = curthread;
- int error;
- ssize_t resid;
-
- ASSERT(ioflag == 0);
- ASSERT(ulimit == RLIM64_INFINITY);
-
- if (rw == UIO_WRITE) {
- ioflag = IO_SYNC;
- } else {
- ioflag = IO_DIRECT;
- }
- error = vn_rdwr(rw, vp, base, len, offset, seg, ioflag, cr, NOCRED,
- &resid, td);
- if (residp != NULL)
- *residp = (ssize_t)resid;
- return (error);
-}
-#define vn_rdwr(rw, vp, base, len, offset, seg, ioflag, ulimit, cr, residp) \
- zfs_vn_rdwr((rw), (vp), (base), (len), (offset), (seg), (ioflag), (ulimit), (cr), (residp))
-
-static __inline int
-zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
-{
- struct mount *mp;
- int error;
-
- ASSERT(flag == FSYNC);
-
- if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
- goto drop;
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- error = VOP_FSYNC(vp, MNT_WAIT, curthread);
- VOP_UNLOCK(vp);
- vn_finished_write(mp);
-drop:
- return (error);
-}
-#define VOP_FSYNC(vp, flag, cr, ct) zfs_vop_fsync((vp), (flag), (cr))
-
-static __inline int
-zfs_vop_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr)
-{
- int error;
-
- ASSERT(count == 1);
- ASSERT(offset == 0);
-
- error = vn_close(vp, flag, cr, curthread);
- return (error);
-}
-#define VOP_CLOSE(vp, oflags, count, offset, cr, ct) \
- zfs_vop_close((vp), (oflags), (count), (offset), (cr))
-
-static __inline int
-vn_rename(char *from, char *to, enum uio_seg seg)
-{
-
- ASSERT(seg == UIO_SYSSPACE);
-
- return (kern_renameat(curthread, AT_FDCWD, from, AT_FDCWD, to, seg));
-}
-
-static __inline int
-vn_remove(char *fnamep, enum uio_seg seg, enum rm dirflag)
-{
-
- ASSERT(seg == UIO_SYSSPACE);
- ASSERT(dirflag == RMFILE);
-
- return (kern_funlinkat(curthread, AT_FDCWD, fnamep, FD_NONE, seg, 0,
- 0));
-}
-
-#endif /* _KERNEL */
-
-#endif /* _OPENSOLARIS_SYS_VNODE_H_ */
Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
@@ -71,7 +71,6 @@
#include <sys/time.h>
#endif
#include <sys/stat.h>
-#include <sys/modctl.h>
#include <sys/conf.h>
#include <sys/systm.h>
#ifdef illumos
@@ -96,7 +95,6 @@
#include <sys/panic.h>
#include <sys/priv_impl.h>
#endif
-#include <sys/policy.h>
#ifdef illumos
#include <sys/cred_impl.h>
#include <sys/procfs_isa.h>
@@ -119,6 +117,7 @@
#include <sys/limits.h>
#include <sys/linker.h>
#include <sys/kdb.h>
+#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/lock.h>
@@ -129,6 +128,13 @@
#include <sys/sx.h>
#include <sys/sysctl.h>
+
+#include <sys/mount.h>
+#undef AT_UID
+#undef AT_GID
+#include <sys/vnode.h>
+#include <sys/cred.h>
+
#include <sys/dtrace_bsd.h>
#include <netinet/in.h>
@@ -299,8 +305,10 @@
#define ipaddr_t in_addr_t
#define mod_modname pathname
#define vuprintf vprintf
+#ifndef crgetzoneid
+#define crgetzoneid(_a) 0
+#endif
#define ttoproc(_a) ((_a)->td_proc)
-#define crgetzoneid(_a) 0
#define SNOCD 0
#define CPU_ON_INTR(_a) 0
@@ -2780,25 +2788,25 @@
dtrace_speculation(dtrace_state_t *state)
{
int i = 0;
- dtrace_speculation_state_t current;
+ dtrace_speculation_state_t curstate;
uint32_t *stat = &state->dts_speculations_unavail, count;
while (i < state->dts_nspeculations) {
dtrace_speculation_t *spec = &state->dts_speculations[i];
- current = spec->dtsp_state;
+ curstate = spec->dtsp_state;
- if (current != DTRACESPEC_INACTIVE) {
- if (current == DTRACESPEC_COMMITTINGMANY ||
- current == DTRACESPEC_COMMITTING ||
- current == DTRACESPEC_DISCARDING)
+ if (curstate != DTRACESPEC_INACTIVE) {
+ if (curstate == DTRACESPEC_COMMITTINGMANY ||
+ curstate == DTRACESPEC_COMMITTING ||
+ curstate == DTRACESPEC_DISCARDING)
stat = &state->dts_speculations_busy;
i++;
continue;
}
if (dtrace_cas32((uint32_t *)&spec->dtsp_state,
- current, DTRACESPEC_ACTIVE) == current)
+ curstate, DTRACESPEC_ACTIVE) == curstate)
return (i + 1);
}
@@ -2827,7 +2835,7 @@
dtrace_speculation_t *spec;
dtrace_buffer_t *src, *dest;
uintptr_t daddr, saddr, dlimit, slimit;
- dtrace_speculation_state_t current, new = 0;
+ dtrace_speculation_state_t curstate, new = 0;
intptr_t offs;
uint64_t timestamp;
@@ -2844,12 +2852,12 @@
dest = &state->dts_buffer[cpu];
do {
- current = spec->dtsp_state;
+ curstate = spec->dtsp_state;
- if (current == DTRACESPEC_COMMITTINGMANY)
+ if (curstate == DTRACESPEC_COMMITTINGMANY)
break;
- switch (current) {
+ switch (curstate) {
case DTRACESPEC_INACTIVE:
case DTRACESPEC_DISCARDING:
return;
@@ -2891,7 +2899,7 @@
ASSERT(0);
}
} while (dtrace_cas32((uint32_t *)&spec->dtsp_state,
- current, new) != current);
+ curstate, new) != curstate);
/*
* We have set the state to indicate that we are committing this
@@ -2970,8 +2978,8 @@
* If we're lucky enough to be the only active CPU on this speculation
* buffer, we can just set the state back to DTRACESPEC_INACTIVE.
*/
- if (current == DTRACESPEC_ACTIVE ||
- (current == DTRACESPEC_ACTIVEONE && new == DTRACESPEC_COMMITTING)) {
+ if (curstate == DTRACESPEC_ACTIVE ||
+ (curstate == DTRACESPEC_ACTIVEONE && new == DTRACESPEC_COMMITTING)) {
uint32_t rval = dtrace_cas32((uint32_t *)&spec->dtsp_state,
DTRACESPEC_COMMITTING, DTRACESPEC_INACTIVE);
@@ -2994,7 +3002,7 @@
dtrace_specid_t which)
{
dtrace_speculation_t *spec;
- dtrace_speculation_state_t current, new = 0;
+ dtrace_speculation_state_t curstate, new = 0;
dtrace_buffer_t *buf;
if (which == 0)
@@ -3009,9 +3017,9 @@
buf = &spec->dtsp_buffer[cpu];
do {
- current = spec->dtsp_state;
+ curstate = spec->dtsp_state;
- switch (current) {
+ switch (curstate) {
case DTRACESPEC_INACTIVE:
case DTRACESPEC_COMMITTINGMANY:
case DTRACESPEC_COMMITTING:
@@ -3035,7 +3043,7 @@
ASSERT(0);
}
} while (dtrace_cas32((uint32_t *)&spec->dtsp_state,
- current, new) != current);
+ curstate, new) != curstate);
buf->dtb_offset = 0;
buf->dtb_drops = 0;
@@ -3127,19 +3135,19 @@
*/
for (i = 0; i < state->dts_nspeculations; i++) {
dtrace_speculation_t *spec = &state->dts_speculations[i];
- dtrace_speculation_state_t current, new;
+ dtrace_speculation_state_t curstate, new;
if (!spec->dtsp_cleaning)
continue;
- current = spec->dtsp_state;
- ASSERT(current == DTRACESPEC_DISCARDING ||
- current == DTRACESPEC_COMMITTINGMANY);
+ curstate = spec->dtsp_state;
+ ASSERT(curstate == DTRACESPEC_DISCARDING ||
+ curstate == DTRACESPEC_COMMITTINGMANY);
new = DTRACESPEC_INACTIVE;
- rv = dtrace_cas32((uint32_t *)&spec->dtsp_state, current, new);
- ASSERT(rv == current);
+ rv = dtrace_cas32((uint32_t *)&spec->dtsp_state, curstate, new);
+ ASSERT(rv == curstate);
spec->dtsp_cleaning = 0;
}
}
@@ -3156,7 +3164,7 @@
dtrace_specid_t which)
{
dtrace_speculation_t *spec;
- dtrace_speculation_state_t current, new = 0;
+ dtrace_speculation_state_t curstate, new = 0;
dtrace_buffer_t *buf;
if (which == 0)
@@ -3171,9 +3179,9 @@
buf = &spec->dtsp_buffer[cpuid];
do {
- current = spec->dtsp_state;
+ curstate = spec->dtsp_state;
- switch (current) {
+ switch (curstate) {
case DTRACESPEC_INACTIVE:
case DTRACESPEC_COMMITTINGMANY:
case DTRACESPEC_DISCARDING:
@@ -3209,7 +3217,7 @@
ASSERT(0);
}
} while (dtrace_cas32((uint32_t *)&spec->dtsp_state,
- current, new) != current);
+ curstate, new) != curstate);
ASSERT(new == DTRACESPEC_ACTIVEONE || new == DTRACESPEC_ACTIVEMANY);
return (buf);
@@ -7511,12 +7519,12 @@
!state->dts_cred.dcr_destructive ||
dtrace_destructive_disallow) {
void *activity = &state->dts_activity;
- dtrace_activity_t current;
+ dtrace_activity_t curstate;
do {
- current = state->dts_activity;
- } while (dtrace_cas32(activity, current,
- DTRACE_ACTIVITY_KILLED) != current);
+ curstate = state->dts_activity;
+ } while (dtrace_cas32(activity, curstate,
+ DTRACE_ACTIVITY_KILLED) != curstate);
continue;
}
@@ -7851,16 +7859,16 @@
* thread in COOLDOWN, so there is no race.)
*/
void *activity = &state->dts_activity;
- dtrace_activity_t current = state->dts_activity;
+ dtrace_activity_t curstate = state->dts_activity;
- if (current == DTRACE_ACTIVITY_COOLDOWN)
+ if (curstate == DTRACE_ACTIVITY_COOLDOWN)
break;
- if (current != DTRACE_ACTIVITY_WARMUP)
- current = DTRACE_ACTIVITY_ACTIVE;
+ if (curstate != DTRACE_ACTIVITY_WARMUP)
+ curstate = DTRACE_ACTIVITY_ACTIVE;
- if (dtrace_cas32(activity, current,
- DTRACE_ACTIVITY_DRAINING) != current) {
+ if (dtrace_cas32(activity, curstate,
+ DTRACE_ACTIVITY_DRAINING) != curstate) {
*flags |= CPU_DTRACE_DROP;
continue;
}
Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
+++ sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
@@ -35,6 +35,7 @@
#include <sys/atomic.h>
#include <sys/errno.h>
#include <sys/stat.h>
+#include <sys/endian.h>
#include <sys/modctl.h>
#include <sys/conf.h>
#include <sys/systm.h>
@@ -54,6 +55,8 @@
#include <sys/dtrace_impl.h>
#include <sys/sysmacros.h>
#include <sys/proc.h>
+#undef AT_UID
+#undef AT_GID
#include <sys/policy.h>
#ifdef illumos
#include <util/qsort.h>
Index: sys/cddl/contrib/opensolaris/uts/common/sys/acl.h
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/sys/acl.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2014 Garrett D'Amore <garrett@damore.org>
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- * Copyright 2017 RackTop Systems.
- */
-
-#ifndef _SYS_ACL_H
-#define _SYS_ACL_H
-
-#include <sys/types.h>
-#include <sys/acl_impl.h>
-
-#if defined(_KERNEL)
-/*
- * When compiling OpenSolaris kernel code, this file is included instead of the
- * FreeBSD one. Include the original sys/acl.h as well.
- */
-#undef _SYS_ACL_H
-#include_next <sys/acl.h>
-#define _SYS_ACL_H
-#endif /* _KERNEL */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MAX_ACL_ENTRIES (1024) /* max entries of each type */
-typedef struct {
- int a_type; /* the type of ACL entry */
- uid_t a_id; /* the entry in -uid or gid */
- o_mode_t a_perm; /* the permission field */
-} aclent_t;
-
-typedef struct ace {
- uid_t a_who; /* uid or gid */
- uint32_t a_access_mask; /* read,write,... */
- uint16_t a_flags; /* see below */
- uint16_t a_type; /* allow or deny */
-} ace_t;
-
-#ifndef _KERNEL
-typedef struct acl_info acl_t;
-#endif
-
-/*
- * The following are Defined types for an aclent_t.
- */
-#define USER_OBJ (0x01) /* object owner */
-#define USER (0x02) /* additional users */
-#define GROUP_OBJ (0x04) /* owning group of the object */
-#define GROUP (0x08) /* additional groups */
-#define CLASS_OBJ (0x10) /* file group class and mask entry */
-#define OTHER_OBJ (0x20) /* other entry for the object */
-#define ACL_DEFAULT (0x1000) /* default flag */
-/* default object owner */
-#define DEF_USER_OBJ (ACL_DEFAULT | USER_OBJ)
-/* default additional users */
-#define DEF_USER (ACL_DEFAULT | USER)
-/* default owning group */
-#define DEF_GROUP_OBJ (ACL_DEFAULT | GROUP_OBJ)
-/* default additional groups */
-#define DEF_GROUP (ACL_DEFAULT | GROUP)
-/* default mask entry */
-#define DEF_CLASS_OBJ (ACL_DEFAULT | CLASS_OBJ)
-/* default other entry */
-#define DEF_OTHER_OBJ (ACL_DEFAULT | OTHER_OBJ)
-
-/*
- * The following are defined for ace_t.
- */
-#define ACE_READ_DATA 0x00000001
-#define ACE_LIST_DIRECTORY 0x00000001
-#define ACE_WRITE_DATA 0x00000002
-#define ACE_ADD_FILE 0x00000002
-#define ACE_APPEND_DATA 0x00000004
-#define ACE_ADD_SUBDIRECTORY 0x00000004
-#define ACE_READ_NAMED_ATTRS 0x00000008
-#define ACE_WRITE_NAMED_ATTRS 0x00000010
-#define ACE_EXECUTE 0x00000020
-#define ACE_DELETE_CHILD 0x00000040
-#define ACE_READ_ATTRIBUTES 0x00000080
-#define ACE_WRITE_ATTRIBUTES 0x00000100
-#define ACE_DELETE 0x00010000
-#define ACE_READ_ACL 0x00020000
-#define ACE_WRITE_ACL 0x00040000
-#define ACE_WRITE_OWNER 0x00080000
-#define ACE_SYNCHRONIZE 0x00100000
-
-#define ACE_FILE_INHERIT_ACE 0x0001
-#define ACE_DIRECTORY_INHERIT_ACE 0x0002
-#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004
-#define ACE_INHERIT_ONLY_ACE 0x0008
-#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010
-#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020
-#define ACE_IDENTIFIER_GROUP 0x0040
-#define ACE_INHERITED_ACE 0x0080
-#define ACE_OWNER 0x1000
-#define ACE_GROUP 0x2000
-#define ACE_EVERYONE 0x4000
-
-#define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000
-#define ACE_ACCESS_DENIED_ACE_TYPE 0x0001
-#define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002
-#define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003
-
-#define ACL_AUTO_INHERIT 0x0001
-#define ACL_PROTECTED 0x0002
-#define ACL_DEFAULTED 0x0004
-#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \
- ACL_DEFAULTED)
-
-#if defined(_KERNEL) || defined(_FAKE_KERNEL)
-
-/*
- * These are only applicable in a CIFS context.
- */
-#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04
-#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05
-#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06
-#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07
-#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08
-#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09
-#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A
-#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B
-#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C
-#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D
-#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E
-#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F
-#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10
-
-#define ACE_ALL_TYPES 0x001F
-
-typedef struct ace_object {
- uid_t a_who; /* uid or gid */
- uint32_t a_access_mask; /* read,write,... */
- uint16_t a_flags; /* see below */
- uint16_t a_type; /* allow or deny */
- uint8_t a_obj_type[16]; /* obj type */
- uint8_t a_inherit_obj_type[16]; /* inherit obj */
-} ace_object_t;
-
-#endif
-
-#define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
- ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
- ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
- ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \
- ACE_WRITE_OWNER|ACE_SYNCHRONIZE)
-
-#define ACE_ALL_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA| \
- ACE_WRITE_ATTRIBUTES|ACE_WRITE_NAMED_ATTRS|ACE_WRITE_ACL| \
- ACE_WRITE_OWNER|ACE_DELETE|ACE_DELETE_CHILD)
-
-#define ACE_READ_PERMS (ACE_READ_DATA|ACE_READ_ACL|ACE_READ_ATTRIBUTES| \
- ACE_READ_NAMED_ATTRS)
-
-#define ACE_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA|ACE_WRITE_ATTRIBUTES| \
- ACE_WRITE_NAMED_ATTRS)
-
-#define ACE_MODIFY_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
- ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
- ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
- ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_SYNCHRONIZE)
-/*
- * The following flags are supported by both NFSv4 ACLs and ace_t.
- */
-#define ACE_NFSV4_SUP_FLAGS (ACE_FILE_INHERIT_ACE | \
- ACE_DIRECTORY_INHERIT_ACE | \
- ACE_NO_PROPAGATE_INHERIT_ACE | \
- ACE_INHERIT_ONLY_ACE | \
- ACE_INHERITED_ACE | \
- ACE_IDENTIFIER_GROUP)
-
-#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE| \
- ACE_IDENTIFIER_GROUP)
-#define ACE_INHERIT_FLAGS (ACE_FILE_INHERIT_ACE| ACL_INHERITED_ACE| \
- ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|ACE_INHERIT_ONLY_ACE)
-
-/* cmd args to acl(2) for aclent_t */
-#define GETACL 1
-#define SETACL 2
-#define GETACLCNT 3
-
-/* cmd's to manipulate ace acls. */
-#define ACE_GETACL 4
-#define ACE_SETACL 5
-#define ACE_GETACLCNT 6
-
-/* minimal acl entries from GETACLCNT */
-#define MIN_ACL_ENTRIES 4
-
-#if !defined(_KERNEL)
-
-/* acl check errors */
-#define GRP_ERROR 1
-#define USER_ERROR 2
-#define OTHER_ERROR 3
-#define CLASS_ERROR 4
-#define DUPLICATE_ERROR 5
-#define MISS_ERROR 6
-#define MEM_ERROR 7
-#define ENTRY_ERROR 8
-
-
-/*
- * similar to ufs_acl.h: changed to char type for user commands (tar, cpio)
- * Attribute types
- */
-#define UFSD_FREE ('0') /* Free entry */
-#define UFSD_ACL ('1') /* Access Control Lists */
-#define UFSD_DFACL ('2') /* reserved for future use */
-#define ACE_ACL ('3') /* ace_t style acls */
-
-/*
- * flag to [f]acl_get()
- * controls whether a trivial acl should be returned.
- */
-#define ACL_NO_TRIVIAL 0x2
-
-
-/*
- * Flags to control acl_totext()
- */
-
-#define ACL_APPEND_ID 0x1 /* append uid/gid to user/group entries */
-#define ACL_COMPACT_FMT 0x2 /* build ACL in ls -V format */
-#define ACL_NORESOLVE 0x4 /* don't do name service lookups */
-#define ACL_SID_FMT 0x8 /* use usersid/groupsid when appropriate */
-
-/*
- * Legacy aclcheck errors for aclent_t ACLs
- */
-#define EACL_GRP_ERROR GRP_ERROR
-#define EACL_USER_ERROR USER_ERROR
-#define EACL_OTHER_ERROR OTHER_ERROR
-#define EACL_CLASS_ERROR CLASS_ERROR
-#define EACL_DUPLICATE_ERROR DUPLICATE_ERROR
-#define EACL_MISS_ERROR MISS_ERROR
-#define EACL_MEM_ERROR MEM_ERROR
-#define EACL_ENTRY_ERROR ENTRY_ERROR
-
-#define EACL_INHERIT_ERROR 9 /* invalid inherit flags */
-#define EACL_FLAGS_ERROR 10 /* unknown flag value */
-#define EACL_PERM_MASK_ERROR 11 /* unknown permission */
-#define EACL_COUNT_ERROR 12 /* invalid acl count */
-
-#define EACL_INVALID_SLOT 13 /* invalid acl slot */
-#define EACL_NO_ACL_ENTRY 14 /* Entry doesn't exist */
-#define EACL_DIFF_TYPE 15 /* acls aren't same type */
-
-#define EACL_INVALID_USER_GROUP 16 /* need user/group name */
-#define EACL_INVALID_STR 17 /* invalid acl string */
-#define EACL_FIELD_NOT_BLANK 18 /* can't have blank field */
-#define EACL_INVALID_ACCESS_TYPE 19 /* invalid access type */
-#define EACL_UNKNOWN_DATA 20 /* Unrecognized data in ACL */
-#define EACL_MISSING_FIELDS 21 /* missing fields in acl */
-
-#define EACL_INHERIT_NOTDIR 22 /* Need dir for inheritance */
-
-extern int aclcheck(aclent_t *, int, int *);
-extern int acltomode(aclent_t *, int, mode_t *);
-extern int aclfrommode(aclent_t *, int, mode_t *);
-extern int aclsort(int, int, aclent_t *);
-extern char *acltotext(aclent_t *, int);
-extern aclent_t *aclfromtext(char *, int *);
-extern void acl_free(acl_t *);
-extern int acl_get(const char *, int, acl_t **);
-extern int facl_get(int, int, acl_t **);
-extern int acl_set(const char *, acl_t *acl);
-extern int facl_set(int, acl_t *acl);
-extern int acl_strip(const char *, uid_t, gid_t, mode_t);
-extern int acl_trivial(const char *);
-extern char *acl_totext(acl_t *, int);
-extern int acl_fromtext(const char *, acl_t **);
-extern int acl_check(acl_t *, int);
-
-#else /* !defined(_KERNEL) */
-
-extern void ksort(caddr_t, int, int, int (*)(void *, void *));
-extern int cmp2acls(void *, void *);
-
-#endif /* !defined(_KERNEL) */
-
-extern int acl(const char *path, int cmd, int cnt, void *buf);
-extern int facl(int fd, int cmd, int cnt, void *buf);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_ACL_H */
Index: sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h
+++ /dev/null
@@ -1,830 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014 Igor Kozhukhov <ikozhukhov@gmail.com>.
- * Copyright 2017 RackTop Systems.
- */
-
-#ifndef _SYS_CPUVAR_H
-#define _SYS_CPUVAR_H
-
-#include <sys/thread.h>
-#include <sys/sysinfo.h> /* has cpu_stat_t definition */
-#include <sys/disp.h>
-#include <sys/processor.h>
-#include <sys/kcpc.h> /* has kcpc_ctx_t definition */
-
-#include <sys/loadavg.h>
-#if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
-#include <sys/machcpuvar.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/bitmap.h>
-#include <sys/rwlock.h>
-#include <sys/msacct.h>
-#if defined(__GNUC__) && defined(_ASM_INLINES) && defined(_KERNEL) && \
- (defined(__i386) || defined(__amd64))
-#include <asm/cpuvar.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct squeue_set_s;
-
-#define CPU_CACHE_COHERENCE_SIZE 64
-
-/*
- * For fast event tracing.
- */
-struct ftrace_record;
-typedef struct ftrace_data {
- int ftd_state; /* ftrace flags */
- kmutex_t ftd_unused; /* ftrace buffer lock, unused */
- struct ftrace_record *ftd_cur; /* current record */
- struct ftrace_record *ftd_first; /* first record */
- struct ftrace_record *ftd_last; /* last record */
-} ftrace_data_t;
-
-struct cyc_cpu;
-struct nvlist;
-
-/*
- * Per-CPU data.
- *
- * Be careful adding new members: if they are not the same in all modules (e.g.
- * change size depending on a #define), CTF uniquification can fail to work
- * properly. Furthermore, this is transitive in that it applies recursively to
- * all types pointed to by cpu_t.
- */
-typedef struct cpu {
- processorid_t cpu_id; /* CPU number */
- processorid_t cpu_seqid; /* sequential CPU id (0..ncpus-1) */
- volatile cpu_flag_t cpu_flags; /* flags indicating CPU state */
- struct cpu *cpu_self; /* pointer to itself */
- kthread_t *cpu_thread; /* current thread */
- kthread_t *cpu_idle_thread; /* idle thread for this CPU */
- kthread_t *cpu_pause_thread; /* pause thread for this CPU */
- klwp_id_t cpu_lwp; /* current lwp (if any) */
- klwp_id_t cpu_fpowner; /* currently loaded fpu owner */
- struct cpupart *cpu_part; /* partition with this CPU */
- struct lgrp_ld *cpu_lpl; /* pointer to this cpu's load */
- int cpu_cache_offset; /* see kmem.c for details */
-
- /*
- * Links to other CPUs. It is safe to walk these lists if
- * one of the following is true:
- * - cpu_lock held
- * - preemption disabled via kpreempt_disable
- * - PIL >= DISP_LEVEL
- * - acting thread is an interrupt thread
- * - all other CPUs are paused
- */
- struct cpu *cpu_next; /* next existing CPU */
- struct cpu *cpu_prev; /* prev existing CPU */
- struct cpu *cpu_next_onln; /* next online (enabled) CPU */
- struct cpu *cpu_prev_onln; /* prev online (enabled) CPU */
- struct cpu *cpu_next_part; /* next CPU in partition */
- struct cpu *cpu_prev_part; /* prev CPU in partition */
- struct cpu *cpu_next_lgrp; /* next CPU in latency group */
- struct cpu *cpu_prev_lgrp; /* prev CPU in latency group */
- struct cpu *cpu_next_lpl; /* next CPU in lgrp partition */
- struct cpu *cpu_prev_lpl;
-
- struct cpu_pg *cpu_pg; /* cpu's processor groups */
-
- void *cpu_reserved[4]; /* reserved for future use */
-
- /*
- * Scheduling variables.
- */
- disp_t *cpu_disp; /* dispatch queue data */
- /*
- * Note that cpu_disp is set before the CPU is added to the system
- * and is never modified. Hence, no additional locking is needed
- * beyond what's necessary to access the cpu_t structure.
- */
- char cpu_runrun; /* scheduling flag - set to preempt */
- char cpu_kprunrun; /* force kernel preemption */
- pri_t cpu_chosen_level; /* priority at which cpu */
- /* was chosen for scheduling */
- kthread_t *cpu_dispthread; /* thread selected for dispatch */
- disp_lock_t cpu_thread_lock; /* dispatcher lock on current thread */
- uint8_t cpu_disp_flags; /* flags used by dispatcher */
- /*
- * The following field is updated when ever the cpu_dispthread
- * changes. Also in places, where the current thread(cpu_dispthread)
- * priority changes. This is used in disp_lowpri_cpu()
- */
- pri_t cpu_dispatch_pri; /* priority of cpu_dispthread */
- clock_t cpu_last_swtch; /* last time switched to new thread */
-
- /*
- * Interrupt data.
- */
- caddr_t cpu_intr_stack; /* interrupt stack */
- kthread_t *cpu_intr_thread; /* interrupt thread list */
- uint_t cpu_intr_actv; /* interrupt levels active (bitmask) */
- int cpu_base_spl; /* priority for highest rupt active */
-
- /*
- * Statistics.
- */
- cpu_stats_t cpu_stats; /* per-CPU statistics */
- struct kstat *cpu_info_kstat; /* kstat for cpu info */
-
- uintptr_t cpu_profile_pc; /* kernel PC in profile interrupt */
- uintptr_t cpu_profile_upc; /* user PC in profile interrupt */
- uintptr_t cpu_profile_pil; /* PIL when profile interrupted */
-
- ftrace_data_t cpu_ftrace; /* per cpu ftrace data */
-
- clock_t cpu_deadman_counter; /* used by deadman() */
- uint_t cpu_deadman_countdown; /* used by deadman() */
-
- kmutex_t cpu_cpc_ctxlock; /* protects context for idle thread */
- kcpc_ctx_t *cpu_cpc_ctx; /* performance counter context */
-
- /*
- * Configuration information for the processor_info system call.
- */
- processor_info_t cpu_type_info; /* config info */
- time_t cpu_state_begin; /* when CPU entered current state */
- char cpu_cpr_flags; /* CPR related info */
- struct cyc_cpu *cpu_cyclic; /* per cpu cyclic subsystem data */
- struct squeue_set_s *cpu_squeue_set; /* per cpu squeue set */
- struct nvlist *cpu_props; /* pool-related properties */
-
- krwlock_t cpu_ft_lock; /* DTrace: fasttrap lock */
- uintptr_t cpu_dtrace_caller; /* DTrace: caller, if any */
- hrtime_t cpu_dtrace_chillmark; /* DTrace: chill mark time */
- hrtime_t cpu_dtrace_chilled; /* DTrace: total chill time */
- volatile uint16_t cpu_mstate; /* cpu microstate */
- volatile uint16_t cpu_mstate_gen; /* generation counter */
- volatile hrtime_t cpu_mstate_start; /* cpu microstate start time */
- volatile hrtime_t cpu_acct[NCMSTATES]; /* cpu microstate data */
- hrtime_t cpu_intracct[NCMSTATES]; /* interrupt mstate data */
- hrtime_t cpu_waitrq; /* cpu run-queue wait time */
- struct loadavg_s cpu_loadavg; /* loadavg info for this cpu */
-
- char *cpu_idstr; /* for printing and debugging */
- char *cpu_brandstr; /* for printing */
-
- /*
- * Sum of all device interrupt weights that are currently directed at
- * this cpu. Cleared at start of interrupt redistribution.
- */
- int32_t cpu_intr_weight;
- void *cpu_vm_data;
-
- struct cpu_physid *cpu_physid; /* physical associations */
-
- uint64_t cpu_curr_clock; /* current clock freq in Hz */
- char *cpu_supp_freqs; /* supported freqs in Hz */
-
- uintptr_t cpu_cpcprofile_pc; /* kernel PC in cpc interrupt */
- uintptr_t cpu_cpcprofile_upc; /* user PC in cpc interrupt */
-
- /*
- * Interrupt load factor used by dispatcher & softcall
- */
- hrtime_t cpu_intrlast; /* total interrupt time (nsec) */
- int cpu_intrload; /* interrupt load factor (0-99%) */
-
- uint_t cpu_rotor; /* for cheap pseudo-random numbers */
-
- struct cu_cpu_info *cpu_cu_info; /* capacity & util. info */
-
- /*
- * cpu_generation is updated whenever CPU goes on-line or off-line.
- * Updates to cpu_generation are protected by cpu_lock.
- *
- * See CPU_NEW_GENERATION() macro below.
- */
- volatile uint_t cpu_generation; /* tracking on/off-line */
-
- /*
- * New members must be added /before/ this member, as the CTF tools
- * rely on this being the last field before cpu_m, so they can
- * correctly calculate the offset when synthetically adding the cpu_m
- * member in objects that do not have it. This fixup is required for
- * uniquification to work correctly.
- */
- uintptr_t cpu_m_pad;
-
-#if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
- struct machcpu cpu_m; /* per architecture info */
-#endif
-} cpu_t;
-
-/*
- * The cpu_core structure consists of per-CPU state available in any context.
- * On some architectures, this may mean that the page(s) containing the
- * NCPU-sized array of cpu_core structures must be locked in the TLB -- it
- * is up to the platform to assure that this is performed properly. Note that
- * the structure is sized to avoid false sharing.
- */
-#define CPUC_SIZE (sizeof (uint16_t) + sizeof (uint8_t) + \
- sizeof (uintptr_t) + sizeof (kmutex_t))
-#define CPUC_PADSIZE CPU_CACHE_COHERENCE_SIZE - CPUC_SIZE
-
-typedef struct cpu_core {
- uint16_t cpuc_dtrace_flags; /* DTrace flags */
- uint8_t cpuc_dcpc_intr_state; /* DCPC provider intr state */
- uint8_t cpuc_pad[CPUC_PADSIZE]; /* padding */
- uintptr_t cpuc_dtrace_illval; /* DTrace illegal value */
- kmutex_t cpuc_pid_lock; /* DTrace pid provider lock */
-} cpu_core_t;
-
-#ifdef _KERNEL
-extern cpu_core_t cpu_core[];
-#endif /* _KERNEL */
-
-/*
- * CPU_ON_INTR() macro. Returns non-zero if currently on interrupt stack.
- * Note that this isn't a test for a high PIL. For example, cpu_intr_actv
- * does not get updated when we go through sys_trap from TL>0 at high PIL.
- * getpil() should be used instead to check for PIL levels.
- */
-#define CPU_ON_INTR(cpup) ((cpup)->cpu_intr_actv >> (LOCK_LEVEL + 1))
-
-/*
- * Check to see if an interrupt thread might be active at a given ipl.
- * If so return true.
- * We must be conservative--it is ok to give a false yes, but a false no
- * will cause disaster. (But if the situation changes after we check it is
- * ok--the caller is trying to ensure that an interrupt routine has been
- * exited).
- * This is used when trying to remove an interrupt handler from an autovector
- * list in avintr.c.
- */
-#define INTR_ACTIVE(cpup, level) \
- ((level) <= LOCK_LEVEL ? \
- ((cpup)->cpu_intr_actv & (1 << (level))) : (CPU_ON_INTR(cpup)))
-
-/*
- * CPU_PSEUDO_RANDOM() returns a per CPU value that changes each time one
- * looks at it. It's meant as a cheap mechanism to be incorporated in routines
- * wanting to avoid biasing, but where true randomness isn't needed (just
- * something that changes).
- */
-#define CPU_PSEUDO_RANDOM() (CPU->cpu_rotor++)
-
-#if defined(_KERNEL) || defined(_KMEMUSER)
-
-#define INTR_STACK_SIZE MAX(DEFAULTSTKSZ, PAGESIZE)
-
-/* MEMBERS PROTECTED BY "atomicity": cpu_flags */
-
-/*
- * Flags in the CPU structure.
- *
- * These are protected by cpu_lock (except during creation).
- *
- * Offlined-CPUs have three stages of being offline:
- *
- * CPU_ENABLE indicates that the CPU is participating in I/O interrupts
- * that can be directed at a number of different CPUs. If CPU_ENABLE
- * is off, the CPU will not be given interrupts that can be sent elsewhere,
- * but will still get interrupts from devices associated with that CPU only,
- * and from other CPUs.
- *
- * CPU_OFFLINE indicates that the dispatcher should not allow any threads
- * other than interrupt threads to run on that CPU. A CPU will not have
- * CPU_OFFLINE set if there are any bound threads (besides interrupts).
- *
- * CPU_QUIESCED is set if p_offline was able to completely turn idle the
- * CPU and it will not have to run interrupt threads. In this case it'll
- * stay in the idle loop until CPU_QUIESCED is turned off.
- *
- * CPU_FROZEN is used only by CPR to mark CPUs that have been successfully
- * suspended (in the suspend path), or have yet to be resumed (in the resume
- * case).
- *
- * On some platforms CPUs can be individually powered off.
- * The following flags are set for powered off CPUs: CPU_QUIESCED,
- * CPU_OFFLINE, and CPU_POWEROFF. The following flags are cleared:
- * CPU_RUNNING, CPU_READY, CPU_EXISTS, and CPU_ENABLE.
- */
-#define CPU_RUNNING 0x001 /* CPU running */
-#define CPU_READY 0x002 /* CPU ready for cross-calls */
-#define CPU_QUIESCED 0x004 /* CPU will stay in idle */
-#define CPU_EXISTS 0x008 /* CPU is configured */
-#define CPU_ENABLE 0x010 /* CPU enabled for interrupts */
-#define CPU_OFFLINE 0x020 /* CPU offline via p_online */
-#define CPU_POWEROFF 0x040 /* CPU is powered off */
-#define CPU_FROZEN 0x080 /* CPU is frozen via CPR suspend */
-#define CPU_SPARE 0x100 /* CPU offline available for use */
-#define CPU_FAULTED 0x200 /* CPU offline diagnosed faulty */
-
-#define FMT_CPU_FLAGS \
- "\20\12fault\11spare\10frozen" \
- "\7poweroff\6offline\5enable\4exist\3quiesced\2ready\1run"
-
-#define CPU_ACTIVE(cpu) (((cpu)->cpu_flags & CPU_OFFLINE) == 0)
-
-/*
- * Flags for cpu_offline(), cpu_faulted(), and cpu_spare().
- */
-#define CPU_FORCED 0x0001 /* Force CPU offline */
-
-/*
- * DTrace flags.
- */
-#define CPU_DTRACE_NOFAULT 0x0001 /* Don't fault */
-#define CPU_DTRACE_DROP 0x0002 /* Drop this ECB */
-#define CPU_DTRACE_BADADDR 0x0004 /* DTrace fault: bad address */
-#define CPU_DTRACE_BADALIGN 0x0008 /* DTrace fault: bad alignment */
-#define CPU_DTRACE_DIVZERO 0x0010 /* DTrace fault: divide by zero */
-#define CPU_DTRACE_ILLOP 0x0020 /* DTrace fault: illegal operation */
-#define CPU_DTRACE_NOSCRATCH 0x0040 /* DTrace fault: out of scratch */
-#define CPU_DTRACE_KPRIV 0x0080 /* DTrace fault: bad kernel access */
-#define CPU_DTRACE_UPRIV 0x0100 /* DTrace fault: bad user access */
-#define CPU_DTRACE_TUPOFLOW 0x0200 /* DTrace fault: tuple stack overflow */
-#if defined(__sparc)
-#define CPU_DTRACE_FAKERESTORE 0x0400 /* pid provider hint to getreg */
-#endif
-#define CPU_DTRACE_ENTRY 0x0800 /* pid provider hint to ustack() */
-#define CPU_DTRACE_BADSTACK 0x1000 /* DTrace fault: bad stack */
-
-#define CPU_DTRACE_FAULT (CPU_DTRACE_BADADDR | CPU_DTRACE_BADALIGN | \
- CPU_DTRACE_DIVZERO | CPU_DTRACE_ILLOP | \
- CPU_DTRACE_NOSCRATCH | CPU_DTRACE_KPRIV | \
- CPU_DTRACE_UPRIV | CPU_DTRACE_TUPOFLOW | \
- CPU_DTRACE_BADSTACK)
-#define CPU_DTRACE_ERROR (CPU_DTRACE_FAULT | CPU_DTRACE_DROP)
-
-/*
- * Dispatcher flags
- * These flags must be changed only by the current CPU.
- */
-#define CPU_DISP_DONTSTEAL 0x01 /* CPU undergoing context swtch */
-#define CPU_DISP_HALTED 0x02 /* CPU halted waiting for interrupt */
-
-#endif /* _KERNEL || _KMEMUSER */
-
-#if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
-
-/*
- * Macros for manipulating sets of CPUs as a bitmap. Note that this
- * bitmap may vary in size depending on the maximum CPU id a specific
- * platform supports. This may be different than the number of CPUs
- * the platform supports, since CPU ids can be sparse. We define two
- * sets of macros; one for platforms where the maximum CPU id is less
- * than the number of bits in a single word (32 in a 32-bit kernel,
- * 64 in a 64-bit kernel), and one for platforms that require bitmaps
- * of more than one word.
- */
-
-#define CPUSET_WORDS BT_BITOUL(NCPU)
-#define CPUSET_NOTINSET ((uint_t)-1)
-
-#if CPUSET_WORDS > 1
-
-typedef struct cpuset {
- ulong_t cpub[CPUSET_WORDS];
-} cpuset_t;
-
-/*
- * Private functions for manipulating cpusets that do not fit in a
- * single word. These should not be used directly; instead the
- * CPUSET_* macros should be used so the code will be portable
- * across different definitions of NCPU.
- */
-extern void cpuset_all(cpuset_t *);
-extern void cpuset_all_but(cpuset_t *, uint_t);
-extern int cpuset_isnull(cpuset_t *);
-extern int cpuset_cmp(cpuset_t *, cpuset_t *);
-extern void cpuset_only(cpuset_t *, uint_t);
-extern uint_t cpuset_find(cpuset_t *);
-extern void cpuset_bounds(cpuset_t *, uint_t *, uint_t *);
-
-#define CPUSET_ALL(set) cpuset_all(&(set))
-#define CPUSET_ALL_BUT(set, cpu) cpuset_all_but(&(set), cpu)
-#define CPUSET_ONLY(set, cpu) cpuset_only(&(set), cpu)
-#define CPU_IN_SET(set, cpu) BT_TEST((set).cpub, cpu)
-#define CPUSET_ADD(set, cpu) BT_SET((set).cpub, cpu)
-#define CPUSET_DEL(set, cpu) BT_CLEAR((set).cpub, cpu)
-#define CPUSET_ISNULL(set) cpuset_isnull(&(set))
-#define CPUSET_ISEQUAL(set1, set2) cpuset_cmp(&(set1), &(set2))
-
-/*
- * Find one CPU in the cpuset.
- * Sets "cpu" to the id of the found CPU, or CPUSET_NOTINSET if no cpu
- * could be found. (i.e. empty set)
- */
-#define CPUSET_FIND(set, cpu) { \
- cpu = cpuset_find(&(set)); \
-}
-
-/*
- * Determine the smallest and largest CPU id in the set. Returns
- * CPUSET_NOTINSET in smallest and largest when set is empty.
- */
-#define CPUSET_BOUNDS(set, smallest, largest) { \
- cpuset_bounds(&(set), &(smallest), &(largest)); \
-}
-
-/*
- * Atomic cpuset operations
- * These are safe to use for concurrent cpuset manipulations.
- * "xdel" and "xadd" are exclusive operations, that set "result" to "0"
- * if the add or del was successful, or "-1" if not successful.
- * (e.g. attempting to add a cpu to a cpuset that's already there, or
- * deleting a cpu that's not in the cpuset)
- */
-
-#define CPUSET_ATOMIC_DEL(set, cpu) BT_ATOMIC_CLEAR((set).cpub, (cpu))
-#define CPUSET_ATOMIC_ADD(set, cpu) BT_ATOMIC_SET((set).cpub, (cpu))
-
-#define CPUSET_ATOMIC_XADD(set, cpu, result) \
- BT_ATOMIC_SET_EXCL((set).cpub, cpu, result)
-
-#define CPUSET_ATOMIC_XDEL(set, cpu, result) \
- BT_ATOMIC_CLEAR_EXCL((set).cpub, cpu, result)
-
-
-#define CPUSET_OR(set1, set2) { \
- int _i; \
- for (_i = 0; _i < CPUSET_WORDS; _i++) \
- (set1).cpub[_i] |= (set2).cpub[_i]; \
-}
-
-#define CPUSET_XOR(set1, set2) { \
- int _i; \
- for (_i = 0; _i < CPUSET_WORDS; _i++) \
- (set1).cpub[_i] ^= (set2).cpub[_i]; \
-}
-
-#define CPUSET_AND(set1, set2) { \
- int _i; \
- for (_i = 0; _i < CPUSET_WORDS; _i++) \
- (set1).cpub[_i] &= (set2).cpub[_i]; \
-}
-
-#define CPUSET_ZERO(set) { \
- int _i; \
- for (_i = 0; _i < CPUSET_WORDS; _i++) \
- (set).cpub[_i] = 0; \
-}
-
-#elif CPUSET_WORDS == 1
-
-typedef ulong_t cpuset_t; /* a set of CPUs */
-
-#define CPUSET(cpu) (1UL << (cpu))
-
-#define CPUSET_ALL(set) ((void)((set) = ~0UL))
-#define CPUSET_ALL_BUT(set, cpu) ((void)((set) = ~CPUSET(cpu)))
-#define CPUSET_ONLY(set, cpu) ((void)((set) = CPUSET(cpu)))
-#define CPU_IN_SET(set, cpu) ((set) & CPUSET(cpu))
-#define CPUSET_ADD(set, cpu) ((void)((set) |= CPUSET(cpu)))
-#define CPUSET_DEL(set, cpu) ((void)((set) &= ~CPUSET(cpu)))
-#define CPUSET_ISNULL(set) ((set) == 0)
-#define CPUSET_ISEQUAL(set1, set2) ((set1) == (set2))
-#define CPUSET_OR(set1, set2) ((void)((set1) |= (set2)))
-#define CPUSET_XOR(set1, set2) ((void)((set1) ^= (set2)))
-#define CPUSET_AND(set1, set2) ((void)((set1) &= (set2)))
-#define CPUSET_ZERO(set) ((void)((set) = 0))
-
-#define CPUSET_FIND(set, cpu) { \
- cpu = (uint_t)(lowbit(set) - 1); \
-}
-
-#define CPUSET_BOUNDS(set, smallest, largest) { \
- smallest = (uint_t)(lowbit(set) - 1); \
- largest = (uint_t)(highbit(set) - 1); \
-}
-
-#define CPUSET_ATOMIC_DEL(set, cpu) atomic_and_ulong(&(set), ~CPUSET(cpu))
-#define CPUSET_ATOMIC_ADD(set, cpu) atomic_or_ulong(&(set), CPUSET(cpu))
-
-#define CPUSET_ATOMIC_XADD(set, cpu, result) \
- { result = atomic_set_long_excl(&(set), (cpu)); }
-
-#define CPUSET_ATOMIC_XDEL(set, cpu, result) \
- { result = atomic_clear_long_excl(&(set), (cpu)); }
-
-#else /* CPUSET_WORDS <= 0 */
-
-#error NCPU is undefined or invalid
-
-#endif /* CPUSET_WORDS */
-
-extern cpuset_t cpu_seqid_inuse;
-
-#endif /* (_KERNEL || _KMEMUSER) && _MACHDEP */
-
-#define CPU_CPR_OFFLINE 0x0
-#define CPU_CPR_ONLINE 0x1
-#define CPU_CPR_IS_OFFLINE(cpu) (((cpu)->cpu_cpr_flags & CPU_CPR_ONLINE) == 0)
-#define CPU_CPR_IS_ONLINE(cpu) ((cpu)->cpu_cpr_flags & CPU_CPR_ONLINE)
-#define CPU_SET_CPR_FLAGS(cpu, flag) ((cpu)->cpu_cpr_flags |= flag)
-
-#if defined(_KERNEL) || defined(_KMEMUSER)
-
-extern struct cpu *cpu[]; /* indexed by CPU number */
-extern struct cpu **cpu_seq; /* indexed by sequential CPU id */
-extern cpu_t *cpu_list; /* list of CPUs */
-extern cpu_t *cpu_active; /* list of active CPUs */
-extern int ncpus; /* number of CPUs present */
-extern int ncpus_online; /* number of CPUs not quiesced */
-extern int max_ncpus; /* max present before ncpus is known */
-extern int boot_max_ncpus; /* like max_ncpus but for real */
-extern int boot_ncpus; /* # cpus present @ boot */
-extern processorid_t max_cpuid; /* maximum CPU number */
-extern struct cpu *cpu_inmotion; /* offline or partition move target */
-extern cpu_t *clock_cpu_list;
-extern processorid_t max_cpu_seqid_ever; /* maximum seqid ever given */
-
-#if defined(__i386) || defined(__amd64)
-extern struct cpu *curcpup(void);
-#define CPU (curcpup()) /* Pointer to current CPU */
-#else
-#define CPU (curthread->t_cpu) /* Pointer to current CPU */
-#endif
-
-/*
- * CPU_CURRENT indicates to thread_affinity_set to use CPU->cpu_id
- * as the target and to grab cpu_lock instead of requiring the caller
- * to grab it.
- */
-#define CPU_CURRENT -3
-
-/*
- * Per-CPU statistics
- *
- * cpu_stats_t contains numerous system and VM-related statistics, in the form
- * of gauges or monotonically-increasing event occurrence counts.
- */
-
-#define CPU_STATS_ENTER_K() kpreempt_disable()
-#define CPU_STATS_EXIT_K() kpreempt_enable()
-
-#define CPU_STATS_ADD_K(class, stat, amount) \
- { kpreempt_disable(); /* keep from switching CPUs */\
- CPU_STATS_ADDQ(CPU, class, stat, amount); \
- kpreempt_enable(); \
- }
-
-#define CPU_STATS_ADDQ(cp, class, stat, amount) { \
- extern void __dtrace_probe___cpu_##class##info_##stat(uint_t, \
- uint64_t *, cpu_t *); \
- uint64_t *stataddr = &((cp)->cpu_stats.class.stat); \
- __dtrace_probe___cpu_##class##info_##stat((amount), \
- stataddr, cp); \
- *(stataddr) += (amount); \
-}
-
-#define CPU_STATS(cp, stat) \
- ((cp)->cpu_stats.stat)
-
-/*
- * Increment CPU generation value.
- * This macro should be called whenever CPU goes on-line or off-line.
- * Updates to cpu_generation should be protected by cpu_lock.
- */
-#define CPU_NEW_GENERATION(cp) ((cp)->cpu_generation++)
-
-#endif /* _KERNEL || _KMEMUSER */
-
-/*
- * CPU support routines (not for genassym.c)
- */
-#if (defined(_KERNEL) || defined(_FAKE_KERNEL)) && defined(__STDC__)
-
-struct zone;
-
-void cpu_list_init(cpu_t *);
-void cpu_add_unit(cpu_t *);
-void cpu_del_unit(int cpuid);
-void cpu_add_active(cpu_t *);
-void cpu_kstat_init(cpu_t *);
-void cpu_visibility_add(cpu_t *, struct zone *);
-void cpu_visibility_remove(cpu_t *, struct zone *);
-void cpu_visibility_configure(cpu_t *, struct zone *);
-void cpu_visibility_unconfigure(cpu_t *, struct zone *);
-void cpu_visibility_online(cpu_t *, struct zone *);
-void cpu_visibility_offline(cpu_t *, struct zone *);
-void cpu_create_intrstat(cpu_t *);
-void cpu_delete_intrstat(cpu_t *);
-int cpu_kstat_intrstat_update(kstat_t *, int);
-void cpu_intr_swtch_enter(kthread_t *);
-void cpu_intr_swtch_exit(kthread_t *);
-
-void mbox_lock_init(void); /* initialize cross-call locks */
-void mbox_init(int cpun); /* initialize cross-calls */
-void poke_cpu(int cpun); /* interrupt another CPU (to preempt) */
-
-/*
- * values for safe_list. Pause state that CPUs are in.
- */
-#define PAUSE_IDLE 0 /* normal state */
-#define PAUSE_READY 1 /* paused thread ready to spl */
-#define PAUSE_WAIT 2 /* paused thread is spl-ed high */
-#define PAUSE_DIE 3 /* tell pause thread to leave */
-#define PAUSE_DEAD 4 /* pause thread has left */
-
-void mach_cpu_pause(volatile char *);
-
-void pause_cpus(cpu_t *off_cp, void *(*func)(void *));
-void start_cpus(void);
-int cpus_paused(void);
-
-void cpu_pause_init(void);
-cpu_t *cpu_get(processorid_t cpun); /* get the CPU struct associated */
-
-int cpu_online(cpu_t *cp); /* take cpu online */
-int cpu_offline(cpu_t *cp, int flags); /* take cpu offline */
-int cpu_spare(cpu_t *cp, int flags); /* take cpu to spare */
-int cpu_faulted(cpu_t *cp, int flags); /* take cpu to faulted */
-int cpu_poweron(cpu_t *cp); /* take powered-off cpu to offline */
-int cpu_poweroff(cpu_t *cp); /* take offline cpu to powered-off */
-
-cpu_t *cpu_intr_next(cpu_t *cp); /* get next online CPU taking intrs */
-int cpu_intr_count(cpu_t *cp); /* count # of CPUs handling intrs */
-int cpu_intr_on(cpu_t *cp); /* CPU taking I/O interrupts? */
-void cpu_intr_enable(cpu_t *cp); /* enable I/O interrupts */
-int cpu_intr_disable(cpu_t *cp); /* disable I/O interrupts */
-void cpu_intr_alloc(cpu_t *cp, int n); /* allocate interrupt threads */
-
-/*
- * Routines for checking CPU states.
- */
-int cpu_is_online(cpu_t *); /* check if CPU is online */
-int cpu_is_nointr(cpu_t *); /* check if CPU can service intrs */
-int cpu_is_active(cpu_t *); /* check if CPU can run threads */
-int cpu_is_offline(cpu_t *); /* check if CPU is offline */
-int cpu_is_poweredoff(cpu_t *); /* check if CPU is powered off */
-
-int cpu_flagged_online(cpu_flag_t); /* flags show CPU is online */
-int cpu_flagged_nointr(cpu_flag_t); /* flags show CPU not handling intrs */
-int cpu_flagged_active(cpu_flag_t); /* flags show CPU scheduling threads */
-int cpu_flagged_offline(cpu_flag_t); /* flags show CPU is offline */
-int cpu_flagged_poweredoff(cpu_flag_t); /* flags show CPU is powered off */
-
-/*
- * The processor_info(2) state of a CPU is a simplified representation suitable
- * for use by an application program. Kernel subsystems should utilize the
- * internal per-CPU state as given by the cpu_flags member of the cpu structure,
- * as this information may include platform- or architecture-specific state
- * critical to a subsystem's disposition of a particular CPU.
- */
-void cpu_set_state(cpu_t *); /* record/timestamp current state */
-int cpu_get_state(cpu_t *); /* get current cpu state */
-const char *cpu_get_state_str(cpu_t *); /* get current cpu state as string */
-
-
-void cpu_set_curr_clock(uint64_t); /* indicate the current CPU's freq */
-void cpu_set_supp_freqs(cpu_t *, const char *); /* set the CPU supported */
- /* frequencies */
-
-int cpu_configure(int);
-int cpu_unconfigure(int);
-void cpu_destroy_bound_threads(cpu_t *cp);
-
-extern int cpu_bind_thread(kthread_t *tp, processorid_t bind,
- processorid_t *obind, int *error);
-extern int cpu_unbind(processorid_t cpu_id, boolean_t force);
-extern void thread_affinity_set(kthread_t *t, int cpu_id);
-extern void thread_affinity_clear(kthread_t *t);
-extern void affinity_set(int cpu_id);
-extern void affinity_clear(void);
-extern void init_cpu_mstate(struct cpu *, int);
-extern void term_cpu_mstate(struct cpu *);
-extern void new_cpu_mstate(int, hrtime_t);
-extern void get_cpu_mstate(struct cpu *, hrtime_t *);
-extern void thread_nomigrate(void);
-extern void thread_allowmigrate(void);
-extern void weakbinding_stop(void);
-extern void weakbinding_start(void);
-
-/*
- * The following routines affect the CPUs participation in interrupt processing,
- * if that is applicable on the architecture. This only affects interrupts
- * which aren't directed at the processor (not cross calls).
- *
- * cpu_disable_intr returns non-zero if interrupts were previously enabled.
- */
-int cpu_disable_intr(struct cpu *cp); /* stop issuing interrupts to cpu */
-void cpu_enable_intr(struct cpu *cp); /* start issuing interrupts to cpu */
-
-/*
- * The mutex cpu_lock protects cpu_flags for all CPUs, as well as the ncpus
- * and ncpus_online counts.
- */
-extern kmutex_t cpu_lock; /* lock protecting CPU data */
-
-/*
- * CPU state change events
- *
- * Various subsystems need to know when CPUs change their state. They get this
- * information by registering CPU state change callbacks using
- * register_cpu_setup_func(). Whenever any CPU changes its state, the callback
- * function is called. The callback function is passed three arguments:
- *
- * Event, described by cpu_setup_t
- * CPU ID
- * Transparent pointer passed when registering the callback
- *
- * The callback function is called with cpu_lock held. The return value from the
- * callback function is usually ignored, except for CPU_CONFIG and CPU_UNCONFIG
- * events. For these two events, non-zero return value indicates a failure and
- * prevents successful completion of the operation.
- *
- * New events may be added in the future. Callback functions should ignore any
- * events that they do not understand.
- *
- * The following events provide notification callbacks:
- *
- * CPU_INIT A new CPU is started and added to the list of active CPUs
- * This event is only used during boot
- *
- * CPU_CONFIG A newly inserted CPU is prepared for starting running code
- * This event is called by DR code
- *
- * CPU_UNCONFIG CPU has been powered off and needs cleanup
- * This event is called by DR code
- *
- * CPU_ON CPU is enabled but does not run anything yet
- *
- * CPU_INTR_ON CPU is enabled and has interrupts enabled
- *
- * CPU_OFF CPU is going offline but can still run threads
- *
- * CPU_CPUPART_OUT CPU is going to move out of its partition
- *
- * CPU_CPUPART_IN CPU is going to move to a new partition
- *
- * CPU_SETUP CPU is set up during boot and can run threads
- */
-typedef enum {
- CPU_INIT,
- CPU_CONFIG,
- CPU_UNCONFIG,
- CPU_ON,
- CPU_OFF,
- CPU_CPUPART_IN,
- CPU_CPUPART_OUT,
- CPU_SETUP,
- CPU_INTR_ON
-} cpu_setup_t;
-
-typedef int cpu_setup_func_t(cpu_setup_t, int, void *);
-
-/*
- * Routines used to register interest in cpu's being added to or removed
- * from the system.
- */
-extern void register_cpu_setup_func(cpu_setup_func_t *, void *);
-extern void unregister_cpu_setup_func(cpu_setup_func_t *, void *);
-extern void cpu_state_change_notify(int, cpu_setup_t);
-
-/*
- * Call specified function on the given CPU
- */
-typedef void (*cpu_call_func_t)(uintptr_t, uintptr_t);
-extern void cpu_call(cpu_t *, cpu_call_func_t, uintptr_t, uintptr_t);
-
-
-/*
- * Create various strings that describe the given CPU for the
- * processor_info system call and configuration-related kstats.
- */
-#define CPU_IDSTRLEN 100
-
-extern void init_cpu_info(struct cpu *);
-extern void populate_idstr(struct cpu *);
-extern void cpu_vm_data_init(struct cpu *);
-extern void cpu_vm_data_destroy(struct cpu *);
-
-#endif /* _KERNEL || _FAKE_KERNEL */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_CPUVAR_H */
Index: sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
+++ sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
@@ -50,25 +50,20 @@
#ifndef _ASM
#include <sys/types.h>
+#include <sys/endian.h>
#include <sys/modctl.h>
#include <sys/processor.h>
-#ifdef illumos
-#include <sys/systm.h>
-#else
#include <sys/cpuvar.h>
#include <sys/param.h>
#include <sys/linker.h>
#include <sys/ioccom.h>
+#include <sys/cred.h>
+#include <sys/proc.h>
+#include <sys/types.h>
#include <sys/ucred.h>
typedef int model_t;
-#endif
#include <sys/ctf_api.h>
-#ifdef illumos
-#include <sys/cyclic.h>
-#include <sys/int_limits.h>
-#else
#include <sys/stdint.h>
-#endif
/*
* DTrace Universal Constants and Typedefs
Index: sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
+++ sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
@@ -50,6 +50,7 @@
*/
#include <sys/dtrace.h>
+#include <sys/file.h>
#ifndef illumos
#ifdef __sparcv9
Index: sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2017 RackTop Systems.
- */
-
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#ifndef _SYS_VNODE_H
-#define _SYS_VNODE_H
-
-#include_next <sys/vnode.h>
-
-#define IS_DEVVP(vp) \
- ((vp)->v_type == VCHR || (vp)->v_type == VBLK || (vp)->v_type == VFIFO)
-
-#define V_XATTRDIR 0x0000 /* attribute unnamed directory */
-
-#define AV_SCANSTAMP_SZ 32 /* length of anti-virus scanstamp */
-
-/*
- * Structure of all optional attributes.
- */
-typedef struct xoptattr {
- timestruc_t xoa_createtime; /* Create time of file */
- uint8_t xoa_archive;
- uint8_t xoa_system;
- uint8_t xoa_readonly;
- uint8_t xoa_hidden;
- uint8_t xoa_nounlink;
- uint8_t xoa_immutable;
- uint8_t xoa_appendonly;
- uint8_t xoa_nodump;
- uint8_t xoa_opaque;
- uint8_t xoa_av_quarantined;
- uint8_t xoa_av_modified;
- uint8_t xoa_av_scanstamp[AV_SCANSTAMP_SZ];
- uint8_t xoa_reparse;
- uint64_t xoa_generation;
- uint8_t xoa_offline;
- uint8_t xoa_sparse;
-} xoptattr_t;
-
-/*
- * The xvattr structure is really a variable length structure that
- * is made up of:
- * - The classic vattr_t (xva_vattr)
- * - a 32 bit quantity (xva_mapsize) that specifies the size of the
- * attribute bitmaps in 32 bit words.
- * - A pointer to the returned attribute bitmap (needed because the
- * previous element, the requested attribute bitmap) is variable lenth.
- * - The requested attribute bitmap, which is an array of 32 bit words.
- * Callers use the XVA_SET_REQ() macro to set the bits corresponding to
- * the attributes that are being requested.
- * - The returned attribute bitmap, which is an array of 32 bit words.
- * File systems that support optional attributes use the XVA_SET_RTN()
- * macro to set the bits corresponding to the attributes that are being
- * returned.
- * - The xoptattr_t structure which contains the attribute values
- *
- * xva_mapsize determines how many words in the attribute bitmaps.
- * Immediately following the attribute bitmaps is the xoptattr_t.
- * xva_getxoptattr() is used to get the pointer to the xoptattr_t
- * section.
- */
-
-#define XVA_MAPSIZE 3 /* Size of attr bitmaps */
-#define XVA_MAGIC 0x78766174 /* Magic # for verification */
-
-/*
- * The xvattr structure is an extensible structure which permits optional
- * attributes to be requested/returned. File systems may or may not support
- * optional attributes. They do so at their own discretion but if they do
- * support optional attributes, they must register the VFSFT_XVATTR feature
- * so that the optional attributes can be set/retrived.
- *
- * The fields of the xvattr structure are:
- *
- * xva_vattr - The first element of an xvattr is a legacy vattr structure
- * which includes the common attributes. If AT_XVATTR is set in the va_mask
- * then the entire structure is treated as an xvattr. If AT_XVATTR is not
- * set, then only the xva_vattr structure can be used.
- *
- * xva_magic - 0x78766174 (hex for "xvat"). Magic number for verification.
- *
- * xva_mapsize - Size of requested and returned attribute bitmaps.
- *
- * xva_rtnattrmapp - Pointer to xva_rtnattrmap[]. We need this since the
- * size of the array before it, xva_reqattrmap[], could change which means
- * the location of xva_rtnattrmap[] could change. This will allow unbundled
- * file systems to find the location of xva_rtnattrmap[] when the sizes change.
- *
- * xva_reqattrmap[] - Array of requested attributes. Attributes are
- * represented by a specific bit in a specific element of the attribute
- * map array. Callers set the bits corresponding to the attributes
- * that the caller wants to get/set.
- *
- * xva_rtnattrmap[] - Array of attributes that the file system was able to
- * process. Not all file systems support all optional attributes. This map
- * informs the caller which attributes the underlying file system was able
- * to set/get. (Same structure as the requested attributes array in terms
- * of each attribute corresponding to specific bits and array elements.)
- *
- * xva_xoptattrs - Structure containing values of optional attributes.
- * These values are only valid if the corresponding bits in xva_reqattrmap
- * are set and the underlying file system supports those attributes.
- */
-typedef struct xvattr {
- vattr_t xva_vattr; /* Embedded vattr structure */
- uint32_t xva_magic; /* Magic Number */
- uint32_t xva_mapsize; /* Size of attr bitmap (32-bit words) */
- uint32_t *xva_rtnattrmapp; /* Ptr to xva_rtnattrmap[] */
- uint32_t xva_reqattrmap[XVA_MAPSIZE]; /* Requested attrs */
- uint32_t xva_rtnattrmap[XVA_MAPSIZE]; /* Returned attrs */
- xoptattr_t xva_xoptattrs; /* Optional attributes */
-} xvattr_t;
-
-/*
- * Attributes of interest to the caller of setattr or getattr.
- */
-#define AT_TYPE 0x00001
-#define AT_MODE 0x00002
-#define AT_UID 0x00004
-#define AT_GID 0x00008
-#define AT_FSID 0x00010
-#define AT_NODEID 0x00020
-#define AT_NLINK 0x00040
-#define AT_SIZE 0x00080
-#define AT_ATIME 0x00100
-#define AT_MTIME 0x00200
-#define AT_CTIME 0x00400
-#define AT_RDEV 0x00800
-#define AT_BLKSIZE 0x01000
-#define AT_NBLOCKS 0x02000
-/* 0x04000 */ /* unused */
-#define AT_SEQ 0x08000
-/*
- * If AT_XVATTR is set then there are additional bits to process in
- * the xvattr_t's attribute bitmap. If this is not set then the bitmap
- * MUST be ignored. Note that this bit must be set/cleared explicitly.
- * That is, setting AT_ALL will NOT set AT_XVATTR.
- */
-#define AT_XVATTR 0x10000
-
-#define AT_ALL (AT_TYPE|AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|\
- AT_NLINK|AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|\
- AT_RDEV|AT_BLKSIZE|AT_NBLOCKS|AT_SEQ)
-
-#define AT_STAT (AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|AT_NLINK|\
- AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|AT_RDEV|AT_TYPE)
-
-#define AT_TIMES (AT_ATIME|AT_MTIME|AT_CTIME)
-
-#define AT_NOSET (AT_NLINK|AT_RDEV|AT_FSID|AT_NODEID|AT_TYPE|\
- AT_BLKSIZE|AT_NBLOCKS|AT_SEQ)
-
-/*
- * Attribute bits used in the extensible attribute's (xva's) attribute
- * bitmaps. Note that the bitmaps are made up of a variable length number
- * of 32-bit words. The convention is to use XAT{n}_{attrname} where "n"
- * is the element in the bitmap (starting at 1). This convention is for
- * the convenience of the maintainer to keep track of which element each
- * attribute belongs to.
- *
- * NOTE THAT CONSUMERS MUST *NOT* USE THE XATn_* DEFINES DIRECTLY. CONSUMERS
- * MUST USE THE XAT_* DEFINES.
- */
-#define XAT0_INDEX 0LL /* Index into bitmap for XAT0 attrs */
-#define XAT0_CREATETIME 0x00000001 /* Create time of file */
-#define XAT0_ARCHIVE 0x00000002 /* Archive */
-#define XAT0_SYSTEM 0x00000004 /* System */
-#define XAT0_READONLY 0x00000008 /* Readonly */
-#define XAT0_HIDDEN 0x00000010 /* Hidden */
-#define XAT0_NOUNLINK 0x00000020 /* Nounlink */
-#define XAT0_IMMUTABLE 0x00000040 /* immutable */
-#define XAT0_APPENDONLY 0x00000080 /* appendonly */
-#define XAT0_NODUMP 0x00000100 /* nodump */
-#define XAT0_OPAQUE 0x00000200 /* opaque */
-#define XAT0_AV_QUARANTINED 0x00000400 /* anti-virus quarantine */
-#define XAT0_AV_MODIFIED 0x00000800 /* anti-virus modified */
-#define XAT0_AV_SCANSTAMP 0x00001000 /* anti-virus scanstamp */
-#define XAT0_REPARSE 0x00002000 /* FS reparse point */
-#define XAT0_GEN 0x00004000 /* object generation number */
-#define XAT0_OFFLINE 0x00008000 /* offline */
-#define XAT0_SPARSE 0x00010000 /* sparse */
-
-#define XAT0_ALL_ATTRS (XAT0_CREATETIME|XAT0_ARCHIVE|XAT0_SYSTEM| \
- XAT0_READONLY|XAT0_HIDDEN|XAT0_NOUNLINK|XAT0_IMMUTABLE|XAT0_APPENDONLY| \
- XAT0_NODUMP|XAT0_OPAQUE|XAT0_AV_QUARANTINED| XAT0_AV_MODIFIED| \
- XAT0_AV_SCANSTAMP|XAT0_REPARSE|XATO_GEN|XAT0_OFFLINE|XAT0_SPARSE)
-
-/* Support for XAT_* optional attributes */
-#define XVA_MASK 0xffffffff /* Used to mask off 32 bits */
-#define XVA_SHFT 32 /* Used to shift index */
-
-/*
- * Used to pry out the index and attribute bits from the XAT_* attributes
- * defined below. Note that we're masking things down to 32 bits then
- * casting to uint32_t.
- */
-#define XVA_INDEX(attr) ((uint32_t)(((attr) >> XVA_SHFT) & XVA_MASK))
-#define XVA_ATTRBIT(attr) ((uint32_t)((attr) & XVA_MASK))
-
-/*
- * The following defines present a "flat namespace" so that consumers don't
- * need to keep track of which element belongs to which bitmap entry.
- *
- * NOTE THAT THESE MUST NEVER BE OR-ed TOGETHER
- */
-#define XAT_CREATETIME ((XAT0_INDEX << XVA_SHFT) | XAT0_CREATETIME)
-#define XAT_ARCHIVE ((XAT0_INDEX << XVA_SHFT) | XAT0_ARCHIVE)
-#define XAT_SYSTEM ((XAT0_INDEX << XVA_SHFT) | XAT0_SYSTEM)
-#define XAT_READONLY ((XAT0_INDEX << XVA_SHFT) | XAT0_READONLY)
-#define XAT_HIDDEN ((XAT0_INDEX << XVA_SHFT) | XAT0_HIDDEN)
-#define XAT_NOUNLINK ((XAT0_INDEX << XVA_SHFT) | XAT0_NOUNLINK)
-#define XAT_IMMUTABLE ((XAT0_INDEX << XVA_SHFT) | XAT0_IMMUTABLE)
-#define XAT_APPENDONLY ((XAT0_INDEX << XVA_SHFT) | XAT0_APPENDONLY)
-#define XAT_NODUMP ((XAT0_INDEX << XVA_SHFT) | XAT0_NODUMP)
-#define XAT_OPAQUE ((XAT0_INDEX << XVA_SHFT) | XAT0_OPAQUE)
-#define XAT_AV_QUARANTINED ((XAT0_INDEX << XVA_SHFT) | XAT0_AV_QUARANTINED)
-#define XAT_AV_MODIFIED ((XAT0_INDEX << XVA_SHFT) | XAT0_AV_MODIFIED)
-#define XAT_AV_SCANSTAMP ((XAT0_INDEX << XVA_SHFT) | XAT0_AV_SCANSTAMP)
-#define XAT_REPARSE ((XAT0_INDEX << XVA_SHFT) | XAT0_REPARSE)
-#define XAT_GEN ((XAT0_INDEX << XVA_SHFT) | XAT0_GEN)
-#define XAT_OFFLINE ((XAT0_INDEX << XVA_SHFT) | XAT0_OFFLINE)
-#define XAT_SPARSE ((XAT0_INDEX << XVA_SHFT) | XAT0_SPARSE)
-
-/*
- * The returned attribute map array (xva_rtnattrmap[]) is located past the
- * requested attribute map array (xva_reqattrmap[]). Its location changes
- * when the array sizes change. We use a separate pointer in a known location
- * (xva_rtnattrmapp) to hold the location of xva_rtnattrmap[]. This is
- * set in xva_init()
- */
-#define XVA_RTNATTRMAP(xvap) ((xvap)->xva_rtnattrmapp)
-
-/*
- * XVA_SET_REQ() sets an attribute bit in the proper element in the bitmap
- * of requested attributes (xva_reqattrmap[]).
- */
-#define XVA_SET_REQ(xvap, attr) { \
- ASSERT((xvap)->xva_vattr.va_mask | AT_XVATTR); \
- ASSERT((xvap)->xva_magic == XVA_MAGIC); \
- (xvap)->xva_reqattrmap[XVA_INDEX(attr)] |= XVA_ATTRBIT(attr); \
-}
-/*
- * XVA_CLR_REQ() clears an attribute bit in the proper element in the bitmap
- * of requested attributes (xva_reqattrmap[]).
- */
-#define XVA_CLR_REQ(xvap, attr) { \
- ASSERT((xvap)->xva_vattr.va_mask | AT_XVATTR); \
- ASSERT((xvap)->xva_magic == XVA_MAGIC); \
- (xvap)->xva_reqattrmap[XVA_INDEX(attr)] &= ~XVA_ATTRBIT(attr); \
-}
-
-/*
- * XVA_SET_RTN() sets an attribute bit in the proper element in the bitmap
- * of returned attributes (xva_rtnattrmap[]).
- */
-#define XVA_SET_RTN(xvap, attr) { \
- ASSERT((xvap)->xva_vattr.va_mask | AT_XVATTR); \
- ASSERT((xvap)->xva_magic == XVA_MAGIC); \
- (XVA_RTNATTRMAP(xvap))[XVA_INDEX(attr)] |= XVA_ATTRBIT(attr); \
-}
-
-/*
- * XVA_ISSET_REQ() checks the requested attribute bitmap (xva_reqattrmap[])
- * to see of the corresponding attribute bit is set. If so, returns non-zero.
- */
-#define XVA_ISSET_REQ(xvap, attr) \
- ((((xvap)->xva_vattr.va_mask | AT_XVATTR) && \
- ((xvap)->xva_magic == XVA_MAGIC) && \
- ((xvap)->xva_mapsize > XVA_INDEX(attr))) ? \
- ((xvap)->xva_reqattrmap[XVA_INDEX(attr)] & XVA_ATTRBIT(attr)) : 0)
-
-/*
- * XVA_ISSET_RTN() checks the returned attribute bitmap (xva_rtnattrmap[])
- * to see of the corresponding attribute bit is set. If so, returns non-zero.
- */
-#define XVA_ISSET_RTN(xvap, attr) \
- ((((xvap)->xva_vattr.va_mask | AT_XVATTR) && \
- ((xvap)->xva_magic == XVA_MAGIC) && \
- ((xvap)->xva_mapsize > XVA_INDEX(attr))) ? \
- ((XVA_RTNATTRMAP(xvap))[XVA_INDEX(attr)] & XVA_ATTRBIT(attr)) : 0)
-
-#define MODEMASK 07777 /* mode bits plus permission bits */
-#define PERMMASK 00777 /* permission bits */
-
-/*
- * VOP_ACCESS flags
- */
-#define V_ACE_MASK 0x1 /* mask represents NFSv4 ACE permissions */
-
-/*
- * Flags for vnode operations.
- */
-enum rm { RMFILE, RMDIRECTORY }; /* rm or rmdir (remove) */
-enum create { CRCREAT, CRMKNOD, CRMKDIR }; /* reason for create */
-
-/*
- * Structure used on VOP_GETSECATTR and VOP_SETSECATTR operations
- */
-
-typedef struct vsecattr {
- uint_t vsa_mask; /* See below */
- int vsa_aclcnt; /* ACL entry count */
- void *vsa_aclentp; /* pointer to ACL entries */
- int vsa_dfaclcnt; /* default ACL entry count */
- void *vsa_dfaclentp; /* pointer to default ACL entries */
- size_t vsa_aclentsz; /* ACE size in bytes of vsa_aclentp */
- uint_t vsa_aclflags; /* ACE ACL flags */
-} vsecattr_t;
-
-/* vsa_mask values */
-#define VSA_ACL 0x0001
-#define VSA_ACLCNT 0x0002
-#define VSA_DFACL 0x0004
-#define VSA_DFACLCNT 0x0008
-#define VSA_ACE 0x0010
-#define VSA_ACECNT 0x0020
-#define VSA_ACE_ALLTYPES 0x0040
-#define VSA_ACE_ACLFLAGS 0x0080 /* get/set ACE ACL flags */
-
-/*
- * Structure used by various vnode operations to determine
- * the context (pid, host, identity) of a caller.
- *
- * The cc_caller_id is used to identify one or more callers who invoke
- * operations, possibly on behalf of others. For example, the NFS
- * server could have it's own cc_caller_id which can be detected by
- * vnode/vfs operations or (FEM) monitors on those operations. New
- * caller IDs are generated by fs_new_caller_id().
- */
-typedef struct caller_context {
- pid_t cc_pid; /* Process ID of the caller */
- int cc_sysid; /* System ID, used for remote calls */
- u_longlong_t cc_caller_id; /* Identifier for (set of) caller(s) */
- ulong_t cc_flags;
-} caller_context_t;
-
-struct taskq;
-
-/*
- * Flags for VOP_LOOKUP
- *
- * Defined in file.h, but also possible, FIGNORECASE and FSEARCH
- *
- */
-#define LOOKUP_DIR 0x01 /* want parent dir vp */
-#define LOOKUP_XATTR 0x02 /* lookup up extended attr dir */
-#define CREATE_XATTR_DIR 0x04 /* Create extended attr dir */
-#define LOOKUP_HAVE_SYSATTR_DIR 0x08 /* Already created virtual GFS dir */
-
-/*
- * Flags for VOP_READDIR
- */
-#define V_RDDIR_ENTFLAGS 0x01 /* request dirent flags */
-#define V_RDDIR_ACCFILTER 0x02 /* filter out inaccessible dirents */
-
-/*
- * Public vnode manipulation functions.
- */
-#ifdef _KERNEL
-
-void vn_rele_async(struct vnode *vp, struct taskq *taskq);
-
-/*
- * Extensible vnode attribute (xva) routines:
- * xva_init() initializes an xvattr_t (zero struct, init mapsize, set AT_XATTR)
- * xva_getxoptattr() returns a ponter to the xoptattr_t section of xvattr_t
- */
-void xva_init(xvattr_t *);
-xoptattr_t *xva_getxoptattr(xvattr_t *); /* Get ptr to xoptattr_t */
-
-#define VN_RELE_ASYNC(vp, taskq) { \
- vn_rele_async(vp, taskq); \
-}
-
-#endif /* _KERNEL */
-
-/*
- * Flags to VOP_SETATTR/VOP_GETATTR.
- */
-#define ATTR_UTIME 0x01 /* non-default utime(2) request */
-#define ATTR_EXEC 0x02 /* invocation from exec(2) */
-#define ATTR_COMM 0x04 /* yield common vp attributes */
-#define ATTR_HINT 0x08 /* information returned will be `hint' */
-#define ATTR_REAL 0x10 /* yield attributes of the real vp */
-#define ATTR_NOACLCHECK 0x20 /* Don't check ACL when checking permissions */
-#define ATTR_TRIGGER 0x40 /* Mount first if vnode is a trigger mount */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_VNODE_H */
Index: sys/cddl/dev/dtrace/amd64/dtrace_subr.c
===================================================================
--- sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -36,7 +36,6 @@
#include <sys/types.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#include <sys/kmem.h>
#include <sys/smp.h>
#include <sys/dtrace_impl.h>
#include <sys/dtrace_bsd.h>
Index: sys/cddl/dev/fbt/fbt.c
===================================================================
--- sys/cddl/dev/fbt/fbt.c
+++ sys/cddl/dev/fbt/fbt.c
@@ -34,6 +34,7 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/cpuvar.h>
+#include <sys/endian.h>
#include <sys/fcntl.h>
#include <sys/filio.h>
#include <sys/kdb.h>
Index: sys/cddl/dev/profile/profile.c
===================================================================
--- sys/cddl/dev/profile/profile.c
+++ sys/cddl/dev/profile/profile.c
@@ -34,6 +34,7 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/cpuvar.h>
+#include <sys/endian.h>
#include <sys/fcntl.h>
#include <sys/filio.h>
#include <sys/kdb.h>
Index: sys/cddl/dev/sdt/sdt.c
===================================================================
--- sys/cddl/dev/sdt/sdt.c
+++ sys/cddl/dev/sdt/sdt.c
@@ -44,6 +44,7 @@
#include <sys/systm.h>
#include <sys/conf.h>
+#include <sys/endian.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/limits.h>
Index: sys/conf/files
===================================================================
--- sys/conf/files
+++ sys/conf/files
@@ -133,184 +133,230 @@
cam/scsi/scsi_targ_bh.c optional targbh
cam/scsi/scsi_target.c optional targ
cam/scsi/smp_all.c optional scbus
+
# shared between zfs and dtrace
-cddl/compat/opensolaris/kern/opensolaris.c optional zfs | dtrace compile-with "${CDDL_C}"
-cddl/compat/opensolaris/kern/opensolaris_cmn_err.c optional zfs | dtrace compile-with "${CDDL_C}"
-cddl/compat/opensolaris/kern/opensolaris_kmem.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris.c optional dtrace compile-with "${CDDL_C}"
cddl/compat/opensolaris/kern/opensolaris_misc.c optional zfs | dtrace compile-with "${CDDL_C}"
cddl/compat/opensolaris/kern/opensolaris_proc.c optional zfs | dtrace compile-with "${CDDL_C}"
-cddl/compat/opensolaris/kern/opensolaris_sunddi.c optional zfs | dtrace compile-with "${CDDL_C}"
-cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs | dtrace compile-with "${CDDL_C}"
+
+#zfs solaris portability layer
+contrib/openzfs/module/os/freebsd/spl/acl_common.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/callb.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/list.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_acl.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_cmn_err.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_dtrace.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_kmem.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_kstat.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_misc.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_policy.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_string.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_sunddi.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_sysevent.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_taskq.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_uio.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_vfs.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_vm.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_zone.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_zlib.c optional zfs compile-with "${ZFS_C}"
+
+
# zfs specific
-cddl/compat/opensolaris/kern/opensolaris_acl.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_dtrace.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_kobj.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_kstat.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_lookup.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_policy.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_string.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_sysevent.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_uio.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_vfs.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_vm.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/lz4/lz4.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/unicode/u8_textprep.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfeature_common.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfs_comutil.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfs_deleg.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zfs_prop.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zpool_prop.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/zfs/zprop_common.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/vnode.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/cityhash.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c optional zfs compile-with "${ZFS_C}" \
- warning "kernel contains CDDL licensed ZFS filesystem"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/gzip.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/mmp.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_births.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_iter.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zthr.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/os/callb.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/os/fm.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/os/list.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/os/nvpair_alloc_system.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/zmod/zmod.c optional zfs compile-with "${ZFS_C}"
+
+#zfs avl
+contrib/openzfs/module/avl/avl.c optional zfs compile-with "${ZFS_C}"
+
# zfs lua support
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lapi.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lauxlib.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lbaselib.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lbitlib.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lcode.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lcompat.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lcorolib.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lctype.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldebug.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldo.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldump.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lfunc.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lgc.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/llex.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lmem.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lobject.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lopcodes.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lparser.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstate.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstring.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ltable.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ltablib.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ltm.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lundump.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lvm.c optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lzio.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lapi.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lauxlib.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lbaselib.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lcode.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lcompat.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lcorolib.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lctype.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/ldebug.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lfunc.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lgc.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/llex.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lmem.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lobject.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lopcodes.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lparser.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lstate.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lstring.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lstrlib.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/ltable.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/ltablib.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/ltm.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lvm.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/lua/lzio.c optional zfs compile-with "${ZFS_C}"
+
+# zfs nvpair support
+contrib/openzfs/module/nvpair/fnvpair.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/nvpair/nvpair.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/nvpair/nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/nvpair/nvpair_alloc_spl.c optional zfs compile-with "${ZFS_C}"
+
+#zfs platform compatibility code
+contrib/openzfs/module/os/freebsd/zfs/abd_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/arc_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/crypto_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/dmu_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/hkdf.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/kmod_core.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/spa_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/spa_stats.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/vdev_file.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/vdev_label_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_debug.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_dir.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_fuid_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/zfs/zvol_os.c optional zfs compile-with "${ZFS_C}"
+
+#zfs unicode support
+contrib/openzfs/module/unicode/uconv.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/unicode/u8_textprep.c optional zfs compile-with "${ZFS_C}"
+
+#zfs checksums / zcommon
+contrib/openzfs/module/zcommon/cityhash.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfeature_common.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_comutil.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_deleg.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_fletcher.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_fletcher_superscalar.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_fletcher_superscalar4.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_namecheck.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_prop.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zpool_prop.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zprop_common.c optional zfs compile-with "${ZFS_C}"
+
+#zfs core common code
+contrib/openzfs/module/zfs/abd.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/aggsum.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/arc.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/blkptr.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/bplist.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/bpobj.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/bptree.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/btree.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/bqueue.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dbuf.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dbuf_stats.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dataset_kstats.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/ddt.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/ddt_zap.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_diff.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_object.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_objset.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_recv.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_redact.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_send.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_traverse.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_tx.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dmu_zfetch.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dnode.c optional zfs compile-with "${ZFS_C}" \
+ warning "kernel contains CDDL licensed ZFS filesystem"
+contrib/openzfs/module/zfs/dnode_sync.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_bookmark.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_crypt.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_dataset.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_deadlist.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_deleg.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_destroy.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_dir.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_pool.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_prop.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_scan.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_synctask.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/dsl_userhold.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/fm.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/gzip.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/lzjb.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/lz4.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/metaslab.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/mmp.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/multilist.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/objlist.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/pathname.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/range_tree.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/refcount.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/rrwlock.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/sa.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/sha256.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/skein_zfs.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_boot.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_checkpoint.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_config.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_errlog.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_history.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_log_spacemap.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/spa_misc.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/space_map.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/space_reftree.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/txg.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/uberblock.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/unique.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_cache.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_indirect.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_indirect_births.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_indirect_mapping.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_initialize.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_label.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_mirror.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_missing.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_queue.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz_math.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz_math_scalar.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_removal.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_root.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_trim.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zap.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zap_leaf.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zap_micro.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zcp.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zcp_get.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zcp_global.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zcp_iter.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zcp_set.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zcp_synctask.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfeature.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_fuid.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_ioctl.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_log.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_onexit.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_quota.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_ratelimit.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_replay.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_rlock.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_sa.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zil.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zio.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zio_checksum.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zio_compress.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zio_inject.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zle.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zrlock.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zthr.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zvol.c optional zfs compile-with "${ZFS_C}"
+
# dtrace specific
cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c optional dtrace compile-with "${DTRACE_C}" \
warning "kernel contains CDDL licensed DTRACE"
@@ -593,7 +639,7 @@
contrib/libnv/cnvlist.c standard
contrib/libnv/dnvlist.c standard
contrib/libnv/nvlist.c standard
-contrib/libnv/nvpair.c standard
+contrib/libnv/bsd_nvpair.c standard
contrib/ngatm/netnatm/api/cc_conn.c optional ngatm_ccatm \
compile-with "${NORMAL_C_NOWERROR} -I$S/contrib/ngatm"
contrib/ngatm/netnatm/api/cc_data.c optional ngatm_ccatm \
Index: sys/conf/files.amd64
===================================================================
--- sys/conf/files.amd64
+++ sys/conf/files.amd64
@@ -463,3 +463,13 @@
x86/xen/pv.c optional xenhvm
x86/xen/pvcpu_enum.c optional xenhvm
x86/xen/xen_pci_bus.c optional xenhvm
+
+contrib/openzfs/module/zcommon/zfs_fletcher_avx512.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_fletcher_intel.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zcommon/zfs_fletcher_sse.c optional zfs compile-with "${ZFS_C}"
+
+contrib/openzfs/module/zfs/vdev_raidz_math_avx2.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz_math_avx512bw.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz_math_avx512f.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz_math_sse2.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/vdev_raidz_math_ssse3.c optional zfs compile-with "${ZFS_C}"
Index: sys/conf/kern.pre.mk
===================================================================
--- sys/conf/kern.pre.mk
+++ sys/conf/kern.pre.mk
@@ -204,34 +204,54 @@
ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize
.endif
+ZINCDIR=$S/contrib/openzfs/include
# Common for dtrace / zfs
-CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas
-CDDL_CFLAGS+= -include $S/cddl/compat/opensolaris/sys/debug_compat.h
+CDDL_CFLAGS= -DFREEBSD_NAMECACHE -D_SYS_VMEM_H_ -D__KERNEL -D__KERNEL__ -D_MACHINE_ENDIAN_H_ \
+ -DKERNEL_STATIC -nostdinc -include opt_global.h -include $S/modules/zfs/static_ccompile.h \
+ -I${ZINCDIR} -I${ZINCDIR}/spl -I${ZINCDIR}/os/freebsd -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs -I$S -I$S/modules/zfs ${CFLAGS} -Wno-unknown-pragmas \
+ -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses \
+ -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline \
+ -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas -Wno-duplicate-decl-specifier \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h -I$S/cddl/contrib/opensolaris/uts/common -\
+ I$S -I$S/cddl/compat/opensolaris
CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
# Special flags for managing the compat compiles for ZFS
-ZFS_CFLAGS= -DBUILDING_ZFS -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs
-ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
-ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common/zmod
-ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/lz4
-ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/zfs
-ZFS_CFLAGS+= ${CDDL_CFLAGS}
+ZFS_CFLAGS+= ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY -DWITH_NETDUMP
+ZFS_CFLAGS+= -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP
+
+.if ${MACHINE_ARCH} == "amd64"
+ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F
+.endif
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "arm"
+ZFS_CFLAGS+= -DBITS_PER_LONG=32
+.else
+ZFS_CFLAGS+= -DBITS_PER_LONG=64
+.endif
+
+
ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS}
ZFS_C= ${CC} -c ${ZFS_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC}
+
+
# Special flags for managing the compat compiles for DTrace
DTRACE_CFLAGS= -DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH}
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86
.endif
-DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP
+DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP -I$S/cddl/compat/opensolaris
+DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common
DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS}
DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC}
# Special flags for managing the compat compiles for DTrace/FBT
-FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S ${CDDL_CFLAGS}
+FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
FBT_CFLAGS+= -I$S/cddl/dev/fbt/x86
.endif
Index: sys/modules/dtrace/dtaudit/Makefile
===================================================================
--- sys/modules/dtrace/dtaudit/Makefile
+++ sys/modules/dtrace/dtaudit/Makefile
@@ -8,9 +8,17 @@
SRCS= audit_dtrace.c \
vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
- -I${SYSDIR}
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/dtmalloc/Makefile
===================================================================
--- sys/modules/dtrace/dtmalloc/Makefile
+++ sys/modules/dtrace/dtmalloc/Makefile
@@ -8,9 +8,18 @@
SRCS= dtmalloc.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
- -I${SYSDIR}
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/dtnfscl/Makefile
===================================================================
--- sys/modules/dtrace/dtnfscl/Makefile
+++ sys/modules/dtrace/dtnfscl/Makefile
@@ -8,9 +8,18 @@
SRCS= nfs_clkdtrace.c \
vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
- -I${SYSDIR}
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
+
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/dtrace/Makefile
===================================================================
--- sys/modules/dtrace/dtrace/Makefile
+++ sys/modules/dtrace/dtrace/Makefile
@@ -20,9 +20,22 @@
.PATH: ${SYSDIR}/cddl/dev/dtrace/x86
SRCS+= dis_tables.c \
instr_size.c
-CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
- -I${SYSDIR}/cddl/dev/dtrace/x86
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
+ -I${SYSDIR}/cddl/dev/dtrace/x86
+
.endif
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
+
SRCS+= bus_if.h device_if.h vnode_if.h
@@ -56,7 +69,7 @@
.include <bsd.kmod.mk>
CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
-
+CFLAGS.dtrace_asm.S+= -D_SYS_ERRNO_H_ -D_SYS_PARAM_H_ -DLOCORE
CWARNFLAGS+= -Wno-parentheses
CWARNFLAGS+= -Wno-uninitialized
CWARNFLAGS+= -Wno-cast-qual
Index: sys/modules/dtrace/fasttrap/Makefile
===================================================================
--- sys/modules/dtrace/fasttrap/Makefile
+++ sys/modules/dtrace/fasttrap/Makefile
@@ -6,13 +6,25 @@
KMOD= fasttrap
SRCS= fasttrap.c fasttrap_isa.c
-SRCS+= vnode_if.h
-
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+SRCS+= vnode_if.h opt_global.h
+
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+
+CFLAGS+= -include ${.OBJDIR}/opt_global.h
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR}
+
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel
.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/intel/dtrace
Index: sys/modules/dtrace/fbt/Makefile
===================================================================
--- sys/modules/dtrace/fbt/Makefile
+++ sys/modules/dtrace/fbt/Makefile
@@ -8,6 +8,7 @@
SRCS= fbt.c fbt_isa.c
SRCS+= vnode_if.h
+
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -I${SYSDIR}/cddl/dev/fbt/x86
.PATH: ${SYSDIR}/cddl/dev/fbt/x86
@@ -16,11 +17,21 @@
.PATH: ${SYSDIR}/cddl/dev/fbt/${MACHINE_CPUARCH}
.endif
-CFLAGS+= -I${SYSDIR}/cddl/dev/fbt \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
-I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I$${SYSDIR}/cddl/dev/fbt \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR}
+
.include <bsd.kmod.mk>
CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
Index: sys/modules/dtrace/profile/Makefile
===================================================================
--- sys/modules/dtrace/profile/Makefile
+++ sys/modules/dtrace/profile/Makefile
@@ -8,9 +8,17 @@
SRCS= profile.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
- -I${SYSDIR}
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/prototype/Makefile
===================================================================
--- sys/modules/dtrace/prototype/Makefile
+++ sys/modules/dtrace/prototype/Makefile
@@ -8,8 +8,17 @@
SRCS= prototype.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR}
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/sdt/Makefile
===================================================================
--- sys/modules/dtrace/sdt/Makefile
+++ sys/modules/dtrace/sdt/Makefile
@@ -8,10 +8,18 @@
SRCS= sdt.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR}
.include <bsd.kmod.mk>
-
CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
Index: sys/modules/dtrace/systrace/Makefile
===================================================================
--- sys/modules/dtrace/systrace/Makefile
+++ sys/modules/dtrace/systrace/Makefile
@@ -8,9 +8,18 @@
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR}
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/systrace_freebsd32/Makefile
===================================================================
--- sys/modules/dtrace/systrace_freebsd32/Makefile
+++ sys/modules/dtrace/systrace_freebsd32/Makefile
@@ -8,8 +8,17 @@
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR} -DFREEBSD32_SYSTRACE
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/systrace_linux/Makefile
===================================================================
--- sys/modules/dtrace/systrace_linux/Makefile
+++ sys/modules/dtrace/systrace_linux/Makefile
@@ -9,8 +9,17 @@
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR} -DLINUX_SYSTRACE
.include <bsd.kmod.mk>
Index: sys/modules/dtrace/systrace_linux32/Makefile
===================================================================
--- sys/modules/dtrace/systrace_linux32/Makefile
+++ sys/modules/dtrace/systrace_linux32/Makefile
@@ -9,10 +9,20 @@
SRCS= systrace.c
SRCS+= vnode_if.h
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR} -DLINUX32_SYSTRACE
+
.include <bsd.kmod.mk>
CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
Index: sys/modules/opensolaris/Makefile
===================================================================
--- sys/modules/opensolaris/Makefile
+++ sys/modules/opensolaris/Makefile
@@ -3,14 +3,16 @@
SYSDIR?= ${SRCTOP}/sys
.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
+.PATH: ${SYSDIR}/contrib/openzfs/module/os/freebsd/spl
KMOD= opensolaris
-SRCS= opensolaris.c \
- opensolaris_cmn_err.c \
- opensolaris_kmem.c \
- opensolaris_misc.c \
+SRCS= vnode_if.h \
+ opensolaris.c \
opensolaris_proc.c \
- opensolaris_sunddi.c
+ spl_cmn_err.c \
+ spl_kmem.c \
+ spl_misc.c \
+ spl_sunddi.c
_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
@@ -23,8 +25,17 @@
SRCS+= opensolaris_atomic.c
.endif
-CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
- -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ZINCDIR=${SYSDIR}/contrib/openzfs/include
+CFLAGS+= -D_SYS_VMEM_H_ -D__KERNEL__ -D__BSD_VISIBLE=1 -nostdinc \
+ -D_MACHINE_ENDIAN_H_ -DSMP \
+ -I${ZINCDIR} \
+ -I${ZINCDIR}/spl \
+ -I${ZINCDIR}/os/freebsd \
+ -I${ZINCDIR}/os/freebsd/spl \
+ -I${ZINCDIR}/os/freebsd/zfs \
+ -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
-I${SYSDIR}
EXPORT_SYMS= cpu_core
Index: sys/modules/zfs/Makefile
===================================================================
--- sys/modules/zfs/Makefile
+++ sys/modules/zfs/Makefile
@@ -1,118 +1,331 @@
# $FreeBSD$
-SYSDIR?=${SRCTOP}/sys
+SRCDIR=${SRCTOP}/sys/contrib/openzfs/module
+INCDIR=${SRCTOP}/sys/contrib/openzfs/include
KMOD= zfs
-SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h
+.PATH: ${SRCDIR}/avl \
+ ${SRCDIR}/lua \
+ ${SRCDIR}/nvpair \
+ ${SRCDIR}/os/freebsd/spl \
+ ${SRCDIR}/os/freebsd/zfs \
+ ${SRCDIR}/unicode \
+ ${SRCDIR}/zcommon \
+ ${SRCDIR}/zfs
-SUNW= ${SYSDIR}/cddl/contrib/opensolaris
+CFLAGS+= -include ${.OBJDIR}/opt_global.h
+CFLAGS+= -I${INCDIR}
+CFLAGS+= -I${INCDIR}/spl
+CFLAGS+= -I${INCDIR}/os/freebsd
+CFLAGS+= -I${INCDIR}/os/freebsd/spl
+CFLAGS+= -I${INCDIR}/os/freebsd/zfs
+CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h
+CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/static_ccompile.h
+CFLAGS+= -I${.CURDIR}
-.PATH: ${SUNW}/common/acl
-SRCS+= acl_common.c
-.PATH: ${SUNW}/common/avl
-SRCS+= avl.c
-.PATH: ${SUNW}/common/nvpair
-SRCS+= opensolaris_nvpair.c
-SRCS+= opensolaris_nvpair_alloc_fixed.c
-SRCS+= opensolaris_fnvpair.c
-.PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode
-SRCS+= u8_textprep.c
-.PATH: ${SUNW}/common/lz4
-SRCS+= lz4.c
-
-.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
-SRCS+= opensolaris_acl.c
-SRCS+= opensolaris_dtrace.c
-SRCS+= opensolaris_kobj.c
-SRCS+= opensolaris_kstat.c
-SRCS+= opensolaris_lookup.c
-SRCS+= opensolaris_policy.c
-SRCS+= opensolaris_string.c
-SRCS+= opensolaris_sysevent.c
-SRCS+= opensolaris_taskq.c
-SRCS+= opensolaris_uio.c
-SRCS+= opensolaris_vfs.c
-SRCS+= opensolaris_vm.c
-SRCS+= opensolaris_zone.c
-
-_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
-.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
-.PATH: ${_A}/${MACHINE_CPUARCH}
-SRCS+= opensolaris_atomic.S
-.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S)
-.PATH: ${_A}/${MACHINE_ARCH}
-SRCS+= opensolaris_atomic.S
-.else
-SRCS+= opensolaris_atomic.c
+CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1
+CFLAGS+= -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_
+CFLAGS+= -D_SYS_VMEM_H_ -D_MACHINE_ENDIAN_H_ -DKDTRACE_HOOKS -DSMP
+
+.if ${MACHINE_ARCH} == "amd64"
+CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F
.endif
-.PATH: ${SUNW}/uts/common/fs
-SRCS+= vnode.c
-
-.PATH: ${SUNW}/uts/common/os
-SRCS+= callb.c
-SRCS+= fm.c
-SRCS+= list.c
-SRCS+= nvpair_alloc_system.c
-
-.PATH: ${SUNW}/uts/common/zmod
-SRCS+= zmod.c
-
-.PATH: ${SYSDIR}/crypto/sha2
-SRCS+= sha256c.c sha512c.c
-
-.PATH: ${SYSDIR}/crypto/skein
-SRCS+= skein.c skein_block.c
-
-.PATH: ${SUNW}/common/zfs
-.include "${SUNW}/uts/common/Makefile.files"
-.PATH: ${SUNW}/uts/common/fs/zfs
-ZFS_SRCS= ${ZFS_OBJS:C/.o$/.c/}
-SRCS+= ${ZFS_SRCS}
-SRCS+= vdev_geom.c
-SRCS+= trim_map.c
-.PATH: ${SUNW}/uts/common/fs/zfs/lua
-LUA_SRCS= ${LUA_OBJS:C/.o$/.c/}
-SRCS+= ${LUA_SRCS}
-
-# Use FreeBSD's namecache.
-CFLAGS+=-DFREEBSD_NAMECACHE
-
-CFLAGS+=-I${SYSDIR}/cddl/compat/opensolaris
-CFLAGS+=-I${SUNW}/uts/common/fs/zfs
-CFLAGS+=-I${SUNW}/uts/common/fs/zfs/lua
-CFLAGS+=-I${SUNW}/uts/common/zmod
-CFLAGS+=-I${SUNW}/uts/common
-CFLAGS+=-I${SYSDIR}
-CFLAGS+=-I${SUNW}/common/zfs
-CFLAGS+=-I${SUNW}/common/lz4
-CFLAGS+=-I${SUNW}/common
-CFLAGS+=-DBUILDING_ZFS
-CFLAGS.gcc+=-fms-extensions
-
-.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS.gcc+=-mminimal-toc
+.if defined(WITH_VFS_DEBUG) && ${WITH_VFS_DEBUG} == "true"
+# kernel must also be built with this option for this to work
+CFLAGS+= -DDEBUG_VFS_LOCKS
+.endif
+
+.if defined(WITH_GCOV) && ${WITH_GCOV} == "true"
+CFLAGS+= -fprofile-arcs -ftest-coverage
.endif
-.ifdef ZFS_DEBUG
-CFLAGS+=-DDEBUG=1
DEBUG_FLAGS=-g
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "arm"
+CFLAGS+= -DBITS_PER_LONG=32
+.else
+CFLAGS+= -DBITS_PER_LONG=64
+.endif
+
+SRCS= vnode_if.h device_if.h bus_if.h opt_global.h
+
+# avl
+SRCS+= avl.c
+
+#lua
+SRCS+= lapi.c \
+ lauxlib.c \
+ lbaselib.c \
+ lcode.c \
+ lcompat.c \
+ lcorolib.c \
+ lctype.c \
+ ldebug.c \
+ ldo.c \
+ lfunc.c \
+ lgc.c \
+ llex.c \
+ lmem.c \
+ lobject.c \
+ lopcodes.c \
+ lparser.c \
+ lstate.c \
+ lstring.c \
+ lstrlib.c \
+ ltable.c \
+ ltablib.c \
+ ltm.c \
+ lvm.c \
+ lzio.c
+
+#nvpair
+SRCS+= nvpair.c \
+ fnvpair.c \
+ nvpair_alloc_spl.c \
+ nvpair_alloc_fixed.c
+
+#os/freebsd/spl
+SRCS+= acl_common.c \
+ btree.c \
+ callb.c \
+ list.c \
+ spl_acl.c \
+ spl_cmn_err.c \
+ spl_dtrace.c \
+ spl_kmem.c \
+ spl_kstat.c \
+ spl_misc.c \
+ spl_policy.c \
+ spl_string.c \
+ spl_sunddi.c \
+ spl_sysevent.c \
+ spl_taskq.c \
+ spl_uio.c \
+ spl_vfs.c \
+ spl_vm.c \
+ spl_zone.c \
+ sha256c.c \
+ sha512c.c \
+ spl_procfs_list.c \
+ spl_zlib.c
+
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "arm"
+SRCS+= spl_atomic.c
.endif
+#os/freebsd/zfs
+SRCS+= abd_os.c \
+ crypto_os.c \
+ dmu_os.c \
+ hkdf.c \
+ kmod_core.c \
+ spa_os.c \
+ sysctl_os.c \
+ vdev_file.c \
+ vdev_label_os.c \
+ vdev_geom.c \
+ zfs_acl.c \
+ zfs_ctldir.c \
+ zfs_dir.c \
+ zfs_ioctl_os.c \
+ zfs_log.c \
+ zfs_replay.c \
+ zfs_vfsops.c \
+ zfs_vnops.c \
+ zfs_znode.c \
+ zio_crypt.c \
+ zvol_os.c
+
+#unicode
+SRCS+= uconv.c \
+ u8_textprep.c
+
+#zcommon
+SRCS+= zfeature_common.c \
+ zfs_comutil.c \
+ zfs_deleg.c \
+ zfs_fletcher.c \
+ zfs_fletcher_avx512.c \
+ zfs_fletcher_intel.c \
+ zfs_fletcher_sse.c \
+ zfs_fletcher_superscalar.c \
+ zfs_fletcher_superscalar4.c \
+ zfs_namecheck.c \
+ zfs_prop.c \
+ zpool_prop.c \
+ zprop_common.c
+
+#zfs
+SRCS+= abd.c \
+ aggsum.c \
+ arc.c \
+ arc_os.c \
+ blkptr.c \
+ bplist.c \
+ bpobj.c \
+ cityhash.c \
+ dbuf.c \
+ dbuf_stats.c \
+ bptree.c \
+ bqueue.c \
+ dataset_kstats.c \
+ ddt.c \
+ ddt_zap.c \
+ dmu.c \
+ dmu_diff.c \
+ dmu_object.c \
+ dmu_objset.c \
+ dmu_recv.c \
+ dmu_redact.c \
+ dmu_send.c \
+ dmu_traverse.c \
+ dmu_tx.c \
+ dmu_zfetch.c \
+ dnode.c \
+ dnode_sync.c \
+ dsl_dataset.c \
+ dsl_deadlist.c \
+ dsl_deleg.c \
+ dsl_bookmark.c \
+ dsl_dir.c \
+ dsl_crypt.c \
+ dsl_destroy.c \
+ dsl_pool.c \
+ dsl_prop.c \
+ dsl_scan.c \
+ dsl_synctask.c \
+ dsl_userhold.c \
+ fm.c \
+ gzip.c \
+ lzjb.c \
+ lz4.c \
+ metaslab.c \
+ mmp.c \
+ multilist.c \
+ objlist.c \
+ pathname.c \
+ range_tree.c \
+ refcount.c \
+ rrwlock.c \
+ sa.c \
+ sha256.c \
+ skein_zfs.c \
+ spa.c \
+ spa_boot.c \
+ spa_checkpoint.c \
+ spa_config.c \
+ spa_errlog.c \
+ spa_history.c \
+ spa_log_spacemap.c \
+ spa_misc.c \
+ spa_stats.c \
+ space_map.c \
+ space_reftree.c \
+ txg.c \
+ uberblock.c \
+ unique.c \
+ vdev.c \
+ vdev_cache.c \
+ vdev_indirect.c \
+ vdev_indirect_births.c \
+ vdev_indirect_mapping.c \
+ vdev_initialize.c \
+ vdev_label.c \
+ vdev_mirror.c \
+ vdev_missing.c \
+ vdev_queue.c \
+ vdev_raidz.c \
+ vdev_raidz_math.c \
+ vdev_raidz_math_scalar.c \
+ vdev_raidz_math_avx2.c \
+ vdev_raidz_math_avx512bw.c \
+ vdev_raidz_math_avx512f.c \
+ vdev_raidz_math_sse2.c \
+ vdev_raidz_math_ssse3.c \
+ vdev_removal.c \
+ vdev_root.c \
+ vdev_trim.c \
+ zap.c \
+ zap_leaf.c \
+ zap_micro.c \
+ zcp.c \
+ zcp_get.c \
+ zcp_global.c \
+ zcp_iter.c \
+ zcp_set.c \
+ zcp_synctask.c \
+ zfeature.c \
+ zfs_byteswap.c \
+ zfs_debug.c \
+ zfs_file_os.c \
+ zfs_fm.c \
+ zfs_fuid.c \
+ zfs_fuid_os.c \
+ zfs_ioctl.c \
+ zfs_onexit.c \
+ zfs_quota.c \
+ zfs_ratelimit.c \
+ zfs_rlock.c \
+ zfs_sa.c \
+ zil.c \
+ zio.c \
+ zio_checksum.c \
+ zio_compress.c \
+ zio_inject.c \
+ zle.c \
+ zrlock.c \
+ zthr.c \
+ zvol.c
+
.include <bsd.kmod.mk>
-CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
-
-CWARNFLAGS+=-Wno-missing-prototypes
-CWARNFLAGS+=-Wno-undef
-CWARNFLAGS+=-Wno-strict-prototypes
-CWARNFLAGS+=-Wno-cast-qual
-CWARNFLAGS+=-Wno-parentheses
-CWARNFLAGS+=-Wno-redundant-decls
-CWARNFLAGS+=-Wno-missing-braces
-CWARNFLAGS+=-Wno-uninitialized
-CWARNFLAGS+=-Wno-unused
-CWARNFLAGS+=-Wno-inline
-CWARNFLAGS+=-Wno-switch
-CWARNFLAGS+=-Wno-pointer-arith
+
+CFLAGS.gcc+= -Wno-pointer-to-int-cast
+
+CFLAGS.lapi.c= -Wno-cast-qual
+CFLAGS.lcompat.c= -Wno-cast-qual
+CFLAGS.lobject.c= -Wno-cast-qual
+CFLAGS.ltable.c= -Wno-cast-qual
+CFLAGS.lvm.c= -Wno-cast-qual
+CFLAGS.nvpair.c= -Wno-cast-qual
+CFLAGS.spl_string.c= -Wno-cast-qual
+CFLAGS.spl_vm.c= -Wno-cast-qual
+CFLAGS.spl_zlib.c= -Wno-cast-qual
+CFLAGS.abd.c= -Wno-cast-qual
+CFLAGS.zfs_log.c= -Wno-cast-qual
+CFLAGS.zfs_vnops.c= -Wno-pointer-arith
+CFLAGS.u8_textprep.c= -Wno-cast-qual
+CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fletcher_sse.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fletcher_avx512.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zprop_common.c= -Wno-cast-qual
+CFLAGS.ddt.c= -Wno-cast-qual
+CFLAGS.dmu.c= -Wno-cast-qual
+CFLAGS.dmu_traverse.c= -Wno-cast-qual
+CFLAGS.dsl_dir.c= -Wno-cast-qual
+CFLAGS.dsl_deadlist.c= -Wno-cast-qual
+CFLAGS.dsl_prop.c= -Wno-cast-qual
+CFLAGS.fm.c= -Wno-cast-qual
+CFLAGS.lz4.c= -Wno-cast-qual
+CFLAGS.spa.c= -Wno-cast-qual
+CFLAGS.spa_misc.c= -Wno-cast-qual
+CFLAGS.vdev_raidz.c= -Wno-cast-qual
+CFLAGS.vdev_raidz_math.c= -Wno-cast-qual
+CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual
+CFLAGS.vdev_raidz_math_avx2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
+CFLAGS.vdev_raidz_math_avx512f.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
+CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
+CFLAGS.zap_leaf.c= -Wno-cast-qual
+CFLAGS.zap_micro.c= -Wno-cast-qual
+CFLAGS.zcp.c= -Wno-cast-qual
+CFLAGS.zfs_fm.c= -Wno-cast-qual
+CFLAGS.zfs_ioctl.c= -Wno-cast-qual
+CFLAGS.zil.c= -Wno-cast-qual
+CFLAGS.zio.c= -Wno-cast-qual
+CFLAGS.zrlock.c= -Wno-cast-qual
Index: sys/modules/zfs/static_ccompile.h
===================================================================
--- /dev/null
+++ sys/modules/zfs/static_ccompile.h
@@ -0,0 +1,25 @@
+#ifndef _SPL_NVLIST_H_
+#define _SPL_NVLIST_H_
+
+#ifdef INVARIANTS
+#define ZFS_DEBUG
+#endif
+
+#define nvlist_add_nvlist spl_nvlist_add_nvlist
+#define nvlist_add_nvlist_array spl_nvlist_add_nvlist_array
+#define nvlist_add_nvpair spl_nvlist_add_nvpair
+#define nvlist_add_string spl_nvlist_add_string
+#define nvlist_add_string_array spl_nvlist_add_string_array
+#define nvlist_empty spl_nvlist_empty
+#define nvlist_exists spl_nvlist_exists
+#define nvlist_free spl_nvlist_free
+#define nvlist_next_nvpair spl_nvlist_next_nvpair
+#define nvlist_pack spl_nvlist_pack
+#define nvlist_prev_nvpair spl_nvlist_prev_nvpair
+#define nvlist_remove_nvpair spl_nvlist_remove_nvpair
+#define nvlist_size spl_nvlist_size
+#define nvlist_unpack spl_nvlist_unpack
+
+#define nvpair_type spl_nvpair_type
+#define nvpair_name spl_nvpair_name
+#endif
Index: sys/modules/zfs/zfs_config.h
===================================================================
--- /dev/null
+++ sys/modules/zfs/zfs_config.h
@@ -0,0 +1,701 @@
+/* zfs_config.h. Generated from zfs_config.h.in by configure. */
+/* zfs_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
+
+/* bio_end_io_t wants 1 arg */
+/* #undef HAVE_1ARG_BIO_END_IO_T */
+
+/* lookup_bdev() wants 1 arg */
+/* #undef HAVE_1ARG_LOOKUP_BDEV */
+
+/* submit_bio() wants 1 arg */
+/* #undef HAVE_1ARG_SUBMIT_BIO */
+
+/* bdi_setup_and_register() wants 2 args */
+/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */
+
+/* lookup_bdev() wants 2 args */
+/* #undef HAVE_2ARGS_LOOKUP_BDEV */
+
+/* vfs_getattr wants 2 args */
+/* #undef HAVE_2ARGS_VFS_GETATTR */
+
+/* zlib_deflate_workspacesize() wants 2 args */
+/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */
+
+/* bdi_setup_and_register() wants 3 args */
+/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */
+
+/* vfs_getattr wants 3 args */
+/* #undef HAVE_3ARGS_VFS_GETATTR */
+
+/* vfs_getattr wants 4 args */
+/* #undef HAVE_4ARGS_VFS_GETATTR */
+
+/* kernel has access_ok with 'type' parameter */
+/* #undef HAVE_ACCESS_OK_TYPE */
+
+/* posix_acl has refcount_t */
+/* #undef HAVE_ACL_REFCOUNT */
+
+/* Define if host toolchain supports AES */
+#define HAVE_AES 1
+
+/* Define if host toolchain supports AVX */
+#define HAVE_AVX 1
+
+/* Define if host toolchain supports AVX2 */
+#define HAVE_AVX2 1
+
+/* Define if host toolchain supports AVX512BW */
+#define HAVE_AVX512BW 1
+
+/* Define if host toolchain supports AVX512CD */
+#define HAVE_AVX512CD 1
+
+/* Define if host toolchain supports AVX512DQ */
+#define HAVE_AVX512DQ 1
+
+/* Define if host toolchain supports AVX512ER */
+#define HAVE_AVX512ER 1
+
+/* Define if host toolchain supports AVX512F */
+#define HAVE_AVX512F 1
+
+/* Define if host toolchain supports AVX512IFMA */
+#define HAVE_AVX512IFMA 1
+
+/* Define if host toolchain supports AVX512PF */
+#define HAVE_AVX512PF 1
+
+/* Define if host toolchain supports AVX512VBMI */
+#define HAVE_AVX512VBMI 1
+
+/* Define if host toolchain supports AVX512VL */
+#define HAVE_AVX512VL 1
+
+/* bio->bi_opf is defined */
+/* #undef HAVE_BIO_BI_OPF */
+
+/* bio->bi_status exists */
+/* #undef HAVE_BIO_BI_STATUS */
+
+/* bio has bi_iter */
+/* #undef HAVE_BIO_BVEC_ITER */
+
+/* bio_set_dev() is available */
+/* #undef HAVE_BIO_SET_DEV */
+
+/* bio_set_dev() GPL-only */
+/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */
+
+/* bio_set_op_attrs is available */
+/* #undef HAVE_BIO_SET_OP_ATTRS */
+
+/* blkdev_reread_part() exists */
+/* #undef HAVE_BLKDEV_REREAD_PART */
+
+/* blkg_tryget() is available */
+/* #undef HAVE_BLKG_TRYGET */
+
+/* blkg_tryget() GPL-only */
+/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */
+
+/* blk_alloc_queue() expects request function */
+/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */
+
+/* blk queue backing_dev_info is dynamic */
+/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */
+
+/* blk_queue_flag_clear() exists */
+/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */
+
+/* blk_queue_flag_set() exists */
+/* #undef HAVE_BLK_QUEUE_FLAG_SET */
+
+/* blk_queue_flush() is available */
+/* #undef HAVE_BLK_QUEUE_FLUSH */
+
+/* blk_queue_flush() is GPL-only */
+/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */
+
+/* blk_queue_secdiscard() is available */
+/* #undef HAVE_BLK_QUEUE_SECDISCARD */
+
+/* blk_queue_secure_erase() is available */
+/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */
+
+/* blk_queue_write_cache() exists */
+/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */
+
+/* blk_queue_write_cache() is GPL-only */
+/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */
+
+/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the Mac OS X function
+ CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* clear_inode() is available */
+/* #undef HAVE_CLEAR_INODE */
+
+/* dentry uses const struct dentry_operations */
+/* #undef HAVE_CONST_DENTRY_OPERATIONS */
+
+/* current_time() exists */
+/* #undef HAVE_CURRENT_TIME */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
+/* DECLARE_EVENT_CLASS() is available */
+/* #undef HAVE_DECLARE_EVENT_CLASS */
+
+/* sops->dirty_inode() wants flags */
+/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* d_make_root() is available */
+/* #undef HAVE_D_MAKE_ROOT */
+
+/* d_prune_aliases() is available */
+/* #undef HAVE_D_PRUNE_ALIASES */
+
+/* dops->d_revalidate() operation takes nameidata */
+/* #undef HAVE_D_REVALIDATE_NAMEIDATA */
+
+/* eops->encode_fh() wants child and parent inodes */
+/* #undef HAVE_ENCODE_FH_WITH_INODE */
+
+/* sops->evict_inode() exists */
+/* #undef HAVE_EVICT_INODE */
+
+/* fops->aio_fsync() exists */
+/* #undef HAVE_FILE_AIO_FSYNC */
+
+/* file_dentry() is available */
+/* #undef HAVE_FILE_DENTRY */
+
+/* file_inode() is available */
+/* #undef HAVE_FILE_INODE */
+
+/* iops->follow_link() cookie */
+/* #undef HAVE_FOLLOW_LINK_COOKIE */
+
+/* iops->follow_link() nameidata */
+/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */
+
+/* fops->fsync() with range */
+/* #undef HAVE_FSYNC_RANGE */
+
+/* fops->fsync() without dentry */
+/* #undef HAVE_FSYNC_WITHOUT_DENTRY */
+
+/* generic_start_io_acct()/generic_end_io_acct() available */
+/* #undef HAVE_GENERIC_IO_ACCT_3ARG */
+
+/* generic_start_io_acct()/generic_end_io_acct() 4 arg available */
+/* #undef HAVE_GENERIC_IO_ACCT_4ARG */
+
+/* generic_readlink is global */
+/* #undef HAVE_GENERIC_READLINK */
+
+/* generic_setxattr() exists */
+/* #undef HAVE_GENERIC_SETXATTR */
+
+/* generic_write_checks() takes kiocb */
+/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* get_disk_and_module() is available */
+/* #undef HAVE_GET_DISK_AND_MODULE */
+
+/* iops->get_link() cookie */
+/* #undef HAVE_GET_LINK_COOKIE */
+
+/* iops->get_link() delayed */
+/* #undef HAVE_GET_LINK_DELAYED */
+
+/* group_info->gid exists */
+/* #undef HAVE_GROUP_INFO_GID */
+
+/* Define if you have the iconv() function and it works. */
+#define HAVE_ICONV 1
+
+/* yes */
+/* #undef HAVE_INODE_LOCK_SHARED */
+
+/* inode_set_flags() exists */
+/* #undef HAVE_INODE_SET_FLAGS */
+
+/* inode_set_iversion() exists */
+/* #undef HAVE_INODE_SET_IVERSION */
+
+/* inode->i_*time's are timespec64 */
+/* #undef HAVE_INODE_TIMESPEC64_TIMES */
+
+/* timestamp_truncate() exists */
+/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* in_compat_syscall() is available */
+/* #undef HAVE_IN_COMPAT_SYSCALL */
+
+/* yes */
+/* #undef HAVE_IO_SCHEDULE_TIMEOUT */
+
+/* Define to 1 if you have the `issetugid' function. */
+#define HAVE_ISSETUGID 1
+
+/* kernel has kernel_fpu_* functions */
+/* #undef HAVE_KERNEL_FPU */
+
+/* kernel has asm/fpu/api.h */
+/* #undef HAVE_KERNEL_FPU_API_HEADER */
+
+/* kernel fpu internal */
+/* #undef HAVE_KERNEL_FPU_INTERNAL */
+
+/* uncached_acl_sentinel() exists */
+/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */
+
+/* kernel does stack verification */
+/* #undef HAVE_KERNEL_OBJTOOL */
+
+/* kernel_read() take loff_t pointer */
+/* #undef HAVE_KERNEL_READ_PPOS */
+
+/* timer_list.function gets a timer_list */
+/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */
+
+/* struct timer_list has a flags member */
+/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */
+
+/* timer_setup() is available */
+/* #undef HAVE_KERNEL_TIMER_SETUP */
+
+/* kernel_write() take loff_t pointer */
+/* #undef HAVE_KERNEL_WRITE_PPOS */
+
+/* kmem_cache_create_usercopy() exists */
+/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */
+
+/* kstrtoul() exists */
+/* #undef HAVE_KSTRTOUL */
+
+/* ktime_get_coarse_real_ts64() exists */
+/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */
+
+/* ktime_get_raw_ts64() exists */
+/* #undef HAVE_KTIME_GET_RAW_TS64 */
+
+/* kvmalloc exists */
+/* #undef HAVE_KVMALLOC */
+
+/* kernel has large stacks */
+/* #undef HAVE_LARGE_STACKS */
+
+/* Define if you have libaio */
+/* #undef HAVE_LIBAIO */
+
+/* Define if you have libblkid */
+/* #undef HAVE_LIBBLKID */
+
+/* Define if you have libssl */
+#define HAVE_LIBSSL 1
+
+/* Define to 1 if you have the `tirpc' library (-ltirpc). */
+/* #undef HAVE_LIBTIRPC */
+
+/* Define if you have libudev */
+/* #undef HAVE_LIBUDEV */
+
+/* Define if udev_device_get_is_initialized is available */
+/* #undef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED */
+
+/* Define if you have libuuid */
+/* #undef HAVE_LIBUUID */
+
+/* lseek_execute() is available */
+/* #undef HAVE_LSEEK_EXECUTE */
+
+/* makedev() is declared in sys/mkdev.h */
+/* #undef HAVE_MAKEDEV_IN_MKDEV */
+
+/* makedev() is declared in sys/sysmacros.h */
+/* #undef HAVE_MAKEDEV_IN_SYSMACROS */
+
+/* Noting that make_request_fn() returns blk_qc_t */
+/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */
+
+/* Noting that make_request_fn() returns void */
+/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* iops->create()/mkdir()/mknod() take umode_t */
+/* #undef HAVE_MKDIR_UMODE_T */
+
+/* Define to 1 if you have the `mlockall' function. */
+#define HAVE_MLOCKALL 1
+
+/* Define if host toolchain supports MOVBE */
+#define HAVE_MOVBE 1
+
+/* new_sync_read()/new_sync_write() are available */
+/* #undef HAVE_NEW_SYNC_READ */
+
+/* iops->getattr() takes a path */
+/* #undef HAVE_PATH_IOPS_GETATTR */
+
+/* Define if host toolchain supports PCLMULQDQ */
+#define HAVE_PCLMULQDQ 1
+
+/* posix_acl_chmod() exists */
+/* #undef HAVE_POSIX_ACL_CHMOD */
+
+/* posix_acl_from_xattr() needs user_ns */
+/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */
+
+/* posix_acl_release() is available */
+/* #undef HAVE_POSIX_ACL_RELEASE */
+
+/* posix_acl_release() is GPL-only */
+/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */
+
+/* posix_acl_valid() wants user namespace */
+/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */
+
+/* proc_ops structure exists */
+/* #undef HAVE_PROC_OPS_STRUCT */
+
+/* iops->put_link() cookie */
+/* #undef HAVE_PUT_LINK_COOKIE */
+
+/* iops->put_link() delayed */
+/* #undef HAVE_PUT_LINK_DELAYED */
+
+/* iops->put_link() nameidata */
+/* #undef HAVE_PUT_LINK_NAMEIDATA */
+
+/* If available, contains the Python version number currently in use. */
+#define HAVE_PYTHON "3.7"
+
+/* qat is enabled and existed */
+/* #undef HAVE_QAT */
+
+/* iops->rename() wants flags */
+/* #undef HAVE_RENAME_WANTS_FLAGS */
+
+/* REQ_DISCARD is defined */
+/* #undef HAVE_REQ_DISCARD */
+
+/* REQ_FLUSH is defined */
+/* #undef HAVE_REQ_FLUSH */
+
+/* REQ_OP_DISCARD is defined */
+/* #undef HAVE_REQ_OP_DISCARD */
+
+/* REQ_OP_FLUSH is defined */
+/* #undef HAVE_REQ_OP_FLUSH */
+
+/* REQ_OP_SECURE_ERASE is defined */
+/* #undef HAVE_REQ_OP_SECURE_ERASE */
+
+/* REQ_PREFLUSH is defined */
+/* #undef HAVE_REQ_PREFLUSH */
+
+/* struct rw_semaphore has member activity */
+/* #undef HAVE_RWSEM_ACTIVITY */
+
+/* struct rw_semaphore has atomic_long_t member count */
+/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */
+
+/* linux/sched/signal.h exists */
+/* #undef HAVE_SCHED_SIGNAL_HEADER */
+
+/* setattr_prepare() is available */
+/* #undef HAVE_SETATTR_PREPARE */
+
+/* iops->set_acl() exists */
+/* #undef HAVE_SET_ACL */
+
+/* set_cached_acl() is usable */
+/* #undef HAVE_SET_CACHED_ACL_USABLE */
+
+/* struct shrink_control exists */
+/* #undef HAVE_SHRINK_CONTROL_STRUCT */
+
+/* new shrinker callback wants 2 args */
+/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */
+
+/* ->count_objects exists */
+/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */
+
+/* Define if host toolchain supports SSE */
+#define HAVE_SSE 1
+
+/* Define if host toolchain supports SSE2 */
+#define HAVE_SSE2 1
+
+/* Define if host toolchain supports SSE3 */
+#define HAVE_SSE3 1
+
+/* Define if host toolchain supports SSE4.1 */
+#define HAVE_SSE4_1 1
+
+/* Define if host toolchain supports SSE4.2 */
+#define HAVE_SSE4_2 1
+
+/* Define if host toolchain supports SSSE3 */
+#define HAVE_SSSE3 1
+
+/* STACK_FRAME_NON_STANDARD is defined */
+/* #undef HAVE_STACK_FRAME_NON_STANDARD */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* super_setup_bdi_name() exits */
+/* #undef HAVE_SUPER_SETUP_BDI_NAME */
+
+/* super_block->s_user_ns exists */
+/* #undef HAVE_SUPER_USER_NS */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* i_op->tmpfile() exists */
+/* #undef HAVE_TMPFILE */
+
+/* totalhigh_pages() exists */
+/* #undef HAVE_TOTALHIGH_PAGES */
+
+/* kernel has totalram_pages() */
+/* #undef HAVE_TOTALRAM_PAGES_FUNC */
+
+/* kernel has __kernel_fpu_* functions */
+/* #undef HAVE_UNDERSCORE_KERNEL_FPU */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* iops->getattr() takes a vfsmount */
+/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */
+
+/* aops->direct_IO() uses iovec */
+/* #undef HAVE_VFS_DIRECT_IO_IOVEC */
+
+/* aops->direct_IO() uses iov_iter without rw */
+/* #undef HAVE_VFS_DIRECT_IO_ITER */
+
+/* aops->direct_IO() uses iov_iter with offset */
+/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */
+
+/* aops->direct_IO() uses iov_iter with rw and offset */
+/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */
+
+/* fops->iterate() is available */
+/* #undef HAVE_VFS_ITERATE */
+
+/* fops->iterate_shared() is available */
+/* #undef HAVE_VFS_ITERATE_SHARED */
+
+/* fops->readdir() is available */
+/* #undef HAVE_VFS_READDIR */
+
+/* fops->read/write_iter() are available */
+/* #undef HAVE_VFS_RW_ITERATE */
+
+/* __vmalloc page flags exists */
+/* #undef HAVE_VMALLOC_PAGE_KERNEL */
+
+/* yes */
+/* #undef HAVE_WAIT_ON_BIT_ACTION */
+
+/* wait_queue_entry_t exists */
+/* #undef HAVE_WAIT_QUEUE_ENTRY_T */
+
+/* wq_head->head and wq_entry->entry exist */
+/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */
+
+/* xattr_handler->get() wants dentry */
+/* #undef HAVE_XATTR_GET_DENTRY */
+
+/* xattr_handler->get() wants both dentry and inode */
+/* #undef HAVE_XATTR_GET_DENTRY_INODE */
+
+/* xattr_handler->get() wants xattr_handler */
+/* #undef HAVE_XATTR_GET_HANDLER */
+
+/* xattr_handler has name */
+/* #undef HAVE_XATTR_HANDLER_NAME */
+
+/* xattr_handler->list() wants dentry */
+/* #undef HAVE_XATTR_LIST_DENTRY */
+
+/* xattr_handler->list() wants xattr_handler */
+/* #undef HAVE_XATTR_LIST_HANDLER */
+
+/* xattr_handler->list() wants simple */
+/* #undef HAVE_XATTR_LIST_SIMPLE */
+
+/* xattr_handler->set() wants dentry */
+/* #undef HAVE_XATTR_SET_DENTRY */
+
+/* xattr_handler->set() wants both dentry and inode */
+/* #undef HAVE_XATTR_SET_DENTRY_INODE */
+
+/* xattr_handler->set() wants xattr_handler */
+/* #undef HAVE_XATTR_SET_HANDLER */
+
+/* Define if you have zlib */
+#define HAVE_ZLIB 1
+
+/* __posix_acl_chmod() exists */
+/* #undef HAVE___POSIX_ACL_CHMOD */
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST
+
+/* kernel exports FPU functions */
+/* #undef KERNEL_EXPORTS_X86_FPU */
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* make_request_fn() return type */
+/* #undef MAKE_REQUEST_FN_RET */
+
+/* hardened module_param_call */
+/* #undef MODULE_PARAM_CALL_CONST */
+
+/* struct shrink_control has nid */
+/* #undef SHRINK_CONTROL_HAS_NID */
+
+/* Defined for legacy compatibility. */
+#define SPL_META_ALIAS ZFS_META_ALIAS
+
+/* Defined for legacy compatibility. */
+#define SPL_META_RELEASE ZFS_META_RELEASE
+
+/* Defined for legacy compatibility. */
+#define SPL_META_VERSION ZFS_META_VERSION
+
+/* True if ZFS is to be compiled for a FreeBSD system */
+#define SYSTEM_FREEBSD 1
+
+/* True if ZFS is to be compiled for a Linux system */
+/* #undef SYSTEM_LINUX */
+
+/* zfs debugging enabled */
+/* #define ZFS_DEBUG 1 */
+
+/* /dev/zfs minor */
+/* #undef ZFS_DEVICE_MINOR */
+
+/* enum node_stat_item contains NR_FILE_PAGES */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */
+
+/* enum node_stat_item contains NR_INACTIVE_ANON */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */
+
+/* enum node_stat_item contains NR_INACTIVE_FILE */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */
+
+/* enum node_stat_item contains NR_SLAB_RECLAIMABLE */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE */
+
+/* enum zone_stat_item contains NR_FILE_PAGES */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */
+
+/* enum zone_stat_item contains NR_INACTIVE_ANON */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */
+
+/* enum zone_stat_item contains NR_INACTIVE_FILE */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */
+
+/* enum zone_stat_item contains NR_SLAB_RECLAIMABLE */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_SLAB_RECLAIMABLE */
+
+/* global_node_page_state() exists */
+/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */
+
+/* global_zone_page_state() exists */
+/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */
+
+/* Define to 1 if GPL-only symbols can be used */
+/* #undef ZFS_IS_GPL_COMPATIBLE */
+
+/* Define the project alias string. */
+#define ZFS_META_ALIAS "zfs-0.8.0-1"
+
+/* Define the project author. */
+#define ZFS_META_AUTHOR "OpenZFS on Linux"
+
+/* Define the project release date. */
+/* #undef ZFS_META_DATA */
+
+/* Define the maximum compatible kernel version. */
+#define ZFS_META_KVER_MAX "5.6"
+
+/* Define the minimum compatible kernel version. */
+#define ZFS_META_KVER_MIN "3.10"
+
+/* Define the project license. */
+#define ZFS_META_LICENSE "CDDL"
+
+/* Define the libtool library 'age' version information. */
+/* #undef ZFS_META_LT_AGE */
+
+/* Define the libtool library 'current' version information. */
+/* #undef ZFS_META_LT_CURRENT */
+
+/* Define the libtool library 'revision' version information. */
+/* #undef ZFS_META_LT_REVISION */
+
+/* Define the project name. */
+#define ZFS_META_NAME "zfs"
+
+/* Define the project release. */
+#define ZFS_META_RELEASE "1"
+
+/* Define the project version. */
+#define ZFS_META_VERSION "0.8.0"
+
Index: sys/modules/zfs/zfs_gitrev.h
===================================================================
--- /dev/null
+++ sys/modules/zfs/zfs_gitrev.h
@@ -0,0 +1 @@
+#define ZFS_META_GITREV "zfs-0.7.0-2997-g7ae36732f"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 1:18 PM (2 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28745646
Default Alt Text
D25477.1779196712.diff (185 KB)
Attached To
Mode
D25477: Kernel build changes for openzfs vendor import
Attached
Detach File
Event Timeline
Log In to Comment