Home | History | Annotate | only in /src/external/cddl
History log of /src/external/cddl
RevisionDateAuthorComments
 1.4 17-Sep-2017  sevan Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.

ok riastradh
 1.3 25-Mar-2014  ozaki-r branches: 1.3.18;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.
 1.2 25-Feb-2010  darran branches: 1.2.6; 1.2.12;
DTrace: have DTrace build with out requiring MKZFS=yes.
 1.1 05-Oct-2009  haad Add cddl directory to external build framework. build things from osnet dir
only when MKZFS variable is set.
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.18.1 23-Sep-2017  snj Pull up following revision(s) (requested by sevan in ticket #289):
distrib/sets/lists/base/mi: revision 1.1161
external/cddl/Makefile: revision 1.4
external/cddl/dtracetoolkit/Makefile: revision 1.1
external/cddl/dtracetoolkit/dist/Makefile: revision 1.1
Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.
ok riastradh
 1.1 17-Sep-2017  sevan branches: 1.1.2;
Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.

ok riastradh
 1.1.2.2 23-Sep-2017  snj Pull up following revision(s) (requested by sevan in ticket #289):
distrib/sets/lists/base/mi: revision 1.1161
external/cddl/Makefile: revision 1.4
external/cddl/dtracetoolkit/Makefile: revision 1.1
external/cddl/dtracetoolkit/dist/Makefile: revision 1.1
Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.
ok riastradh
 1.1.2.1 17-Sep-2017  snj file Makefile was added on branch netbsd-8 on 2017-09-23 17:50:43 +0000
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 25-Jun-2020  sevan space, tab
 1.1 17-Sep-2017  sevan branches: 1.1.2;
Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.

ok riastradh
 1.1.2.2 23-Sep-2017  snj Pull up following revision(s) (requested by sevan in ticket #289):
distrib/sets/lists/base/mi: revision 1.1161
external/cddl/Makefile: revision 1.4
external/cddl/dtracetoolkit/Makefile: revision 1.1
external/cddl/dtracetoolkit/dist/Makefile: revision 1.1
Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.
ok riastradh
 1.1.2.1 17-Sep-2017  snj file Makefile was added on branch netbsd-8 on 2017-09-23 17:50:43 +0000
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 12-Dec-2016  christos simple path fixes
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos branches: 1.1.1.1.2;
Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1.1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 12-Dec-2016  christos simple path fixes
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos branches: 1.1.1.1.2;
Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1.1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2 11-Jan-2026  wiz execsnoop: remove -J and trailing whitespace

-J is for jails, since this comes from FreeBSD; however it broke
-a|-A.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 12-Dec-2016  christos simple path fixes
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos branches: 1.1.1.1.2;
Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1.1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 01-Oct-2018  sevan Sync with version on Brendan's site
http://www.brendangregg.com/DTrace/iosnoop
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos branches: 1.1.1.1.14; 1.1.1.1.16;
Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1.1.1.16.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.1.14.1 20-Oct-2018  pgoyette Sync with head
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 12-Dec-2016  christos simple path fixes
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos branches: 1.1.1.1.2;
Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1.1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2 07-Oct-2015  christos make this kind of work.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.2 29-Sep-2018  sevan Fix comment markers.
https://github.com/opendtrace/toolkit/issues/11
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos branches: 1.1.1.1.14; 1.1.1.1.16;
Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1.1.1.16.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.1.14.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.6 26-Jun-2020  wiz Sort options and their descriptions.
Replace tab with space in table.
Make non-standard section subsections.
Comment out Xr to procsystime(1) which does not exist on NetBSD.
 1.5 25-Jun-2020  uwe Try to improve markup.
 1.4 25-Jun-2020  sevan Fix column layout
 1.3 24-Jun-2020  sevan No truss here
 1.2 24-Jun-2020  sevan mdocify
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.5 26-Jun-2020  wiz Sort options and their descriptions.
Replace tab with space in table.
Make non-standard section subsections.
Comment out Xr to procsystime(1) which does not exist on NetBSD.
 1.4 25-Jun-2020  uwe Try to improve markup.
 1.3 25-Jun-2020  sevan Fix column layout
 1.2 24-Jun-2020  sevan mdocify
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 30-Sep-2015  christos branches: 1.1.1;
Initial revision
 1.1.1.1 30-Sep-2015  christos Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 09-Mar-2014  christos branches: 1.2.4; 1.2.8;
Tidy up paths.
 1.1 09-Mar-2014  christos Merge ctf build rules.
 1.2.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 09-Mar-2014  tls file Makefile.ctf was added on branch tls-maxphys on 2014-08-19 23:52:21 +0000
 1.2.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.4.1 09-Mar-2014  yamt file Makefile.ctf was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.6 13-Apr-2021  mrg use -fcommon here.
 1.5 29-Jun-2019  sevan Add rcsid
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 23-Jan-2016  christos branches: 1.3.14;
Define _KERNTYPES for things that need it.
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.10 13-Apr-2021  mrg use -fcommon here.
 1.9 22-Jun-2019  hannken Sync with upstream r315983.

FreeBSD splits "zfs_context.h" into:
"lib/libzpool/common/sys/zfs_context.h" for user space
"uts/common/fs/zfs/sys/zfs_context.h" for kernel space

Do the same here, move and sync "sys/sys/zfs_context.h" to
"dist/lib/libzpool/common/sys/zfs_context.h" and
"dist/uts/common/fs/zfs/sys/zfs_context.h".

Change "Makefile.zfs" to search includes from "dist/lib"
before "dist/uts" so we get the right include file.

Adapt "usr.sbin/fstyp/Makefile" to get the right include file.
 1.8 07-Jun-2018  kamil branches: 1.8.2;
Replace HAVE_GCC with ACTIVE_CC == gcc checks

Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
 1.7 06-Jun-2018  kamil Swap conditions HAVE_LLVM -> HAVE_GCC
 1.6 06-Jun-2018  kamil Make cddl/osnet/Makefile.zfs compatible with MKLLVM=yes

Clang/LLVM does not recognize:
- -Wno-discarded-qualifiers

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 05-Sep-2012  riz branches: 1.4.30;
Don't build with debugging (-g) by default.
 1.3 13-Jan-2011  haad branches: 1.3.6;
Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is
enabled. Fix header assert conflicts + bump WARNS for some libs.
 1.2 28-Feb-2010  haad Add missing -I definition.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.6.1 30-Oct-2012  yamt sync with head
 1.4.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 11-Dec-2025  andvar Fix various typos in comments.
 1.3 30-Nov-2010  haad Update TODO for zfs add new tasks, list some know issues and mark some done stuff.

iRequested by: agc@
 1.2 06-Oct-2009  haad iMark done tasks as done and move *at implementation task to post-import phase.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4 09-Apr-2016  riastradh Add autounload logic to dtrace module prototype.
 1.3 09-Mar-2015  riastradh Rewrite dtrace provider prototype from scratch.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.10 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.9 08-May-2020  ad branches: 1.9.8;
Run Solaris cyclics from statclock() so dtrace isn't locked out by IPL_SCHED
(assuming the machine has a separate statclock() which almost all don't).
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 01-Feb-2017  chs branches: 1.7.10;
put back the include of dtrace_bsd.h, it actually is needed.
 1.6 01-Feb-2017  chs fix this module to depend on the solaris module rather than the dtrace module.
remove an unneeded header.
 1.5 09-Apr-2016  riastradh branches: 1.5.2; 1.5.4;
Prevent autounload while cyclics are still in use.
 1.4 02-Dec-2012  chs adapt the cyclic module and profile dtrace provider to netbsd.
for now, just hook the cyclic callback into hardclock().
 1.3 02-Dec-2012  chs update cyclic module to the freebsd 8-stable version as of svn r219520.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.12.1 25-Feb-2013  tls resync with head
 1.2.6.1 16-Jan-2013  yamt sync with (a bit old) head
 1.5.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.5.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.8.1 02-Aug-2025  perseant Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 05-Mar-2014  ozaki-r branches: 1.1.4; 1.1.8; 1.1.28;
Add cyclic_machdep.c for ARM

The code is still almost same as i386's one.
 1.1.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 05-Mar-2014  tls file cyclic_machdep.c was added on branch tls-maxphys on 2014-08-19 23:52:21 +0000
 1.1.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.1 05-Mar-2014  yamt file cyclic_machdep.c was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 02-Dec-2012  chs branches: 1.4.28;
adapt the cyclic module and profile dtrace provider to netbsd.
for now, just hook the cyclic callback into hardclock().
 1.3 02-Dec-2012  chs update cyclic module to the freebsd 8-stable version as of svn r219520.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.12.1 25-Feb-2013  tls resync with head
 1.2.6.1 16-Jan-2013  yamt sync with (a bit old) head
 1.4.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 29-Mar-2021  simonb Add cyclic_machdep.c for MIPS

The code is identical to i386's one.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 05-Mar-2014  ozaki-r branches: 1.8.24;
Use native atomic function instead of DTrace's own one

So we don't need to implement it for each architecture.

This change is from FreeBSD (not as-is though).
 1.7 04-Mar-2014  ozaki-r Fix wrong conditional statement in dtrace_debug_output

Reported in PR kern/48547 by ozaki-r.
 1.6 14-Apr-2013  christos add a stub for arm
 1.5 16-Jun-2012  chs branches: 1.5.2;
reduce diff to freebsd:
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
 1.4 31-Aug-2011  christos branches: 1.4.2;
fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
 1.3 13-Mar-2010  christos make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.5.2.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 23-Jun-2013  tls resync from head
 1.8.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.7 06-Jun-2018  kamil branches: 1.7.2;
Correct compilation of osnet/dev/dtrace/dtrace_hacks.c under Clang

Use __UNCONST() to remove const from an argument.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 23-Jun-2016  pgoyette branches: 1.5.14;
One more removal of a redefined symbol while loading dtrace module.

Should finish the issues with PR kern/51265
 1.4 23-Jun-2016  pgoyette Import fix from FreeBSD - see [1], [2] references below...

Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
 1.3 28-Feb-2010  darran branches: 1.3.24;
DTrace: enable access to kernel space for DTrace scripts.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.24.1 10-Jul-2016  martin Pull up following revision(s) (requested by pgoyette in ticket #1189):
external/cddl/osnet/sys/kern/string.c: revision 1.3
external/cddl/osnet/dev/dtrace/dtrace_hacks.c: revision 1.5
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.32
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.6
Import fix from FreeBSD - see [1], [2] references below...
Fix DTrace's panic() action.
It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call
vpanic(9)
directly.
Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".
[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module. Removes another 'redefined symbol'
error when loading the module.
Related to PR kern/51265
One more removal of a redefined symbol while loading dtrace module.
Should finish the issues with PR kern/51265
 1.5.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 30-Sep-2015  christos branches: 1.6.14;
recognize the proc provider as belonging to sdt
 1.5 19-Jun-2015  riastradh Fix dtrace module autoload.
 1.4 03-Mar-2013  christos branches: 1.4.8;
autoload tracing modules.
 1.3 31-Aug-2011  christos branches: 1.3.2; 1.3.8;
fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.8.1 23-Jun-2013  tls resync from head
 1.3.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.8.1 07-Nov-2015  riz Pull up following revision(s) (requested by riastradh in ticket #1003):
external/cddl/osnet/dev/dtrace/dtrace_ioctl.c: revision 1.5
Fix dtrace module autoload.
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 23-Jul-2019  hannken Create "dtrace_taskq" here like FreeBSD does.

PR kern/54397: Panic when loading a DTrace module whilst DTrace is running
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 31-Aug-2011  christos branches: 1.3.40;
fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.40.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7 28-Mar-2022  riastradh driver(9): devsw_detach never fails. Make it return void.

Prune a whole lotta dead branches as a result of this. (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back. To be
cleaned up in subsequent commits...)

XXX kernel ABI change to devsw_detach signature requires bump
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 28-Nov-2015  pgoyette branches: 1.5.14;
When loading the module, if devsw_attach() fails, call dtrace_unload()
to undo the effects of dtrace_load(). And if dtrace_unload() fails,
panic (since we can't get the system back to its earlier stable state).

When unloading the module, call devsw_detach() first, to lock out any
new access. Then call dtrace_unload(). If dgtrace_unload() fails,
reattach the devsw, and if that fails, panic.

Implements fixes described in PR kern/43032
 1.4 26-Feb-2015  ozaki-r Fix module unload of dtrace, sdt and fbt

- Don't unload when there are users of dtrace
- Forbid auto unloading (not supported for now)

PR 49695
 1.3 13-Mar-2010  christos make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 23-Apr-2010  ahoka branches: 1.3.44;
Remove a couple of zero length kmem_frees.

It should fix at least one crash when unloading the dtrace module,
possibly many others.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 26-Feb-2015  ozaki-r branches: 1.6.14;
Fix module unload of dtrace, sdt and fbt

- Don't unload when there are users of dtrace
- Forbid auto unloading (not supported for now)

PR 49695
 1.5 26-Jul-2011  yamt fix a kmem_alloc/free size mismatch
 1.4 23-Apr-2010  ahoka Add a missing parentheses.
 1.3 23-Apr-2010  ahoka Remove a couple of zero length kmem_frees.

It should fix at least one crash when unloading the dtrace module,
possibly many others.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 03-Dec-2019  jmcneill branches: 1.1.2; 1.1.6;
dtrace: add support for aarch64
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 03-Dec-2019  martin file dtrace_asm.S was added on branch phil-wifi on 2020-04-13 07:56:35 +0000
 1.1.2.2 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.2.1 03-Dec-2019  martin file dtrace_asm.S was added on branch netbsd-9 on 2019-12-09 15:19:30 +0000
 1.2 12-Feb-2020  riastradh branches: 1.2.4;
Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.
 1.1 03-Dec-2019  jmcneill branches: 1.1.2;
dtrace: add support for aarch64
 1.1.2.3 12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #701):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
sys/modules/cyclic/Makefile: revision 1.5
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
sys/arch/aarch64/aarch64/vectors.S: revision 1.10
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
sys/arch/aarch64/include/cpu.h: revision 1.20
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

stp x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue. In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.
 1.1.2.2 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.2.1 03-Dec-2019  martin file dtrace_isa.c was added on branch netbsd-9 on 2019-12-09 15:19:30 +0000
 1.2.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.4.1 12-Feb-2020  martin file dtrace_isa.c was added on branch phil-wifi on 2020-04-13 07:56:35 +0000
 1.6 17-Apr-2023  skrll (missed in pervious commit)

Rename VM_KERNEL_IO_ADDRESS to VM_KERNEL_IO_BASE to match RISC-V

It's less letters, matches other similar variables and will help with
sharing code between the two architectures.

NFCI.
 1.5 06-Apr-2021  simonb sizeof(*var) instead of sizeof(type)
Call kmem_free() with size of data being freed.
 1.4 12-Nov-2020  rin One more catch up with ``aarch64 is not mips'' change.
Fix evbarm-aarch64 build.
 1.3 12-Feb-2020  riastradh branches: 1.3.4;
Change the address ranges that aarch64 considers toxic for dtrace.

`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)
 1.2 12-Feb-2020  riastradh Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!
 1.1 03-Dec-2019  jmcneill branches: 1.1.2;
dtrace: add support for aarch64
 1.1.2.3 12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #701):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
sys/modules/cyclic/Makefile: revision 1.5
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
sys/arch/aarch64/aarch64/vectors.S: revision 1.10
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
sys/arch/aarch64/include/cpu.h: revision 1.20
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

stp x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue. In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.
 1.1.2.2 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.2.1 03-Dec-2019  martin file dtrace_subr.c was added on branch netbsd-9 on 2019-12-09 15:19:30 +0000
 1.3.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3.4.1 12-Feb-2020  martin file dtrace_subr.c was added on branch phil-wifi on 2020-04-13 07:56:35 +0000
 1.1 03-Dec-2019  jmcneill branches: 1.1.2; 1.1.6;
dtrace: add support for aarch64
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 03-Dec-2019  martin file regset.h was added on branch phil-wifi on 2020-04-13 07:56:35 +0000
 1.1.2.2 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.2.1 03-Dec-2019  martin file regset.h was added on branch netbsd-9 on 2019-12-09 15:19:30 +0000
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 18-Jul-2011  christos branches: 1.3.40;
fix uninitialized gcc variables
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.40.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9 03-Nov-2023  chs dtrace: add support for SMAP

Add support in dtrace for SMAP, so that actions like copyinstr() work.
It would be better if dtrace could use the SMAP_* hotpatch macros directly,
but the hotpatching code does not currently operate on kernel modules,
so we'll use some tiny functions in the base kernel for now.
 1.8 28-May-2018  chs branches: 1.8.12;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 27-Feb-2017  chs branches: 1.7.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.6 23-Jun-2016  pgoyette branches: 1.6.2; 1.6.4;
Import fix from FreeBSD - see [1], [2] references below...

Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
 1.5 18-May-2015  christos don't re-define END() now that amd64 defines it
 1.4 11-Jun-2012  chs branches: 1.4.10;
make dtrace work on amd64.
 1.3 13-Mar-2010  christos branches: 1.3.6; 1.3.8;
make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.8.1 22-Nov-2012  riz Pull up following revision(s) (requested by chs in ticket #690):
external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c: revision 1.4
sys/arch/amd64/include/Makefile.inc: revision 1.4
sys/arch/amd64/include/pmap.h: revision 1.33
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c: revision 1.6
sys/arch/amd64/include/asm.h: revision 1.15
sys/arch/amd64/amd64/genassym.cf: revision 1.51
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.4
make dtrace work on amd64.
allow more space for modules.
 1.3.6.1 30-Oct-2012  yamt sync with head
 1.4.10.1 10-Jul-2016  martin Pull up following revision(s) (requested by pgoyette in ticket #1189):
external/cddl/osnet/sys/kern/string.c: revision 1.3
external/cddl/osnet/dev/dtrace/dtrace_hacks.c: revision 1.5
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.32
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.6
Import fix from FreeBSD - see [1], [2] references below...
Fix DTrace's panic() action.
It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call
vpanic(9)
directly.
Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".
[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module. Removes another 'redefined symbol'
error when loading the module.
Related to PR kern/51265
One more removal of a redefined symbol while loading dtrace module.
Should finish the issues with PR kern/51265
 1.6.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.6.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.12.1 14-Oct-2024  martin Apply patch, requested by chs in ticket #975:

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c (apply patch)

dtrace: add support for SMAP.

This is the equivalvent of

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S 1.9
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S 1.8
sys/arch/amd64/amd64/cpufunc.S 1.67
sys/arch/i386/i386/cpufunc.S 1.51

adapted to the netbsd-10 branch.
 1.10 16-Aug-2018  christos get rid of kernelbase
 1.9 12-Aug-2018  christos handle variable kernel vm min address
 1.8 27-Jul-2018  maxv Replace KERN_BASE by VM_MIN_KERNEL_ADDRESS. Also add XXX on INKERNEL.
 1.7 28-May-2018  chs branches: 1.7.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 27-Feb-2017  chs branches: 1.6.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.5 14-May-2016  chs branches: 1.5.2; 1.5.4;
apply the ustack() parts of freebsd r211608:

r211608 | rpaulo | 2010-08-22 03:53:32 -0700 (Sun, 22 Aug 2010) | 8 lines

Kernel DTrace support for:
o uregs (sson@)
o ustack (sson@)
o /dev/dtrace/helper device (needed for USDT probes)

The work done by me was:
Sponsored by: The FreeBSD Foundation

plus a few netbsd-specific tweaks from me.
fixes PR 50790.
 1.4 11-Jun-2012  chs make dtrace work on amd64.
 1.3 13-Mar-2010  christos branches: 1.3.6; 1.3.8;
make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.8.1 22-Nov-2012  riz Pull up following revision(s) (requested by chs in ticket #690):
external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c: revision 1.4
sys/arch/amd64/include/Makefile.inc: revision 1.4
sys/arch/amd64/include/pmap.h: revision 1.33
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c: revision 1.6
sys/arch/amd64/include/asm.h: revision 1.15
sys/arch/amd64/amd64/genassym.cf: revision 1.51
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.4
make dtrace work on amd64.
allow more space for modules.
 1.3.6.1 30-Oct-2012  yamt sync with head
 1.5.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.5.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.6.10.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6.10.2 28-Jul-2018  pgoyette Sync with HEAD
 1.6.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.15 06-Apr-2021  simonb branches: 1.15.6;
sizeof(*var) instead of sizeof(type)
 1.14 08-Nov-2019  hannken dtrace_trap() gets called from alltraps() -> trap() with interrupts enabled
so we cannot assert for interrupts disabled here.

Should fix PR kern/54603: kernel panic when running dtruss
 1.13 05-Jul-2019  hannken branches: 1.13.2;
Change dtrace toxic range to "0 .. VM_MIN_KERNEL_ADDRESS_DEFAULT",
the direct map may be mapped below "VM_MIN_KERNEL_ADDRESS".
 1.12 12-Jan-2019  hannken There is no such function read_rflags(), probably meant x86_read_flags().
 1.11 16-Aug-2018  christos get rid of kernelbase
 1.10 05-Jun-2018  christos branches: 1.10.2;
remove <sys/proc.h> done in the dtrace header now.
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 27-Feb-2017  chs branches: 1.8.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.7 16-Jun-2012  chs branches: 1.7.14; 1.7.18;
reduce diff to freebsd:
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
 1.6 11-Jun-2012  chs make dtrace work on amd64.
 1.5 31-Aug-2011  christos branches: 1.5.2; 1.5.4;
fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
 1.4 23-Apr-2010  ahoka Remove a couple of zero length kmem_frees.

It should fix at least one crash when unloading the dtrace module,
possibly many others.
 1.3 13-Mar-2010  christos make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.5.4.1 22-Nov-2012  riz Pull up following revision(s) (requested by chs in ticket #690):
external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c: revision 1.4
sys/arch/amd64/include/Makefile.inc: revision 1.4
sys/arch/amd64/include/pmap.h: revision 1.33
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c: revision 1.6
sys/arch/amd64/include/asm.h: revision 1.15
sys/arch/amd64/amd64/genassym.cf: revision 1.51
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.4
make dtrace work on amd64.
allow more space for modules.
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.7.18.1 21-Apr-2017  bouyer Sync with HEAD
 1.7.14.1 20-Mar-2017  pgoyette Sync with HEAD
 1.8.10.3 18-Jan-2019  pgoyette Synch with HEAD
 1.8.10.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.8.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.10.2.1 10-Jun-2019  christos Sync with HEAD
 1.13.2.1 10-Nov-2019  martin Pull up following revision(s) (requested by hannken in ticket #410):

external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c: revision 1.14

dtrace_trap() gets called from alltraps() -> trap() with interrupts enabled
so we cannot assert for interrupts disabled here.
Should fix PR kern/54603: kernel panic when running dtruss
 1.15.6.1 14-Oct-2024  martin Apply patch, requested by chs in ticket #975:

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c (apply patch)

dtrace: add support for SMAP.

This is the equivalvent of

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S 1.9
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S 1.8
sys/arch/amd64/amd64/cpufunc.S 1.67
sys/arch/i386/i386/cpufunc.S 1.51

adapted to the netbsd-10 branch.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 23-Jun-2016  pgoyette branches: 1.6.14;
Import fix from FreeBSD - see [1], [2] references below...

Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
 1.5 15-Mar-2014  ozaki-r branches: 1.5.4;
Enable invop handler on module load

It sets a fbt handler to dtrace_invop_jump_addr on module load,
which is used to call the dtrace probing function from the trap
handler.
 1.4 10-Mar-2014  ozaki-r Fix header inclusions
 1.3 05-Mar-2014  ozaki-r Fix dtrace_cas32 logic

- compare with cmp, not new
- return old value
 1.2 04-Mar-2014  ozaki-r Add missing END for each function
 1.1 21-Jun-2013  christos branches: 1.1.2;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.2.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file dtrace_asm.S was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.5.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.4.1 15-Mar-2014  yamt file dtrace_asm.S was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 02-Oct-2015  riz branches: 1.5.14;
Update signature of unimplemented function to match prototype.
 1.4 15-Mar-2014  ozaki-r branches: 1.4.4;
Make arm/dtrace_isa.c buildable

This is a band-aid for build, but it works anyway.
We have to do a real fix in the future.
 1.3 08-Mar-2014  ozaki-r Prepare dtrace_isa.c for build

- Tidy up header file inclusions
- Replace curcpu with cpu_number()
- Fix argument of dtrace_getreg
- Tweak for gcc 4.8

Note that the file is still not buildable.
 1.2 05-Mar-2014  ozaki-r Use uint32_t instead of u_int32_t
 1.1 21-Jun-2013  christos branches: 1.1.2;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.2.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file dtrace_isa.c was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.4.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.4.1 15-Mar-2014  yamt file dtrace_isa.c was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 06-Apr-2021  simonb sizeof(*var) instead of sizeof(type)
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2017  chs branches: 1.3.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.2 10-Mar-2014  ozaki-r branches: 1.2.4; 1.2.10; 1.2.14;
Make arm/dtrace_subr.c buildable

The change just imports the code from
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
and tweaks for NetBSD.
 1.1 21-Jun-2013  christos branches: 1.1.2;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.2.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file dtrace_subr.c was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.2.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.2.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.4.1 10-Mar-2014  yamt file dtrace_subr.c was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.3.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 21-Jun-2013  christos branches: 1.1.2; 1.1.8; 1.1.30;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1.8.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.8.1 21-Jun-2013  yamt file regset.h was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file regset.h was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 20-Jul-2011  tron branches: 1.3.40;
Fix uninitialized variables reported by GCC 4.5.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.40.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 03-Nov-2023  chs dtrace: add support for SMAP

Add support in dtrace for SMAP, so that actions like copyinstr() work.
It would be better if dtrace could use the SMAP_* hotpatch macros directly,
but the hotpatching code does not currently operate on kernel modules,
so we'll use some tiny functions in the base kernel for now.
 1.7 28-May-2018  chs branches: 1.7.12;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 27-Feb-2017  chs branches: 1.6.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.5 23-Jun-2016  pgoyette branches: 1.5.2; 1.5.4;
Import fix from FreeBSD - see [1], [2] references below...

Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
 1.4 14-May-2016  chs apply the ustack() parts of freebsd r211608:

r211608 | rpaulo | 2010-08-22 03:53:32 -0700 (Sun, 22 Aug 2010) | 8 lines

Kernel DTrace support for:
o uregs (sson@)
o ustack (sson@)
o /dev/dtrace/helper device (needed for USDT probes)

The work done by me was:
Sponsored by: The FreeBSD Foundation

plus a few netbsd-specific tweaks from me.
fixes PR 50790.
 1.3 13-Mar-2010  christos make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.5.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.5.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.6.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.12.1 14-Oct-2024  martin Apply patch, requested by chs in ticket #975:

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c (apply patch)

dtrace: add support for SMAP.

This is the equivalvent of

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S 1.9
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S 1.8
sys/arch/amd64/amd64/cpufunc.S 1.67
sys/arch/i386/i386/cpufunc.S 1.51

adapted to the netbsd-10 branch.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 27-Feb-2017  chs branches: 1.5.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.4 14-May-2016  chs branches: 1.4.2; 1.4.4;
apply the ustack() parts of freebsd r211608:

r211608 | rpaulo | 2010-08-22 03:53:32 -0700 (Sun, 22 Aug 2010) | 8 lines

Kernel DTrace support for:
o uregs (sson@)
o ustack (sson@)
o /dev/dtrace/helper device (needed for USDT probes)

The work done by me was:
Sponsored by: The FreeBSD Foundation

plus a few netbsd-specific tweaks from me.
fixes PR 50790.
 1.3 18-Mar-2010  tron "ifdef-out" unused "label" exactly like the code which would use it
to get rid of a build error.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.4.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.5.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.14 21-Aug-2022  riastradh branches: 1.14.2;
dtrace/i386: Need machine/cpufunc.h for x86_read_flags and rcr2.
 1.13 06-Apr-2021  simonb sizeof(*var) instead of sizeof(type)
 1.12 13-Feb-2019  rin Fix DIAGNOSTIC build; replace FreeBSD-specific function with ours.
 1.11 04-Jun-2018  christos branches: 1.11.2;
better to put this (<sys/proc.h>) in the dtrace header where the definitions
are needed.
 1.10 04-Jun-2018  kre The (dtrace version of) <sys/proc.h> is needed for kthread_t
(same as the amd64 version). This should fix (one of) the
current i386 build breakages.
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 27-Feb-2017  chs branches: 1.8.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.7 16-Jun-2012  chs branches: 1.7.14; 1.7.18;
reduce diff to freebsd:
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
 1.6 09-Sep-2011  christos branches: 1.6.2;
fix a shadow variable warning.
 1.5 23-Apr-2010  ahoka Remove a couple of zero length kmem_frees.

It should fix at least one crash when unloading the dtrace module,
possibly many others.
 1.4 18-Mar-2010  tron As this file seems to be a port specific we don't need to check
for "__i386__.
 1.3 18-Mar-2010  tron Fix the build:
1.) "ifdef-out" unused functions and global variables.
2.) Include "x86/include/cpu_counter.h" for amd64 and i386 to get the
prototype of "cpu_frequency".
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.6.2.1 30-Oct-2012  yamt sync with head
 1.7.18.1 21-Apr-2017  bouyer Sync with HEAD
 1.7.14.1 20-Mar-2017  pgoyette Sync with HEAD
 1.8.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11.2.1 10-Jun-2019  christos Sync with HEAD
 1.14.2.1 14-Oct-2024  martin Apply patch, requested by chs in ticket #975:

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S (apply patch)
external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c (apply patch)

dtrace: add support for SMAP.

This is the equivalvent of

external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S 1.9
external/cddl/osnet/dev/dtrace/i386/dtrace_asm.S 1.8
sys/arch/amd64/amd64/cpufunc.S 1.67
sys/arch/i386/i386/cpufunc.S 1.51

adapted to the netbsd-10 branch.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 29-Mar-2021  simonb Work in progress dtrace for MIPS. MIPS support mostly copied from
FreeBSD, with NetBSD-specific changes largely based on aarch64 dtrace
support. Working well enough for system call tracing.
 1.2 07-Apr-2021  simonb Use NAL (nop-and-link) to get the current PC.
 1.1 29-Mar-2021  simonb Work in progress dtrace for MIPS. MIPS support mostly copied from
FreeBSD, with NetBSD-specific changes largely based on aarch64 dtrace
support. Working well enough for system call tracing.
 1.3 06-Apr-2021  christos sizeof(*var) instead of sizeof(type)
 1.2 06-Apr-2021  simonb Call kmem_free() with the size of the thing we are freeing. Fixes panic
when unloading the ktrace module on MIPS.
 1.1 29-Mar-2021  simonb Work in progress dtrace for MIPS. MIPS support mostly copied from
FreeBSD, with NetBSD-specific changes largely based on aarch64 dtrace
support. Working well enough for system call tracing.
 1.1 29-Mar-2021  simonb Work in progress dtrace for MIPS. MIPS support mostly copied from
FreeBSD, with NetBSD-specific changes largely based on aarch64 dtrace
support. Working well enough for system call tracing.
 1.3 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.2 06-Jun-2018  kamil branches: 1.2.2; 1.2.4;
Correct compilation of osnet/dev/dtrace/x86/dis_tables.c under Clang

Constify dgr_suffix.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.1 28-May-2018  chs add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2.4.1 10-Jun-2019  christos Sync with HEAD
 1.2.2.3 28-Jul-2018  pgoyette Sync with HEAD
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 06-Jun-2018  pgoyette file dis_tables.c was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file dis_tables.h was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file instr_size.c was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file regset.h was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.29 02-Sep-2022  riastradh dtrace_fbt: Allow tracing names that start with `__'.

This was never relevant on FreeBSD and I don't think it is relevant on
NetBSD either. The FreeBSD change to lift this restriction had the
following comment:

r306570 | markj | 2016-10-02 00:35:00 +0000 (Sun, 02 Oct 2016) | 7 lines

Allow tracing of functions prefixed by "__".

This restriction was inherited from upstream but is not relevant on FreeBSD.
Furthermore, it hindered the tracing of locking primitive subroutines.
 1.28 28-Mar-2022  riastradh driver(9): devsw_detach never fails. Make it return void.

Prune a whole lotta dead branches as a result of this. (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back. To be
cleaned up in subsequent commits...)

XXX kernel ABI change to devsw_detach signature requires bump
 1.27 16-Jul-2019  hannken Always exclude "fbt_*" from the list of FBT probes.
 1.26 09-Mar-2019  kamil Reserve DTrace sdt and fdt major numbers

Register cmajor 252 for fbt and 253 for sdt.

Previously the major number was picked randomly and it causes conflicts
with preallocated values for different devices.
 1.25 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.24 28-May-2018  chs branches: 1.24.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.23 06-Nov-2017  christos branches: 1.23.2;
kill another wrong ELFSIZE setting.
 1.22 27-Feb-2017  chs branches: 1.22.2;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.21 07-Jan-2017  christos branches: 1.21.2;
PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.20 16-Sep-2016  pgoyette Move kern_ctf.c into the dtrace_fbt module (the only place it is used)
rather than including in kernels with KDTRACE_HOOKS defined. Update
the dtrace_fbt module to depend on the zlib module.

Bump kernel version to avoid module mismatch.

Welcome to 7.99.38 !
 1.19 17-Jul-2016  pgoyette Use C99 initializers for the cdevsw

No functional change intended or expected.
 1.18 26-Feb-2015  ozaki-r branches: 1.18.2;
Fix inconsistency between module and internal names of sdt and fbt

PR 49697
OK wiz@
 1.17 26-Feb-2015  ozaki-r Fix module unload of dtrace, sdt and fbt

- Don't unload when there are users of dtrace
- Forbid auto unloading (not supported for now)

PR 49695
 1.16 26-Jul-2014  ryoon Fix dtrace kernel module build.
Add nodiscard to cdevsw.
They are not fixed in fallocate/fdiscard changes.
 1.15 19-Mar-2014  ozaki-r branches: 1.15.2;
Exclude mvsoctmr_* functions from FBT targets

Probing them doesn't work for DTrace/arm for some reason.

Anyway with this fix, DTrace/arm works on SHEEVAPLUG
as well as BEAGLEBONE.
 1.14 15-Mar-2014  ozaki-r Implement DTrace FBT provider for ARM

- Finding probable functions
- Replacing instructions
- Emulating instructions

It is tested only on ARMv7 CPUs yet, for example,
-m evbarm (-a earm) kernel=BEAGLEBONE.
 1.13 05-Mar-2014  tron Fix build of DTrace with GCC 4.8.
 1.12 03-Mar-2013  christos print the function name that was not found.
 1.11 16-Jun-2012  chs branches: 1.11.2;
reduce diff to freebsd:
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
 1.10 19-Oct-2011  yamt branches: 1.10.2;
fbt_provide_module_cb: exclude some functions known unsafe to probe
 1.9 31-Aug-2011  christos fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
 1.8 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.7 14-Dec-2010  tron Get DTrace to build again.
 1.6 03-May-2010  darran DTrace: print a warning no CTF section is found when processing arguments.
This should help diagnose problems such as netbsd images without CTF
sections and old boot loaders.
 1.5 13-Mar-2010  christos make dtrace compile on amd64.
 1.4 13-Mar-2010  darran DTrace: fix a sign problem with instruction size handling.
 1.3 12-Mar-2010  darran DTrace: Add the Function Boundary Trace (FBT) provider moduile. This
module instruments every function in the kernel with entry and exit
probes. These probes are true zero-effect probes in that they don't
exist in the code until they are enabled. The probes are enabled by
directly patching the function entry and exit points to make jumps into
the dtrace framework.
This gives us over 29,000 trace points in the kernel.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.10.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.2.1 30-Oct-2012  yamt sync with head
 1.11.2.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.2.1 23-Jun-2013  tls resync from head
 1.15.2.1 10-Aug-2014  tls Rebase.
 1.18.2.7 20-Mar-2017  pgoyette Sync with HEAD
 1.18.2.6 04-Nov-2016  pgoyette Sync with HEAD
 1.18.2.5 26-Jul-2016  pgoyette More renaming of LOCALCOUNT_INITIALIZER --> DEVSW_MODULE_INIT
 1.18.2.4 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.18.2.3 18-Jul-2016  pgoyette More rump drivers that need to have a 'struct localcount' when built
as modules.
 1.18.2.2 17-Jul-2016  pgoyette Add the d_localcount member to the various {b,c}devsw structures.

No need for these to be conditional on _MODULE as dtrace is always
a module.
 1.18.2.1 16-Jul-2016  pgoyette Add an initializer for the cdevsw's localcount.

XXX These should maybe be converted to C99-style structure initialization?
 1.21.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.22.2.2 29-Apr-2017  pgoyette Revise previous. Rather than explicitly including <sys/localcount.h>
in all the places where {b,c}devsw is initialized, just include it
from <sys/conf.h>. This avoids an include-sequence dependancy.
 1.22.2.1 29-Apr-2017  pgoyette Add DEVSW_MODULE_INIT to existing device-driver modules, so that they
willl have a localcount defined and thus be permitted to load. Without
a localcount, loading the module will return EINVAL.

XXX the dtrace and drm stuff might need to be fed back upstream?
 1.23.2.3 25-Jun-2018  pgoyette Adapt to new world order - mod_required is no a pointer to an array.
 1.23.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.23.2.1 01-Apr-2018  pgoyette Adapt to new dynamically-allocate required-module array
 1.24.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.24.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file fbt.h was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.9 23-May-2025  hannken Exclude more symbols which can be called from fbt probe context:

- binuptime() gets called from dtrace_gethrtime()->nanouptime().
- trap_*() crash qemu with accel hvf.
 1.8 09-May-2023  riastradh branches: 1.8.2;
dtrace_fbt: Read and write instruction words in little-endian.

Step toward making this work on aarch64eb.
 1.7 24-Mar-2021  simonb Add NetBSD CVS IDs.
 1.6 12-Feb-2020  riastradh branches: 1.6.4;
Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.
 1.5 12-Feb-2020  riastradh Count the number of artificial frames in aarch64 fbt probe correctly.
 1.4 12-Feb-2020  riastradh Tidy up a bit: don't set things we won't use; assert nonzeroness.
 1.3 12-Feb-2020  riastradh Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!
 1.2 12-Feb-2020  riastradh Use db_write_bytes to overwrite kernel text.
 1.1 03-Dec-2019  jmcneill branches: 1.1.2;
dtrace: add support for aarch64
 1.1.2.3 12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #701):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
sys/modules/cyclic/Makefile: revision 1.5
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
sys/arch/aarch64/aarch64/vectors.S: revision 1.10
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
sys/arch/aarch64/include/cpu.h: revision 1.20
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

stp x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue. In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.
 1.1.2.2 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.2.1 03-Dec-2019  martin file fbt_isa.c was added on branch netbsd-9 on 2019-12-09 15:19:31 +0000
 1.6.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6.4.1 12-Feb-2020  martin file fbt_isa.c was added on branch phil-wifi on 2020-04-13 07:56:36 +0000
 1.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 24-Mar-2021  simonb Add NetBSD CVS IDs.
 1.1 03-Dec-2019  jmcneill branches: 1.1.2; 1.1.6;
dtrace: add support for aarch64
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 03-Dec-2019  martin file fbt_isa.h was added on branch phil-wifi on 2020-04-13 07:56:36 +0000
 1.1.2.2 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.2.1 03-Dec-2019  martin file fbt_isa.h was added on branch netbsd-9 on 2019-12-09 15:19:31 +0000
 1.2 22-May-2023  riastradh dtrace_fbt: Read and write instructions appropriately-endian on arm.

arm is a little more complicated because it has three cases:
- big-endian data, big-endian instructions
- big-endian data, little-endian instructions
- little-endian data, little-endian instructions
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file fbt_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file fbt_isa.h was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.1 29-Mar-2021  simonb Work in progress dtrace for MIPS. MIPS support mostly copied from
FreeBSD, with NetBSD-specific changes largely based on aarch64 dtrace
support. Working well enough for system call tracing.
 1.1 29-Mar-2021  simonb Work in progress dtrace for MIPS. MIPS support mostly copied from
FreeBSD, with NetBSD-specific changes largely based on aarch64 dtrace
support. Working well enough for system call tracing.
 1.6 18-Aug-2021  riastradh PR/56355: Exclude the symbol trap, not all symbols other than trap.
 1.5 15-Aug-2021  christos PR/56355: Taylor Campbell: restore strcmp() over strncmp()
 1.4 11-Aug-2021  christos PR/56355: Brad Harder: dtrace triggers double-fault in supervisor mode
 1.3 02-May-2020  maxv Modify the hotpatch mechanism, in order to make it much less ROP-friendly.

Currently x86_patch_window_open is a big problem, because it is a perfect
function to inject/modify executable code with ROP.

- Remove x86_patch_window_open(), along with its x86_patch_window_close()
counterpart.
- Introduce a read-only link-set of hotpatch descriptor structures,
which reference a maximum of two read-only hotpatch sources.
- Modify x86_hotpatch() to open a window and call the new
x86_hotpatch_apply() function in a hard-coded manner.
- Modify x86_hotpatch() to take a name and a selector, and have
x86_hotpatch_apply() resolve the descriptor from the name and the
source from the selector, before hotpatching.
- Move the error handling in a separate x86_hotpatch_cleanup() function,
that gets called after we closed the window.

The resulting implementation is a bit complex and non-obvious. But it
gains the following properties: the code executed in the hotpatch window
is strictly hard-coded (no callback and no possibility to execute your own
code in the window) and the pointers this code accesses are strictly
read-only (no possibility to forge pointers to hotpatch an area that was
not designated as hotpatchable at compile-time, and no possibility to
choose what bytes to write other than the maximum of two read-only
templates that were designated as valid for the given destination at
compile-time).

With current CPUs this slightly improves a situation that is already
pretty bad by definition on x86. Assuming CET however, this change closes
a big hole and is kinda great.

The only ~problem there is, is that dtrace-fbt tries to hotpatch random
places with random bytes, and there is just no way to make it safe.
However dtrace is only in a module, that is rarely used and never compiled
into the kernel, so it's not a big problem; add a shitty & vulnerable
independent hotpatch window in it, and leave big XXXs. It looks like fbt
is going to collapse soon anyway.
 1.2 13-Nov-2019  maxv Use x86_patch_window_{open,close}. This also fixes a bug: the CR0/PSL
reloads were inverted.
 1.1 28-May-2018  chs branches: 1.1.2; 1.1.4;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file fbt_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file fbt_isa.h was added on branch pgoyette-compat on 2018-06-25 07:25:14 +0000
 1.12 27-Feb-2022  riastradh lockstat(4): KNF. No functional change intended.
 1.11 27-Feb-2022  riastradh lockstat(4): Membar audit.

- Serialize updates to lockstat_enabled, lockstat_dev_enabled, and
lockstat_dtrace_enabled with a new __cpu_simple_lock.

- Use xc_barrier to obviate any need for additional membars in
lockstat_event.

- Use atomic_load/store_* for access that might not be serialized by
lockstat_lock or lockstat_enabled_lock.
 1.10 12-Feb-2019  rin Fix build with DIAGNOSTIC:
ASSERT() is enabled ifdef DEBUG, not DIAGNOSTIC.
 1.9 28-May-2018  chs branches: 1.9.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 09-Mar-2015  christos branches: 1.8.14;
keep track of the number of enabled probes and set the lockstat_dtrace_enabled
flag appropriately.
 1.7 09-Mar-2015  riastradh Remove debug prints, simplify fini logic.
 1.6 09-Mar-2015  christos - remove device stuff
- compress ops
- terminate array of probes
 1.5 08-Mar-2015  riastradh Rewrite dtrace lockstat from the Solaris version and simplify.

- Fix mutex_adaptive probes to use the right lockstat flags.
- Install lockstat_probe_func on module load, not trace enable.
- Use a more sensible memory barrier arrangement.
 1.4 08-Mar-2015  christos preliminary support from riastradh (does not work yet, toxic)
 1.3 21-Jun-2013  christos Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.12.1 23-Jun-2013  tls resync from head
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.2.1 10-Jun-2019  christos Sync with HEAD
 1.11 15-May-2020  ad Bump PROF_ARTIFICIAL_FRAMES to 4 now that cyclics are run from statclock().
 1.10 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.9 06-Jun-2018  kamil branches: 1.9.2;
Correct compilation of osnet/dev/profile/profile.c under Clang

Constify char* types when initialized with liternals.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 07-Jan-2017  christos branches: 1.7.12;
PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.6 09-Apr-2016  riastradh branches: 1.6.2;
Disable autoload if there are any profile probes.
 1.5 04-Apr-2016  riastradh Fix module name of dtrace_profile.
 1.4 07-Dec-2012  chs adapt the profile dtrace provider to netbsd.
 1.3 17-Jul-2011  joerg branches: 1.3.2; 1.3.8;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.8.1 25-Feb-2013  tls resync with head
 1.3.2.1 16-Jan-2013  yamt sync with (a bit old) head
 1.6.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.7.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.2.1 10-Jun-2019  christos Sync with HEAD
 1.25 22-Jan-2026  riastradh dtrace_sdt: Don't ignore the first stack frame in sdt probes.

The aframes argument to dtrace_probe_create gives the number of stack
frames that are ignored in stack(), the first frame of which is
`caller'.

This is for, e.g., profiler interrupts where the interrupt frame
itself isn't interesting; it's the code that was interrupted that was
interesting (hence profile_aframes = PROF_ARTIFICIAL_FRAMES is often
nonzero, or even several frames deep).

But for sdt, the direct caller is the interesting part -- when we
have something like:

foo()
{
...
bar();
...
}

bar()
{
...
SDT_PROBE1(...);
...
}

We want `caller' to be the return address in bar of SDT_PROBE1(...),
not the return address in foo of bar().

PR kern/59934: dtrace_sdt: caller is off by a frame
 1.24 31-Aug-2022  riastradh branches: 1.24.2; 1.24.6;
dtrace_sdt: Fix bug in builtin module reference counting.

Don't module_hold(NULL)! This mistake was introduced in my attempt
to get dtrace working for sdt probes defined in non-builtin modules
like zfs.
 1.23 07-Aug-2022  riastradh bsd.kmodule.mk: Build modules with KDTRACE_HOOKS if MKDTRACE=yes.
 1.22 07-Aug-2022  riastradh dtrace_sdt: Register sdt providers and probes in loaded modules too.
 1.21 28-Mar-2022  riastradh driver(9): devsw_detach never fails. Make it return void.

Prune a whole lotta dead branches as a result of this. (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back. To be
cleaned up in subsequent commits...)

XXX kernel ABI change to devsw_detach signature requires bump
 1.20 09-Mar-2019  kamil branches: 1.20.2;
Reserve DTrace sdt and fdt major numbers

Register cmajor 252 for fbt and 253 for sdt.

Previously the major number was picked randomly and it causes conflicts
with preallocated values for different devices.
 1.19 28-May-2018  chs branches: 1.19.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.18 07-Jan-2017  christos branches: 1.18.4; 1.18.12;
PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.17 17-Jul-2016  pgoyette Use C99 initializers for the cdevsw

No functional change intended or expected.
 1.16 16-Jun-2016  mlelstv branches: 1.16.2;
Make assertion of linker_file #ifdef __FreeBSD__. Fixes DIAGNOSTIC build.
 1.15 06-Feb-2016  joerg SDT is not a disease. Use const consistently.
 1.14 02-Oct-2015  christos Merge conflicts
 1.13 02-Oct-2015  christos Adapt to NetBSD modules and link set access.
XXX: We don't have an event system so that we can issue callback that
will be run on construction or destruction to enable and disable probes
XXX: We don't have a way to use link_sets across modules properly.
 1.12 30-Sep-2015  christos Add proc:::exit
XXX: I am going to kill that soon and make the providers register automagically
with linker sets. This can't scale.
 1.11 26-Feb-2015  ozaki-r Fix inconsistency between module and internal names of sdt and fbt

PR 49697
OK wiz@
 1.10 26-Feb-2015  ozaki-r Fix module unload of dtrace, sdt and fbt

- Don't unload when there are users of dtrace
- Forbid auto unloading (not supported for now)

PR 49695
 1.9 26-Jul-2014  ryoon Fix dtrace kernel module build.
Add nodiscard to cdevsw.
They are not fixed in fallocate/fdiscard changes.
 1.8 30-Jul-2011  uebayasi branches: 1.8.8; 1.8.18;
Fix a local var name.
 1.7 29-Jul-2011  uebayasi KNF.
 1.6 13-Mar-2010  christos make dtrace compile on amd64.
 1.5 05-Mar-2010  darran DTrace: add a dependency on the dtrace module.
 1.4 01-Mar-2010  darran DTrace: update sdt.c handlers to match latest OpenSolaris vendor import.
 1.3 01-Mar-2010  darran DTrace: Add an SDT (Statically Defined Tracing) provider framework, and
implement most of the proc provider. Adds proc:::create, exec,
exec_success, exec_faillure, signal_send, signal_discard, signal_handle,
lwp_create, lwp_start, lwp_exit.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran branches: 1.1.1;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1.1.1 02-Oct-2015  christos Import sdt.c from FreeBSD
 1.8.18.1 10-Aug-2014  tls Rebase.
 1.8.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.2.6 20-Mar-2017  pgoyette Sync with HEAD
 1.16.2.5 26-Jul-2016  pgoyette More renaming of LOCALCOUNT_INITIALIZER --> DEVSW_MODULE_INIT
 1.16.2.4 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.16.2.3 18-Jul-2016  pgoyette More rump drivers that need to have a 'struct localcount' when built
as modules.
 1.16.2.2 17-Jul-2016  pgoyette Add the d_localcount member to the various {b,c}devsw structures.

No need for these to be conditional on _MODULE as dtrace is always
a module.
 1.16.2.1 16-Jul-2016  pgoyette Add an initializer for the cdevsw's localcount.

XXX These should maybe be converted to C99-style structure initialization?
 1.18.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.18.4.2 29-Apr-2017  pgoyette Revise previous. Rather than explicitly including <sys/localcount.h>
in all the places where {b,c}devsw is initialized, just include it
from <sys/conf.h>. This avoids an include-sequence dependancy.
 1.18.4.1 29-Apr-2017  pgoyette Add DEVSW_MODULE_INIT to existing device-driver modules, so that they
willl have a localcount defined and thus be permitted to load. Without
a localcount, loading the module will return EINVAL.

XXX the dtrace and drm stuff might need to be fed back upstream?
 1.19.2.1 10-Jun-2019  christos Sync with HEAD
 1.20.2.1 26-Jan-2026  martin Pull up following revision(s) (requested by riastradh in ticket #2000):

external/cddl/osnet/dev/sdt/sdt.c: revision 1.25

dtrace_sdt: Don't ignore the first stack frame in sdt probes.

The aframes argument to dtrace_probe_create gives the number of stack
frames that are ignored in stack(), the first frame of which is
`caller'.

This is for, e.g., profiler interrupts where the interrupt frame
itself isn't interesting; it's the code that was interrupted that was
interesting (hence profile_aframes = PROF_ARTIFICIAL_FRAMES is often
nonzero, or even several frames deep).

But for sdt, the direct caller is the interesting part -- when we
have something like:

foo()
{
...
bar();
...
}
bar()
{
...
SDT_PROBE1(...);
...
}

We want `caller' to be the return address in bar of SDT_PROBE1(...),
not the return address in foo of bar().

PR kern/59934: dtrace_sdt: caller is off by a frame
 1.24.6.1 26-Jan-2026  martin Pull up following revision(s) (requested by riastradh in ticket #167):

external/cddl/osnet/dev/sdt/sdt.c: revision 1.25

dtrace_sdt: Don't ignore the first stack frame in sdt probes.

The aframes argument to dtrace_probe_create gives the number of stack
frames that are ignored in stack(), the first frame of which is
`caller'.

This is for, e.g., profiler interrupts where the interrupt frame
itself isn't interesting; it's the code that was interrupted that was
interesting (hence profile_aframes = PROF_ARTIFICIAL_FRAMES is often
nonzero, or even several frames deep).

But for sdt, the direct caller is the interesting part -- when we
have something like:

foo()
{
...
bar();
...
}
bar()
{
...
SDT_PROBE1(...);
...
}

We want `caller' to be the return address in bar of SDT_PROBE1(...),
not the return address in foo of bar().

PR kern/59934: dtrace_sdt: caller is off by a frame
 1.24.2.1 26-Jan-2026  martin Pull up following revision(s) (requested by riastradh in ticket #1229):

external/cddl/osnet/dev/sdt/sdt.c: revision 1.25

dtrace_sdt: Don't ignore the first stack frame in sdt probes.

The aframes argument to dtrace_probe_create gives the number of stack
frames that are ignored in stack(), the first frame of which is
`caller'.

This is for, e.g., profiler interrupts where the interrupt frame
itself isn't interesting; it's the code that was interrupted that was
interesting (hence profile_aframes = PROF_ARTIFICIAL_FRAMES is often
nonzero, or even several frames deep).

But for sdt, the direct caller is the interesting part -- when we
have something like:

foo()
{
...
bar();
...
}
bar()
{
...
SDT_PROBE1(...);
...
}

We want `caller' to be the return address in bar of SDT_PROBE1(...),
not the return address in foo of bar().

PR kern/59934: dtrace_sdt: caller is off by a frame
 1.12 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.11 06-Jun-2018  kamil branches: 1.11.2;
Correct compilation of osnet/dev/systrace/systrace.c under Clang

Mark arguments to dtrace_probe_lookup() with __UNCONST().
The proper fix constifying it causes pollution of const in too many files.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.10 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.9 07-Jan-2017  christos branches: 1.9.12;
PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.8 24-Sep-2015  christos branches: 1.8.2;
use the alternate syscall names if available
 1.7 10-Mar-2015  christos fix reversed test.
 1.6 07-Mar-2015  christos we have space for 2 more arguments so use it.
 1.5 07-Mar-2015  christos - cleanup FreeBSD ifdefs
- remove unused code
- adjust to NetBSD struct emul and types.
 1.4 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.3 17-Jul-2011  joerg branches: 1.3.2; 1.3.8;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.9.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.9.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file OPENSOLARIS.LICENSE was added on branch phil-wifi on 2020-04-13 07:56:36 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 07-Aug-2009  haad Remove accidentally commited tar.bz2 file.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 12-May-2017  abhinav branches: 1.3.8;
Fix a typo: s/intepretation/interpretation
 1.2 12-May-2017  abhinav Change section number from 1M to 1
The man page gets installed in section 1 anyway.

Ok christos, mrg
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.36;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.36.1 19-May-2017  pgoyette Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)
 1.3.8.1 25-Jun-2018  pgoyette Sync with HEAD
 1.13 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.12 06-Jun-2018  kamil branches: 1.12.2;
Correct compilation of osnet/dist/cmd/dtrace/dtrace.c under Clang

Add missing const keywords.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.11 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 05-Jun-2017  abhinav branches: 1.10.4;
Undo the previous

While it fixed the problem of trailing spaces, but if the probe specifier
contained leading spaces, it would brake dtrace. The proper fix would be
to skip the leading spaces in the string as well.

However, it would result in a bigger diff for a very small benefit. While
a new import of dtrace is impending, it's better not to have this change.

Discussed with christos.
 1.9 05-Jun-2017  abhinav Fix the trailing space in the probe specifier's name in dtrace(1)'s output.

When using dtrace using one of the tracing options, such as -n, -P, -i, -f etc.,
the first line of output from dtrace one is something like this:

sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry ' matched 482 probes

There is a trailing space at the end of the probe specifier name ('syscall:::entry ').
This happens beucase dtrace tries to separate the probe name from the predicate and actions
using `{' and `/' as the separators but doesn't consider space also as a possible separator.

Output after this change:
sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry' matched 482 probes

ok christos@
 1.8 01-Feb-2017  chs add some missing bits from freebsd r211554:
remove the DOODAD from prochandler().
we are now DOODAD-compatible with current freebsd.
 1.7 05-Feb-2016  roy branches: 1.7.2; 1.7.4;
Fix the actual issue rather than silencing the warning.

Thanks to gson@
 1.6 04-Feb-2016  roy Add some __printflike and __dead love. Init some structs fully.
 1.5 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 28-Mar-2014  ozaki-r Fix some snprintf
 1.3 27-Mar-2014  christos kill sprintf
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.7.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.10.4.2 28-Jul-2018  pgoyette Sync with HEAD
 1.10.4.1 25-Jun-2018  pgoyette Sync with HEAD
 1.12.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file pyzfs.py was added on branch pgoyette-compat on 2018-06-25 07:25:15 +0000
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file zdb.8 was added on branch phil-wifi on 2020-04-13 07:56:36 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.8 09-Dec-2018  christos fix printf warnings.
 1.7 28-May-2018  chs branches: 1.7.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 28-Mar-2014  ozaki-r branches: 1.6.24;
Fix migrating to snprintf_blkptr
 1.5 28-Mar-2014  ozaki-r Add missing 4th argument of ddt_object_name
 1.4 28-Mar-2014  ozaki-r Fix some snprintf
 1.3 28-Mar-2014  ozaki-r Add missing 3rd argument of nicenum
 1.2 27-Mar-2014  christos kill sprintf
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.24.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.6.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 28-Mar-2014  ozaki-r branches: 1.2.24;
Complete migrating to snprintf_blkptr
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 18-Feb-2025  sborrill Remove orphaned -f flag for zfs mount
 1.2 30-Apr-2021  nia branches: 1.2.8;
zfs: Fix up references to FreeBSD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.2; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file zfs.8 was added on branch phil-wifi on 2020-04-13 07:56:36 +0000
 1.1.2.1 02-May-2021  martin Pull up following revision(s) (requested by nia in ticket #1264):

external/cddl/osnet/dist/cmd/zfs/zfs.8: revision 1.2
external/cddl/osnet/dist/cmd/zpool/zpool.8: revision 1.2

zfs: Fix up references to FreeBSD
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2.8.1 02-Aug-2025  perseant Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 13-May-2021  nia zfs: this is not FreeBSD
 1.7 15-Sep-2019  brad branches: 1.7.4;


Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
 1.6 28-May-2018  chs branches: 1.6.2; 1.6.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 10-Apr-2015  riastradh branches: 1.5.14;
Use 0, not NULL, for zero integer constant.
 1.4 03-Jan-2013  dsl Compilation fixes:
- include sys/ioctl.h
- NULL isn't an int constant
- %llf isn't a printf format
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6.4.2 19-May-2021  martin Pull up following revision(s) (requested by nia in ticket #1274):

external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.8

zfs: this is not FreeBSD
 1.6.4.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #250):

external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.2
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.3
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.4
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.5
distrib/sets/lists/man/mi: revision 1.1652
distrib/sets/lists/man/mi: revision 1.1653
distrib/sets/lists/etc/mi: revision 1.259
etc/rc.d/mountall: revision 1.11
external/cddl/osnet/sbin/zfs/Makefile: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.7
etc/rc.d/Makefile: revision 1.105
distrib/sets/lists/base/mi: revision 1.1217
etc/rc.d/Makefile: revision 1.106
etc/rc.d/zfs: revision 1.1
etc/defaults/rc.conf: revision 1.152
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.1

Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
mount_zfs.8: add xref to fstab(5)

Use more markup.

Include mount_zfs man pages only for MKZFS builds.

Moved zfs out of MKX11 block.

Fix build failure without X11.

Add a copyright to the man page and a bit of history.
Use Pa macro for path
new sentence, new line
 1.6.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.4.1 31-May-2021  cjep sync with head
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zhack.c was added on branch pgoyette-compat on 2018-06-25 07:25:15 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file translate.c was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zinject.c was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zinject.h was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zlook.c was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file zpool-features.7 was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 30-Apr-2021  nia zfs: Fix up references to FreeBSD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.2; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file zpool.8 was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1.2.1 02-May-2021  martin Pull up following revision(s) (requested by nia in ticket #1264):

external/cddl/osnet/dist/cmd/zfs/zfs.8: revision 1.2
external/cddl/osnet/dist/cmd/zpool/zpool.8: revision 1.2

zfs: Fix up references to FreeBSD
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 02-Jan-2013  dsl branches: 1.2.28;
Explicitly include sys/ioctl.h
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 25-Feb-2013  tls resync with head
 1.1.1.2.6.1 23-Jan-2013  yamt sync with head
 1.2.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 24-Oct-2022  nia Remove references to GEOM from zpool(8).
 1.5 16-Feb-2020  roy zpool: The NetBSD specific ioctl needs to include sys/ioctl.h
 1.4 28-May-2018  chs branches: 1.4.2; 1.4.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.4.1 20-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #715):

external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c: revision 1.5

zpool: The NetBSD specific ioctl needs to include sys/ioctl.h
 1.4.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zstreamdump.1 was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zstreamdump.c was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.9 20-Aug-2020  riastradh mmap MAP_FAILED audit.
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 28-Mar-2014  ozaki-r branches: 1.7.24;
Fix some snprintf
 1.6 28-Mar-2014  ozaki-r Add missing 3rd argument of nicenum
 1.5 27-Mar-2014  christos kill sprintf
 1.4 27-Feb-2010  haad branches: 1.4.6; 1.4.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.3 15-Sep-2009  haad Revert my last wrong change this will need more work.
 1.2 15-Sep-2009  haad On i386 use 32bit version of atomic_add_op because 64 doesn't work on
i486 userland.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 20-Nov-2011  christos branches: 1.5.38;
enough with the compile time warnings.
 1.4 15-Mar-2011  joerg branches: 1.4.4;
Don't define acl_alloc and acl_free during kernel builds.
Fixes module build with clang.
 1.3 09-Mar-2011  riz #include <sys/debug.h> (from the ZFS sources) so that ASSERT() is
defined, and we don't get problems like kern/44430. This is
more a workaround than a fix, but at least I can load zfs now.

ok haad@
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.4.1 17-Apr-2012  yamt sync with head
 1.5.38.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9 06-May-2025  hannken ctf_add_reftype(): ref may be negative, from FreeBSD.

Helps dtrace on 32-bit architectures, execsnoop now works.
 1.8 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.7 09-Apr-2016  christos branches: 1.7.28;
fix test.
 1.6 09-Apr-2016  christos properly check for type id overflow
 1.5 27-Dec-2015  christos add nbtool_config.h
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.7.28.1 02-Aug-2025  perseant Sync with HEAD
 1.5 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.4 04-Feb-2016  roy branches: 1.4.28;
Correct a prior patch by moving __printflike marking from the .c files
to the .h ones.
 1.3 04-Feb-2016  roy Mark printflike functions as __printflike.
 1.2 27-Dec-2015  christos add nbtool_config.h
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.28.1 02-Aug-2025  perseant Sync with HEAD
 1.3 27-Dec-2015  christos add nbtool_config.h
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.3 27-Dec-2015  christos branches: 1.3.28;
add nbtool_config.h
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.28.1 02-Aug-2025  perseant Sync with HEAD
 1.4 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.3 04-Feb-2016  roy branches: 1.3.28;
Correct a prior patch by moving __printflike marking from the .c files
to the .h ones.
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.28.1 02-Aug-2025  perseant Sync with HEAD
 1.5 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.4 27-Dec-2015  christos branches: 1.4.28;
add nbtool_config.h
 1.3 24-Sep-2015  christos sync with FreeBSD
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.28.1 02-Aug-2025  perseant Sync with HEAD
 1.4 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.3 27-Dec-2015  christos branches: 1.3.28;
add nbtool_config.h
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.28.1 02-Aug-2025  perseant Sync with HEAD
 1.7 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.6 20-Aug-2020  riastradh branches: 1.6.8;
mmap MAP_FAILED audit.
 1.5 27-Dec-2015  christos add nbtool_config.h
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6.8.1 02-Aug-2025  perseant Sync with HEAD
 1.6 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.5 28-May-2018  chs branches: 1.5.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 27-Dec-2015  christos branches: 1.4.14;
add nbtool_config.h
 1.3 24-Sep-2015  christos sync with FreeBSD
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.14.1 02-Aug-2025  perseant Sync with HEAD
 1.3 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.2 27-Dec-2015  christos branches: 1.2.28;
add nbtool_config.h
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.28.1 02-Aug-2025  perseant Sync with HEAD
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file fnvpair.c was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.7 10-Jan-2026  nia nvpair: sprinkle #include <sys/endian.h>
 1.6 21-May-2021  hannken Replace the Solaris style endian check (exactly one of
_LITTLE_ENDIAN or _BIG_ENDIAN is defined) with standard check
"#if BYTE_ORDER == BIG_ENDIAN" like we do it elseware.

Should fix PR 56191 (ZFS tests fail on sparc64)
 1.5 02-Mar-2020  kamil branches: 1.5.2;
Fix undefined behavior in misaligned pointer usage

Detected by UBSan and already fixed upstream.

Cherry-pick:
From aa0218d6a12814fac50b287214f9f3b0b99e11b1 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 7 Jan 2014 23:24:37 +0100
Subject: [PATCH] Fix nvlist 'Bus Error' for Sparc

The mis-aligned memory accesses in nvpair_native_embedded() and
nvpair_native_embedded_array() will cause a 'Bus Error' for
architectures such as Sparc which not fully byte addressible.
To avoid this issue care is taken to avoid dereferencing the
potentially mis-aligned packed nvlist_t.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: marku89 <mar42@kola.li>
Issue #1700
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 10-Apr-2015  riastradh branches: 1.3.14;
Initialize variables. Don't bother supporting nv doubles.
 1.2 03-Jan-2013  dsl Compilation fixes:
- include sys/ioctl.h
- NULL isn't an int constant
- %llf isn't a printf format
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 25-Feb-2013  tls resync with head
 1.1.1.2.6.1 23-Jan-2013  yamt sync with head
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5.2.1 31-May-2021  cjep sync with head
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add missing header file, I will tag it to osnet-20100224 later.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file strtolctype.h was added on branch pgoyette-compat on 2018-06-25 07:25:16 +0000
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file zfeature_common.c was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file zfeature_common.h was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 27-Feb-2010  haad branches: 1.1.1.1.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 27-Feb-2010  haad branches: 1.1.1.1.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 18-Sep-2025  mrg fix some issue GCC 14 found.

include <sys/ioctl.h> when using ioctl.
don't assign NULL to integers.
 1.2 18-Aug-2018  christos use the right variables (fix cut-n-pastos)
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2; 1.1.1.1.4;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.4.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.1.2.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs_ioctl_compat.c was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file zfs_ioctl_compat.h was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 26-Jun-2019  hannken branches: 1.1.1;
Initial revision
 1.1.1.1 26-Jun-2019  hannken branches: 1.1.1.1.6;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1.1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.1.1.6.1 26-Jun-2019  martin file atomic.h was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file libintl.h was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.44;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file stdio_ext.h was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 26-Jun-2019  hannken branches: 1.1.1;
Initial revision
 1.1.1.1 26-Jun-2019  hannken branches: 1.1.1.1.6;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1.1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.1.1.6.1 26-Jun-2019  martin file synch.h was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file thread.h was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.3 29-Sep-2015  wiz branches: 1.3.28;
Remove reference to mdb(1).
 1.2 28-Sep-2015  wiz Fix Dt. New sentence, new line. Fix xrefs.

Still leaves:
trailing Xref to mdb(1)
trailing Xref to libctf(3)
 1.1 24-Sep-2015  christos branches: 1.1.1;
Sync with FreeBSD
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.3.28.1 02-Aug-2025  perseant Sync with HEAD
 1.10 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.9 06-Sep-2020  christos branches: 1.9.8;
fix zeroing
 1.8 20-Aug-2020  riastradh mmap MAP_FAILED audit.
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 24-Sep-2015  christos branches: 1.6.14;
Sync with FreeBSD
 1.5 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.8.1 02-Aug-2025  perseant Sync with HEAD
 1.5 04-Feb-2016  roy Correct a prior patch by moving __printflike marking from the .c files
to the .h ones.
 1.4 04-Feb-2016  roy Mark printflike functions as __printflike.
 1.3 24-Sep-2015  christos Sync with FreeBSD
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2 03-Dec-2019  jmcneill dtrace: add support for aarch64
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.6;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.6.1 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.1.1.1.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dt_isadep.c was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2015  ozaki-r branches: 1.3.14;
Fix dtrace build for arm with gcc 4.8
 1.2 27-Mar-2014  christos branches: 1.2.4;
kill sprintf
 1.1 21-Jun-2013  christos branches: 1.1.1; 1.1.2;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.2.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file dt_isadep.c was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.4.1 27-Mar-2014  yamt file dt_isadep.c was added on branch yamt-pagecache on 2014-05-22 14:01:22 +0000
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10 18-Nov-2025  jkoshy Allow code to include either (or both) of <sys/elfdefinitions.h> and
<sys/exec_elf.h>, in any order.

This is a work-around to address PR lib/59564 (build breakage when
both of these files are #included).

With this changeset, whichever file gets included first 'wins'.
Prior changes in NetBSD and upstream at Elftoolchain have aligned the
'generic' ELF definitions in NetBSD's <sys/exec_elf.h> with those
in Elftoolchain's <sys/elfdefinitions.h>, so that either file can
be used interchangeably when building NetBSD.

This changeset also removes prior workarounds in the source tree
for this issue.

PR lib/59564
 1.9 01-Apr-2024  riastradh elftoolchain: Be consistent about which ELF header files we use.

1. For tools that use elftoolchain: always use elftoolchain's
elfdefinitions.h. Don't even think about looking at the host's
sys/exec_elf.h, which makes no sense and should never happen.

(ELF tools that don't use elftoolchain, like m68k-elf2coff,
continue to use nbincludes/sys/exec_elf.h. But no more nbincludes
hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
sys/exec_elf.h, even in Solaris components via sys/elf.h.
elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
elfdefinitions.h via libelf header files (libelf.h, gelf.h).

libdtrace in particular requires _all_ R_* reloc type definitions,
but sys/exec_elf.h brings in only the _current machine's_ R_*
reloc type definitions. (While here: Use uintptr_t instead of
Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
provided only by sys/exec_elf.h, not by elfdefinitions.h.)

And most userland components using libelf don't rely on any
properties of the current machine from sys/exec_elf.h, so they can
use libelf's elfdefinition.h.

Exceptions:

- dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
but it also relies on sys/dtrace.h -> sys/elf.h ->
elfdefinitions.h like other userland components using sys/elf.h.

- kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
sys/elf.h -> elfdefinitions like other userland components using
sys/elf.h.

- t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
core files, but relies on sys/exec_elf.h for struct
netbsd_elfcore_procinfo.

None of these exceptions needs all R_* reloc type definitions, so
as a workaround, we can just suppress libelf's elfdefinitions.h by
defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake. This was:

- half bogus workarounds for missing build_install dependencies in
tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
tools involving libelf instead of libelf's elfdefinitions.h, which
collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 01-Mar-2016  joerg branches: 1.7.14;
Don't crash when relocbase was 0.
 1.6 29-Feb-2016  riastradh Add __printflike as appropriate.
 1.5 28-Feb-2016  christos - Add missing ioctl.h
- Hide dprintf
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 24-Sep-2015  christos branches: 1.6.14;
sync with FreeBSD
 1.5 18-Feb-2015  ozaki-r Add assert
 1.4 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 24-Sep-2015  christos branches: 1.4.14;
sync with FreeBSD
 1.3 07-Feb-2015  christos delete error(1) strings.
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 24-Sep-2015  christos branches: 1.4.14;
sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 24-Sep-2015  christos branches: 1.5.14;
sync with FreeBSD
 1.4 14-Feb-2015  christos PR/49666: Henning Petersen: initialization of instr wrong in dt_cg.c NULL
instead of 0 for uint32_t.
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.9 29-Sep-2015  christos branches: 1.9.14;
return an error for actions we don't understand.
 1.8 24-Sep-2015  christos sync with FreeBSD
 1.7 21-Feb-2015  ozaki-r Fix dtrace build for arm with gcc 4.8
 1.6 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.5 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.4 27-Feb-2010  haad branches: 1.4.6; 1.4.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 24-Sep-2015  christos branches: 1.4.14;
sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.6; 1.1.1.1.12;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.1.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 24-Sep-2015  christos branches: 1.4.14;
sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 24-Sep-2015  christos branches: 1.3.14;
sync with FreeBSD
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 24-Sep-2015  christos branches: 1.3.14;
sync with FreeBSD
 1.2 15-May-2011  christos fix missing prototypes.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 24-Sep-2015  christos branches: 1.5.14;
sync with FreeBSD
 1.4 27-Mar-2014  christos kill sprintf
 1.3 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 04-Feb-2016  roy branches: 1.5.14;
Fix printf formats and casts.
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.9 12-Feb-2020  riastradh Use /dev/ksyms, not /netbsd, for the running kernel's symbols.
 1.8 28-May-2018  chs branches: 1.8.2; 1.8.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 28-Apr-2016  christos branches: 1.7.14;
Introduce dt_bootfile() and use it to avoid hard-coded kernel values. Fixes
dtrace hang for kernels not named netbsd.
 1.6 24-Sep-2015  christos sync with FreeBSD
 1.5 15-May-2011  christos fix missing prototypes.
 1.4 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.4.1 12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #701):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
sys/modules/cyclic/Makefile: revision 1.5
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
sys/arch/aarch64/aarch64/vectors.S: revision 1.10
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
sys/arch/aarch64/include/cpu.h: revision 1.20
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

stp x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue. In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.
 1.8.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5 12-Nov-2015  riz Declare variables under the same conditions as their use.
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.13 02-May-2022  jkoshy Follow FreeBSD revision <0e15d9fbeba4> and simplify #ifdef'ed code.

This change avoids redefining 'SHN_SUNW_IGNORE' if the symbol is already
present.
 1.12 03-Dec-2019  jmcneill dtrace: add support for aarch64
 1.11 28-May-2018  chs branches: 1.11.2; 1.11.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 06-Nov-2017  christos branches: 1.10.2;
need to undef KERN_ELFSIZE too here...
 1.9 12-Jan-2017  christos Rearrange headers
 1.8 24-Sep-2015  christos branches: 1.8.2;
sync with FreeBSD
 1.7 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.6 28-Mar-2014  ozaki-r Fix some snprintf
 1.5 27-Mar-2014  christos kill sprintf
 1.4 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.3 03-Apr-2010  christos branches: 1.3.6; 1.3.12;
hack for amd64
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.10.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11.4.1 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.11.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3 24-Sep-2015  christos sync with FreeBSD
 1.2 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3 24-Sep-2015  christos sync with FreeBSD
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.19 01-Apr-2024  riastradh elftoolchain: Be consistent about which ELF header files we use.

1. For tools that use elftoolchain: always use elftoolchain's
elfdefinitions.h. Don't even think about looking at the host's
sys/exec_elf.h, which makes no sense and should never happen.

(ELF tools that don't use elftoolchain, like m68k-elf2coff,
continue to use nbincludes/sys/exec_elf.h. But no more nbincludes
hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
sys/exec_elf.h, even in Solaris components via sys/elf.h.
elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
elfdefinitions.h via libelf header files (libelf.h, gelf.h).

libdtrace in particular requires _all_ R_* reloc type definitions,
but sys/exec_elf.h brings in only the _current machine's_ R_*
reloc type definitions. (While here: Use uintptr_t instead of
Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
provided only by sys/exec_elf.h, not by elfdefinitions.h.)

And most userland components using libelf don't rely on any
properties of the current machine from sys/exec_elf.h, so they can
use libelf's elfdefinition.h.

Exceptions:

- dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
but it also relies on sys/dtrace.h -> sys/elf.h ->
elfdefinitions.h like other userland components using sys/elf.h.

- kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
sys/elf.h -> elfdefinitions like other userland components using
sys/elf.h.

- t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
core files, but relies on sys/exec_elf.h for struct
netbsd_elfcore_procinfo.

None of these exceptions needs all R_* reloc type definitions, so
as a workaround, we can just suppress libelf's elfdefinitions.h by
defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake. This was:

- half bogus workarounds for missing build_install dependencies in
tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
tools involving libelf instead of libelf's elfdefinitions.h, which
collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.
 1.18 12-Feb-2020  riastradh Use /dev/ksyms, not /netbsd, for the running kernel's symbols.
 1.17 02-Jun-2018  christos branches: 1.17.2; 1.17.4;
Use a constant to prevent dynamic array allocation which messes up SSP.
 1.16 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.15 03-Aug-2016  christos branches: 1.15.12;
machdep.booted_kernel is not an absolute path, make it so. Now u_int is
found but its parent is not :-)
 1.14 30-Jun-2016  pgoyette branches: 1.14.2;
Add missing dp_proc_unlock() in error path.

From PR kern/51285 (Henning Petersen)

XXX Pullup to 7 and 7-0
 1.13 28-Apr-2016  christos Introduce dt_bootfile() and use it to avoid hard-coded kernel values. Fixes
dtrace hang for kernels not named netbsd.
 1.12 06-Oct-2015  riz Make this build for me.
 1.11 05-Oct-2015  christos load the kernel for NetBSD (for now)
 1.10 04-Oct-2015  christos put back module filename finding code.
 1.9 24-Sep-2015  christos sync with FreeBSD
 1.8 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.7 13-Feb-2012  wiz Use the correct path in dt_module.c.
From clang via Henning Petersen in PR 46009.
 1.6 26-Jul-2011  yamt branches: 1.6.2;
remove a debug printf
 1.5 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6.2.1 17-Apr-2012  yamt sync with head
 1.14.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.15.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.17.4.1 12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #701):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
sys/modules/cyclic/Makefile: revision 1.5
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
sys/arch/aarch64/aarch64/vectors.S: revision 1.10
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
sys/arch/aarch64/include/cpu.h: revision 1.20
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

stp x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue. In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.
 1.17.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.17 12-Feb-2020  riastradh Use /dev/ksyms, not /netbsd, for the running kernel's symbols.
 1.16 24-Jul-2019  hannken branches: 1.16.2;
Handle automatic module loading on device open more like FreeBSD does.

Where FreeBSD uses a module "dtraceall" that depends on all dtrace
modules we now load the basic set "dtrace sdt fbt syscall" on open.
 1.15 21-Jul-2019  hannken Always use "netbsd" as kernel name, dt_module_update() already takes
care to load data from the booted kernel image.
 1.14 21-Jul-2019  hannken Try to load module "dtrace" before opening "/dev/dtrace/dtrace".

Fixes PR kern/54387: DTrace Kernel module does not autoload on first use ...
 1.13 28-May-2018  chs branches: 1.13.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.12 28-Apr-2016  christos branches: 1.12.14;
remove incorrect comment
 1.11 28-Apr-2016  christos Introduce dt_bootfile() and use it to avoid hard-coded kernel values. Fixes
dtrace hang for kernels not named netbsd.
 1.10 24-Feb-2016  joerg Make the default CPP path a list and check if they are access(2)able.
If no match is found, fallback to looking for cpp in PATH.
 1.9 03-Feb-2016  riz Adapt getmajor and getminor signatures for NetBSD.
 1.8 07-Oct-2015  christos Adjust for NetBSD.
 1.7 05-Oct-2015  christos Add definitions for uid_t and gid_t for NetBSD because we are screwing up
with the names in the kernel and the ctf sections end up having only __uid_t
and __gid_t.
 1.6 24-Sep-2015  christos sync with FreeBSD
 1.5 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 05-Mar-2010  darran DTrace: fix the curthread and mutex data types.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.12.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.13.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.13.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.16.2.1 12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #701):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.2
external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c: revision 1.17
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c: revision 1.18
sys/modules/cyclic/Makefile: revision 1.5
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.2
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.3
sys/arch/aarch64/aarch64/vectors.S: revision 1.10
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.2
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.3
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.4
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.5
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.6
sys/arch/aarch64/include/cpu.h: revision 1.20
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h: revision 1.9

Create a buffer space of 512 bytes before the trapframe.

dtrace fbt needs enough space to emulate an

stp x29, x30, [sp,#-FRAMESIZE]!

instruction in a function prologue. In the aarch64 instruction
encoding, FRAMESIZE can be as large as 512 bytes, so reserve this
much space when KDTRACE_HOOKS is enabled.

Use db_write_bytes to overwrite kernel text.

Tidy up a bit. No functional change intended.

aarch64 fbt_invop doesn't actually use the argument, but it would
make more sense for it to be the return value and/or first argument
register. Certainly it's not `eax'!

Tidy up a bit: don't set things we won't use; assert nonzeroness.

Use /dev/ksyms, not /netbsd, for the running kernel's symbols.

Teach dtrace about el1_trap_exit frames on aarch64.

Implement dtrace_getarg and dtrace_getreg while here.

Count the number of artificial frames in aarch64 fbt probe correctly.

Change the address ranges that aarch64 considers toxic for dtrace.
`Toxic' means dtrace forbids D scripts from even attempting to read
or write at them.

Previously we considered [0, VM_MIN_KERNEL_ADDRESS) toxic, but
VM_MIN_KERNEL_ADDRESS is only the minimum address of the kernel map;
the direct-mapped region lies below it, and with PMAP_MAP_POOLPAGE we
allocate virtual pages for pool backing directly from physical pages
through the direct-mapped region. Also, this did not consider I/O
mappings to be toxic, which they probably should be.

Instead, treat:

[0, AARCH64_KSEG_START)
and
[VM_KERNEL_IO_ADDRESS, 0xfff...ff)

as toxic. (The upper bound for 0xfff...ff ought to be inclusive, not
exclusive, but I think we'll need another mechanism for expressing
that to dtrace!)

Switch from db_write_bytes to using direct-mapping.

This way there's no dependency on ddb.

Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...

cyclic.kmod needs -Wno-sign-compare for aarch64 CPU_INFO_FOREACH.
Provisional workaround; feel free to fix.
 1.9 06-Sep-2020  christos Stop using alloca
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 24-Sep-2015  christos branches: 1.7.14;
sync with FreeBSD
 1.6 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.5 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.4 26-Jul-2011  yamt branches: 1.4.2; 1.4.8;
remove debug printfs
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 04-Feb-2016  roy branches: 1.8.14;
Fix printf formats and casts.
 1.7 24-Sep-2015  christos sync with FreeBSD
 1.6 21-Feb-2015  ozaki-r Fix dtrace build for arm with gcc 4.8
 1.5 14-Feb-2015  christos PR/49667: Henning Petersen: Missing initialization of values in dt_parser.c
 1.4 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.3 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 04-Feb-2016  roy branches: 1.3.14;
Mark __printflike and __dead.
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 24-Sep-2015  christos branches: 1.7.14;
sync with FreeBSD
 1.6 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.5 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 24-Sep-2015  christos branches: 1.1.1;
sync with FreeBSD
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1 24-Sep-2015  christos branches: 1.1.1;
sync with FreeBSD
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 24-Sep-2015  christos branches: 1.1.1; 1.1.14;
sync with FreeBSD
 1.1.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.11 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 01-Oct-2015  riz branches: 1.10.14;
Redo previous so as to not break non-arm MKDTRACE=yes builds.
 1.9 01-Oct-2015  riz Only declare 'ldn' where it's actually used. Fixes build on arm
with MKDTRACE=yes.
 1.8 24-Sep-2015  christos sync with FreeBSD
 1.7 21-Feb-2015  ozaki-r Fix dtrace build for arm with gcc 4.8
 1.6 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.5 27-Mar-2014  apb format is a pointer, so sizeof(format) is not a good length
to pass to snprintf. Try to calculate the correct length,
taking into account the amount of space already used.
 1.4 20-Feb-2013  tron Fix dodgy arguments to snprintf(3) which cause a warning that breaks
the build (at least with "USE_SSP" set to "yes").
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 26-Sep-2015  christos branches: 1.8.14;
catch up with unsigned long -> proc_breakpoint_t change.
 1.7 24-Sep-2015  christos sync with FreeBSD
 1.6 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.5 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 26-Sep-2015  christos branches: 1.4.14;
catch up with unsigned long -> proc_breakpoint_t change.
 1.3 24-Sep-2015  christos sync with FreeBSD
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 24-Sep-2015  christos sync with FreeBSD
 1.4 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 24-Sep-2015  christos branches: 1.3.14;
sync with FreeBSD
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 24-Sep-2015  christos branches: 1.2.14;
sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.44;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.16 07-Feb-2023  chs dtrace: remove unnecessary fflush()

Apply this commit from FreeBSD:

commit f339a3ef6369b368f3a2455792a7a3a4c28f92c4
Author: Chuck Silvers <chs@FreeBSD.org>
Date: Wed Feb 9 17:09:26 2022 -0800

dtrace: remove unnecessary fflush()

This call was added back in the early days of dtrace porting and
no one knows why anymore. The extra flushing causes lots of
unnecessary CPU overhead when a script produces lots of output,
as well as easily losing output because the command can't keep up.

Sponsored by: Netflix
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D34216
 1.15 06-Feb-2023  chs dtrace: re-fix aggregations to report from all online CPUs

Reapply the fix to dt_status() from rev 1.10
("Don't return success when the target CPU is offline")
which was lost in rev 1.12 ("sync with FreeBSD").
The FreeBSD version that we have been using since then does run on NetBSD
but always reports that CPU 0 is online and all other CPUs are offline,
because the sysctl that it uses does not exist on NetBSD.
 1.14 06-Sep-2020  christos branches: 1.14.6;
Adjust string sizes
 1.13 28-May-2018  chs branches: 1.13.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.12 24-Sep-2015  christos branches: 1.12.14;
sync with FreeBSD
 1.11 21-Feb-2015  ozaki-r Fix dtrace build error with gcc 4.8 on i386 and arm

_ILP32 is required by dt_popc.

The fix is inspired by FreeBSD.
 1.10 18-Feb-2015  ozaki-r Don't return success when the target CPU is offline

dt_status originally expected the behavior.

This fixes a segfault happens in dt_aggregate_go (a user of dt_status)
that depends on the behavior.
 1.9 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.8 27-Mar-2014  christos kill sprintf
 1.7 12-Jan-2014  riz Replace llx with PRIx64 and some llu with PRIu64 in format strings.
 1.6 02-Jan-2013  tron Include "sys/ioctl.h" for the prototype of ioctl(2) which fixes the build.
 1.5 19-Oct-2011  yamt branches: 1.5.2; 1.5.8;
make aggregate work for > 1 cpus
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.8.1 25-Feb-2013  tls resync with head
 1.5.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.2.1 23-Jan-2013  yamt sync with head
 1.12.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.13.4.1 15-Feb-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1596):

external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c: revision 1.15

dtrace: re-fix aggregations to report from all online CPUs

Reapply the fix to dt_status() from rev 1.10
("Don't return success when the target CPU is offline")
which was lost in rev 1.12 ("sync with FreeBSD").

The FreeBSD version that we have been using since then does run on NetBSD
but always reports that CPU 0 is online and all other CPUs are offline,
because the sysctl that it uses does not exist on NetBSD.
 1.14.6.2 08-Feb-2023  martin Pull up following revision(s) (requested by chs in ticket #74):

external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c: revision 1.16

dtrace: remove unnecessary fflush()

Apply this commit from FreeBSD:

commit f339a3ef6369b368f3a2455792a7a3a4c28f92c4
Author: Chuck Silvers <chs@FreeBSD.org>
Date: Wed Feb 9 17:09:26 2022 -0800

dtrace: remove unnecessary fflush()

This call was added back in the early days of dtrace porting and
no one knows why anymore. The extra flushing causes lots of
unnecessary CPU overhead when a script produces lots of output,
as well as easily losing output because the command can't keep up.

Sponsored by: Netflix
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D34216
 1.14.6.1 08-Feb-2023  martin Pull up following revision(s) (requested by chs in ticket #69):

external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c: revision 1.15

dtrace: re-fix aggregations to report from all online CPUs

Reapply the fix to dt_status() from rev 1.10
("Don't return success when the target CPU is offline")
which was lost in rev 1.12 ("sync with FreeBSD").

The FreeBSD version that we have been using since then does run on NetBSD
but always reports that CPU 0 is online and all other CPUs are offline,
because the sysctl that it uses does not exist on NetBSD.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dt_sugar.c was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2 24-Sep-2015  christos sync with FreeBSD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 24-Sep-2015  christos branches: 1.5.14;
sync with FreeBSD
 1.4 02-Mar-2010  darran DTrace: Get DTrace to build on OS X platforms.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file mkerrno.sh was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.7 29-Sep-2015  christos detect dynamically if we need -e for echo
 1.6 24-Sep-2015  christos sync with FreeBSD
 1.5 03-Apr-2010  christos remove useless double [[
 1.4 05-Mar-2010  darran DTrace: Explicitly check for OS X to decide if echo needs -e.
 1.3 02-Mar-2010  darran DTrace: Get DTrace to build on OS X platforms.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.8 29-May-2018  kre Build fix attempt, use TOOL_AWK (with fallback to "awk") rather than "nawk".
 1.7 29-Sep-2015  christos branches: 1.7.14;
detect dynamically if we need -e for echo
 1.6 24-Sep-2015  christos sync with FreeBSD
 1.5 03-Apr-2010  christos remove useless double [[
 1.4 05-Mar-2010  darran DTrace: Explicitly check for OS X to decide if echo needs -e.
 1.3 02-Mar-2010  darran DTrace: Get DTrace to build on OS X platforms.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file mksignal.sh was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 24-Sep-2015  christos branches: 1.1.1; 1.1.14;
new from FreeBSD
 1.1.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file regs.d.in was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file regs.sed.in was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dt_isadep.c was added on branch pgoyette-compat on 2018-06-25 07:25:17 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dt_isadep.c was added on branch pgoyette-compat on 2018-06-25 07:25:18 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dt_isadep.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dt_isadep.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file regs.d was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 07-Feb-2015  christos branches: 1.4.14;
check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.3 15-May-2011  christos fix missing prototypes.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 19-Oct-2013  christos branches: 1.3.24;
use proper format strings.
 1.2 03-Jan-2013  dsl Compilation fixes:
- include sys/ioctl.h
- NULL isn't an int constant
- %llf isn't a printf format
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.12.1 25-Feb-2013  tls resync with head
 1.1.1.2.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.1.2.6.1 23-Jan-2013  yamt sync with head
 1.3.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file nvpair_json.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 28-Apr-2026  riastradh osnet libuutil: Use mutex_init, not mutex_unlock, in child post-fork.

Using mutex_unlock may try to wake a thread that doesn't exist in the
child, which could lead to trouble such as crash or deadlock. But
since the child is single-threaded, it is safe to just reinitialize
the mutex memory anyway.

PR lib/59237: postfork mutex audit: mutex_init, not mutex_unlock
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-Apr-2026  riastradh osnet libuutil: Use mutex_init, not mutex_unlock, in child post-fork.

Using mutex_unlock may try to wake a thread that doesn't exist in the
child, which could lead to trouble such as crash or deadlock. But
since the child is single-threaded, it is safe to just reinitialize
the mutex memory anyway.

PR lib/59237: postfork mutex audit: mutex_init, not mutex_unlock
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 28-Apr-2026  riastradh osnet libuutil: Use mutex_init, not mutex_unlock, in child post-fork.

Using mutex_unlock may try to wake a thread that doesn't exist in the
child, which could lead to trouble such as crash or deadlock. But
since the child is single-threaded, it is safe to just reinitialize
the mutex memory anyway.

PR lib/59237: postfork mutex audit: mutex_init, not mutex_unlock
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.5 28-Apr-2026  riastradh osnet libuutil: Use mutex_init, not mutex_unlock, in child post-fork.

Using mutex_unlock may try to wake a thread that doesn't exist in the
child, which could lead to trouble such as crash or deadlock. But
since the child is single-threaded, it is safe to just reinitialize
the mutex memory anyway.

PR lib/59237: postfork mutex audit: mutex_init, not mutex_unlock
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 26-May-2017  joerg branches: 1.3.8;
Fix argument order.
 1.2 10-Apr-2015  riastradh GCC doesn't speak #pragma init, try __attribute__((constructor)).
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.8.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 29-Feb-2016  riastradh Cast int64_t to long long before printfing with %lld.

Not doing so broke something months ago and I forgot why.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file uu_string.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 10-Jan-2017  christos branches: 1.2.12;
fix a few warnings.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.28;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file libzfs_compat.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_compat.h was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 13-May-2021  nia this is not FreeBSD
 1.4 28-May-2018  chs branches: 1.4.4; 1.4.8;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 03-Apr-2010  christos branches: 1.3.44;
don't use NULL for 0
 1.2 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.8.1 31-May-2021  cjep sync with head
 1.4.4.1 19-May-2021  martin Pull up following revision(s) (requested by nia in ticket #1274):

external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.8

zfs: this is not FreeBSD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_diff.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.1 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9 20-Mar-2026  yamt zpool_find_import_impl: fix block/character device confusion

this commit fixes zpool import failure in some cases.

the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.

also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.

also, this commit fixes import of file-backed vdevs.
 1.8 18-Sep-2025  mrg fix some issue GCC 14 found.

include <sys/ioctl.h> when using ioctl.
don't assign NULL to integers.
 1.7 28-Aug-2021  riastradh branches: 1.7.6;
libzfs: Zero DIOCLWEDGES input before ioctl.

Otherwise we ask the kernel to write over whatever random pointer was
in the stack garbage here, when all we wanted was to learn whether
dkwl_nwedges is zero or nonzero.

XXX pullup-9
 1.6 04-Apr-2020  mlelstv When collecting zpool devices, skip disks with wedges so that a
concurrent test of a wedge on that disk doesn't fail.
 1.5 20-Aug-2019  hannken Always open the raw block devices as "<device><unit>" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter. Now pools on wedges get imported too.
 1.4 28-May-2018  chs branches: 1.4.2; 1.4.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 06-Oct-2009  haad Replace another openat call with open + changed path.

XXX. This commit should be reverted after proper implementation of *at syscalls.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.4.2 29-Aug-2022  martin Pull up following revision(s) (requested by riastradh in ticket #1503):

external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.7
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.6

When collecting zpool devices, skip disks with wedges so that a
concurrent test of a wedge on that disk doesn't fail.

libzfs: Zero DIOCLWEDGES input before ioctl.

Otherwise we ask the kernel to write over whatever random pointer was
in the stack garbage here, when all we wanted was to learn whether
dkwl_nwedges is zero or nonzero.

XXX pullup-9
 1.4.4.1 20-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #100):

external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.5

Always open the raw block devices as "<device><unit>" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter. Now pools on wedges get imported too.
 1.4.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.6.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_iter.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 14-Dec-2010  haad branches: 1.4.44;
Fix amd64 build where sysinfo was not defined, disable libshare for now.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 10-Jan-2017  christos branches: 1.4.12;
fix a few warnings.
 1.3 27-Feb-2010  haad branches: 1.3.28;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 05-Oct-2009  haad Disable *at functions for now. These functions should be implemented
because they are part of POSIX standard but it seems to be a long time process.

XXX. This commit should be reverted after adding support for openat and fstatat.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.4.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 03-Jun-2012  dsl branches: 1.2.30;
Not sure why this has just started to fail!
But it really isn't a good idea to compare a uint64_t to NULL.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.6.1 30-Oct-2012  yamt sync with head
 1.2.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 18-Sep-2025  mrg fix some issue GCC 14 found.

include <sys/ioctl.h> when using ioctl.
don't assign NULL to integers.
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 26-Jan-2013  christos branches: 1.6.28;
Avoid comparison between pointer and integer.
 1.5 01-Jan-2013  dsl This needs an explicit include of sys/ioctl.h.
XXX: There is some crappy code in here :-)
 1.4 24-Dec-2010  haad branches: 1.4.6; 1.4.12;
libzfs_fru_clear was not ported to NetBSD disable it foor now.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.12.1 25-Feb-2013  tls resync with head
 1.4.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.6.1 23-Jan-2013  yamt sync with head
 1.6.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_core.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_core.h was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_core_compat.c was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file libzfs_core_compat.h was added on branch pgoyette-compat on 2018-06-25 07:25:19 +0000
 1.3 27-Oct-2021  simonb Hacks to get zdb working on NetBSD:
- Force accessing raw device but we're passed the block device.
- Deal with wedges not returning their size on a stat(2) and use
the DIOCGMEDIASIZE ioctl instead.

Ok chs@.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file kernel.c was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 21-Jun-2013  christos branches: 1.4.26;
rename delay to xdelay to avoid conflicts.
 1.3 15-Dec-2010  haad branches: 1.3.6; 1.3.12;
Whitespace police.
 1.2 15-Dec-2010  haad Only KM_SLEEP | KM_NOSLEEP can be passed down to kmem layer, clean up
tqflags from internal taskq flags (TQ_FRONT) before calling kmem_alloc.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.12.1 23-Jun-2013  tls resync from head
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.26.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 28-Mar-2014  ozaki-r branches: 1.3.24;
Add missing 3rd argument of nicenum
 1.2 27-Mar-2014  christos kill sprintf
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.6; 1.1.1.1.12;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.1.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs.d was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 22-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

FreeBSD splits "zfs_context.h" into:
"lib/libzpool/common/sys/zfs_context.h" for user space
"uts/common/fs/zfs/sys/zfs_context.h" for kernel space

Do the same here, move and sync "sys/sys/zfs_context.h" to
"dist/lib/libzpool/common/sys/zfs_context.h" and
"dist/uts/common/fs/zfs/sys/zfs_context.h".

Change "Makefile.zfs" to search includes from "dist/lib"
before "dist/uts" so we get the right include file.

Adapt "usr.sbin/fstyp/Makefile" to get the right include file.
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 22-Jun-2019  martin file zfs_context.h was added on branch phil-wifi on 2020-04-13 07:56:37 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file __init__.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file allow.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dataset.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file groupspace.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file holds.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file ioctl.c was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file table.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file unallow.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file userspace.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file util.py was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3 05-Feb-2016  riastradh Need nbtools_config.h for __unused.

Fixes

.../src/tools/ctfmerge/../../external/cddl/osnet/dist/tools/ctf/common/list.c:73:47: error: expected ';', ',' or ')' before '__unused'
list_defcmp(void *d1, void *d2, void *private __unused)
^~~~~~~~

on non-NetBSD systems, where <assert.h>, <stdlib.h>, <stdio.h>, and
<sys/types.h> don't define __unused.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.4 05-Feb-2016  riastradh branches: 1.4.28;
Need nbtool_config.h for __dead in tools.
 1.3 04-Feb-2016  roy Mark more functions as __dead.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.28.1 02-Aug-2025  perseant Sync with HEAD
 1.2 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.58;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.58.1 02-Aug-2025  perseant Sync with HEAD
 1.2 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.2 12-Apr-2025  rin tools: Add ctfdump(1) when MKCTF is enabled

Although this is not required for build, this small (only with three
additional source files) tool provides good diagnostics.

Especially useful on non-BSD hosts.

Tested on Ubuntu/amd64 24.04 and macOS 13.7 in addition to NetBSD.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.56; 1.1.1.1.58;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.58.1 02-Aug-2025  perseant Sync with HEAD
 1.1.1.1.56.1 14-Apr-2025  martin Pull up following revision(s) (requested by rin in ticket #1096):

tools/what/Makefile: revision 1.1
external/cddl/osnet/usr.bin/ctfdump/Makefile: revision 1.10
tools/ctfmerge/Makefile: revision 1.13
tools/Makefile: revision 1.228
tools/Makefile: revision 1.229
tools/Makefile.ctftools: revision 1.1
usr.bin/what/what.c: revision 1.16
tools/Makefile: revision 1.230
tools/ctfconvert/Makefile: revision 1.12
tools/ctfdump/Makefile: revision 1.1
external/cddl/osnet/dist/tools/ctf/dump/dump.c: revision 1.3
external/cddl/osnet/dist/tools/ctf/common/utils.c: revision 1.2
(all via patch)

tools: Factor out Makefile.ctftools from ctf{convert,merge}

This adds missing libelf.a dependency to ctfmerge. Otherwise NFC.
tools: Add ctfdump(1) when MKCTF is enabled

Although this is not required for build, this small (only with three
additional source files) tool provides good diagnostics.

Especially useful on non-BSD hosts.
Tested on Ubuntu/amd64 24.04 and macOS 13.7 in addition to NetBSD.

tools: Add what(1); not mandatory, but provides good diagnostics

tools/Makefile: Add missing `\` for previous
 1.3 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.2 04-Feb-2016  roy branches: 1.2.28;
Mark more functions as __printflike and __dead.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.28.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Jun-2019  skrll Toolify
 1.3 21-Feb-2010  darran branches: 1.3.46;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.8 25-May-2023  lukem ctfmerge: fix macOS semaphore implementation, part 2

dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.
 1.7 23-May-2023  lukem ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().

macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).
This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().

Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103.
 1.6 23-May-2023  lukem ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented
 1.5 20-Jun-2019  skrll branches: 1.5.10;
Toolify
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 13-Feb-2016  christos branches: 1.3.14;
reduce ifdefs
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.10.1 30-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #221):

external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.18
external/cddl/osnet/sys/sys/opentypes.h: revision 1.7
tools/compat/configure: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.6
external/cddl/osnet/dist/tools/ctf/cvt/barrier.h: revision 1.4
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.7
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.8
tools/compat/configure.ac: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c: revision 1.10
tools/compat/nbtool_config.h.in: revision 1.54

ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:

ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented

ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).

This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103

tools/compat: regen for dispatch_semaphore_create

ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.

osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.

So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.4 23-May-2023  lukem ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().

macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).
This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().

Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103.
 1.3 28-May-2018  chs branches: 1.3.12;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.12.1 30-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #221):

external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.18
external/cddl/osnet/sys/sys/opentypes.h: revision 1.7
tools/compat/configure: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.6
external/cddl/osnet/dist/tools/ctf/cvt/barrier.h: revision 1.4
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.7
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.8
tools/compat/configure.ac: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c: revision 1.10
tools/compat/nbtool_config.h.in: revision 1.54

ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:

ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented

ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).

This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103

tools/compat: regen for dispatch_semaphore_create

ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.

osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.

So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.16 05-May-2025  christos need to roundup the pointer for functions.
 1.15 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.14 28-May-2018  chs branches: 1.14.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.13 18-Mar-2016  christos branches: 1.13.14;
write references as pointers XXX:
 1.12 18-Mar-2016  christos treat class line struct and union
 1.11 18-Mar-2016  christos swap first, then write.
 1.10 04-Feb-2016  roy More printflike and dead fixes.
 1.9 21-Oct-2015  christos make too many struct or union members non-fatal.
 1.8 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.7 09-Mar-2014  christos sync with freebsd
 1.6 10-Jan-2012  darran branches: 1.6.6;
Fix a segfault in ctfmerge.

GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0xFFFFFFFF.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35998 .

GCC is currently doing this for external/bsd/tmux/dist/compat/imsg-buffer.c:
readelf -a --debug-dump imsg-buffer.o
...
<2><6e3>: Abbrev Number: 32 (DW_TAG_union_type)
<6e4> DW_AT_byte_size : 0xffffffff
<6e8> DW_AT_decl_file : 1
<6e9> DW_AT_decl_line : 229
<6ea> DW_AT_sibling : <0x705>

This resulted in ctfconvert generating a faulty CTF entry which then caused the
segfault in ctfmerge.

The fix has ctfconvert check for the bogus 0xFFFFFFFF value and works around it.
It also adds some protection to ctfmerge to avoid the segfault and fail
more gracefully if the error should occur in the future.
 1.5 11-Mar-2010  darran branches: 1.5.6;
DTrace: The CTF format is limited to only 1024 elements in an enum,
so rather than error out when there are more than this just truncate the
length.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.6.1 17-Apr-2012  yamt sync with head
 1.6.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.14.14.1 02-Aug-2025  perseant Sync with HEAD
 1.7 18-Sep-2025  christos PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.
 1.6 28-May-2018  chs branches: 1.6.4; 1.6.12; 1.6.16;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 20-Feb-2016  joerg branches: 1.5.14;
Don't nuke input on errors, it makes debugging a nightmare.
 1.4 04-Feb-2016  roy More printflike and dead fixes.
 1.3 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6.16.1 24-Sep-2025  martin Pull up following revision(s) (requested by ozaki-r in ticket #35):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.8
external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.9
external/cddl/osnet/dist/tools/ctf/cvt/ctfconvert.c: revision 1.7

PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.

ctfconvert: supply more HAVE_NBTOOL_CONFIG_H
PR toolchain/59659
 1.6.12.1 24-Sep-2025  martin Pull up following revision(s) (requested by ozaki-r in ticket #1163):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.8
external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.9
external/cddl/osnet/dist/tools/ctf/cvt/ctfconvert.c: revision 1.7

PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.

ctfconvert: supply more HAVE_NBTOOL_CONFIG_H
PR toolchain/59659
 1.6.4.1 24-Sep-2025  martin Pull up following revision(s) (requested by ozaki-r in ticket #1969):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.8
external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.9
external/cddl/osnet/dist/tools/ctf/cvt/ctfconvert.c: revision 1.7

PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.

ctfconvert: supply more HAVE_NBTOOL_CONFIG_H
PR toolchain/59659
 1.21 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.20 04-May-2024  uwe branches: 1.20.2;
ctfmerge: obey CTFMERGE_TERMINATE_NO_UNLINK as a tool too
 1.19 03-May-2024  christos add an environment variable to override the number ot threads.
 1.18 23-May-2023  lukem ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented
 1.17 13-Oct-2019  christos branches: 1.17.8;
make worker thread prototype match the pthread_create signature.
 1.16 28-May-2018  chs branches: 1.16.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.15 20-Feb-2016  joerg branches: 1.15.14;
Don't nuke input on errors, it makes debugging a nightmare.
 1.14 04-Feb-2016  roy Mark more functions as __dead.
 1.13 24-Sep-2015  christos %j needs uintmax_t not uintptr_t
 1.12 06-Jul-2015  chs reapply some fixes to make multi-threaded ctfmerge work
that were lost in the overzealous resync with freebsd.
remove the hacks which were applied to work around those problems.
 1.11 06-Mar-2015  christos XXX: Use only a single thread. We seem to have a bug in our threading code
that causes us to hang in the ksem code if we use more than one.
 1.10 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.9 09-Mar-2014  christos branches: 1.9.4;
Temporarily add a -S flag to limit the number of threads.
 1.8 09-Mar-2014  christos fix constant name
 1.7 09-Mar-2014  christos sync with freebsd
 1.6 12-Jan-2014  riz Field width is an int, so cast the result of strlen() appropriately.
 1.5 25-Feb-2010  darran branches: 1.5.6; 1.5.12;
DTrace: fix CTF tools for non-toolchain build.
 1.4 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.4.1 16-Jul-2015  snj Pull up following revision(s) (requested by chs in ticket #866):
external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.12 via patch
share/mk/sys.mk: revision 1.128
reapply some fixes to make multi-threaded ctfmerge work
that were lost in the overzealous resync with freebsd.
remove the hacks which were applied to work around those problems.
 1.15.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.16.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.17.8.1 30-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #221):

external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.18
external/cddl/osnet/sys/sys/opentypes.h: revision 1.7
tools/compat/configure: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.6
external/cddl/osnet/dist/tools/ctf/cvt/barrier.h: revision 1.4
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.7
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.8
tools/compat/configure.ac: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c: revision 1.10
tools/compat/nbtool_config.h.in: revision 1.54

ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:

ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented

ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).

This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103

tools/compat: regen for dispatch_semaphore_create

ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.

osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.

So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.20.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 09-Mar-2014  christos sync with freebsd
 1.3 21-Feb-2010  darran branches: 1.3.6; 1.3.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10 07-Jan-2026  nia osnet: Sprinkle <sys/endian.h> inclusion.

prompted by PR pkg/59839
 1.9 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.8 28-May-2018  chs branches: 1.8.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 18-Mar-2016  christos branches: 1.7.14;
Add support for c++ classes.
 1.6 18-Mar-2016  christos - Add processing for c++ references.
- Make sure we load the DIE that contains the types of array elements so
we can resolve them later.
- Print t_id (die offsets) in hex.
 1.5 04-Feb-2016  roy More printflike and dead fixes.
 1.4 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.3 09-Mar-2014  christos sync with freebsd
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.14.1 02-Aug-2025  perseant Sync with HEAD
 1.30 25-Jul-2025  hans Fix typo introduced in 1.29
 1.29 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.28 05-May-2025  mrg fix the i386 build.

format specifiers didn't match between Dwarf_* types and printf(),
and since some of them want to be "long long unsigned" on i386,
force everything to be that type and those printf formats.
 1.27 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.26 31-Mar-2021  simonb branches: 1.26.8;
Simplify the CTF float encoding type logic: all floating point types of
4 bytes or less are "float", 8 bytes or less are "double" and 16 bytes
or less are "long double". Make ctfconvert much happier with N32 ABI
where we have 4 byte pointers and 16 byte long doubles. Will also help
ctfconvert if ever used on m68k or 32-bit RISC-V.

@christos: LGTM
 1.25 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.24 31-Dec-2017  christos branches: 1.24.2;
add trivial handling for DW_ATE_UTF, does not work.
 1.23 08-Jun-2016  christos Grr, gcc-5.4 creates DW_AT_typedef without DW_AT_type for HARD_REG_SET!

<1><c26b>: Abbrev Number: 4 (DW_TAG_typedef)
<c26c> DW_AT_name : (indirect string, offset: 0x16e30): HARD_REG_ELT_TYPE
<c270> DW_AT_decl_file : 57
<c271> DW_AT_decl_line : 43
<c272> DW_AT_type : <0x70>
<1><c276>: Abbrev Number: 102 (DW_TAG_typedef)
<c277> DW_AT_name : (indirect string, offset: 0x2f954): HARD_REG_SET
<c27b> DW_AT_decl_file : 57
<c27c> DW_AT_decl_line : 54
 1.22 18-Mar-2016  christos Add support for c++ classes.
 1.21 18-Mar-2016  christos fix printf format
 1.20 18-Mar-2016  christos - Add processing for c++ references.
- Make sure we load the DIE that contains the types of array elements so
we can resolve them later.
- Print t_id (die offsets) in hex.
 1.19 01-Mar-2016  joerg Merge r274564 from FreeBSD:
Fix a couple of bugs around the handling of structs and unions of size zero.
These would cause ctfconvert(1) to return an error when attempting to
resolve valid C types.
 1.18 21-Feb-2016  joerg Keep the if chain going.
 1.17 20-Feb-2016  joerg Clang 3.7 and newer provide the array size via DW_AT_count, not via
DW_AT_upper_bound. Recognize the former as well as the latter.
 1.16 20-Feb-2016  christos - don't barf if the object does not have DWARF debug data.
- bump size of types to 1K to avoid string overflow
(both are needed for the new elftoolchain).
 1.15 27-Dec-2015  christos add return
 1.14 29-Sep-2015  christos for the endian macros don't use the _ names, Darwin does not define them.
 1.13 24-Sep-2015  christos %j needs uintmax_t not uintptr_t
 1.12 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.11 01-Nov-2014  christos don't fail for anonymous unions.
 1.10 05-Apr-2014  christos branches: 1.10.2;
Handle assembly code built with -g
 1.9 09-Mar-2014  christos branches: 1.9.2;
put back our local fixes:
- don't die on unresolved types.
- it is ok to have 0 sized arrays in structs
- forward enum decls.
 1.8 09-Mar-2014  christos sync with freebsd
 1.7 03-Mar-2014  christos Don't core-dump if a type cannot be resolved. Still gives an error.
 1.6 18-Jan-2013  christos Handle enum forward declarations.
 1.5 10-Jan-2012  darran branches: 1.5.6;
Fix a segfault in ctfmerge.

GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0xFFFFFFFF.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35998 .

GCC is currently doing this for external/bsd/tmux/dist/compat/imsg-buffer.c:
readelf -a --debug-dump imsg-buffer.o
...
<2><6e3>: Abbrev Number: 32 (DW_TAG_union_type)
<6e4> DW_AT_byte_size : 0xffffffff
<6e8> DW_AT_decl_file : 1
<6e9> DW_AT_decl_line : 229
<6ea> DW_AT_sibling : <0x705>

This resulted in ctfconvert generating a faulty CTF entry which then caused the
segfault in ctfmerge.

The fix has ctfconvert check for the bogus 0xFFFFFFFF value and works around it.
It also adds some protection to ctfmerge to avoid the segfault and fail
more gracefully if the error should occur in the future.
 1.4 24-Feb-2010  darran branches: 1.4.6;
DTrace: Get the CTF tools building as part of the toolchain.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.6.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.6.2 23-Jan-2013  yamt sync with head
 1.4.6.1 17-Apr-2012  yamt sync with head
 1.5.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.6.1 25-Feb-2013  tls resync with head
 1.9.2.1 10-Aug-2014  tls Rebase.
 1.10.2.1 29-Jun-2015  snj Pull up following revision(s) (requested by chs in ticket #855):
external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c: revision 1.11
don't fail for anonymous unions.
 1.24.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.26.8.1 02-Aug-2025  perseant Sync with HEAD
 1.2 20-Jun-2019  skrll Toolify
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.46;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.9 19-Sep-2025  ozaki-r ctfconvert: supply more HAVE_NBTOOL_CONFIG_H

PR toolchain/59659
 1.8 18-Sep-2025  christos PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.
 1.7 05-Mar-2020  wiz branches: 1.7.6; 1.7.10;
genric -> generic
 1.6 05-Mar-2020  riastradh Revert "Add fixup operation to remove private mutex types for x86."

The x86 (and arm) definitions of struct kmutex are no longer defined
differently depending on __MUTEX_PRIVATE.
 1.5 16-Jul-2019  hannken branches: 1.5.2;
XXX: A crude hack to bring down the number of types for a
GENRIC kernel below 2**15-1 (from ~34000 to ~29800).

Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.
 1.4 16-Jul-2019  hannken Add fixup operation to remove private mutex types for x86.

For GENERIC the number of types goes down from 47351 to 33981.
 1.3 24-Feb-2010  darran branches: 1.3.46;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.2.2 24-Sep-2025  martin Pull up following revision(s) (requested by ozaki-r in ticket #1969):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.8
external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.9
external/cddl/osnet/dist/tools/ctf/cvt/ctfconvert.c: revision 1.7

PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.

ctfconvert: supply more HAVE_NBTOOL_CONFIG_H
PR toolchain/59659
 1.5.2.1 13-May-2020  martin Pull up following revision(s) (requested by chs in ticket #905):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.6

Revert "Add fixup operation to remove private mutex types for x86."

The x86 (and arm) definitions of struct kmutex are no longer defined
differently depending on __MUTEX_PRIVATE.
 1.7.10.1 24-Sep-2025  martin Pull up following revision(s) (requested by ozaki-r in ticket #35):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.8
external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.9
external/cddl/osnet/dist/tools/ctf/cvt/ctfconvert.c: revision 1.7

PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.

ctfconvert: supply more HAVE_NBTOOL_CONFIG_H
PR toolchain/59659
 1.7.6.1 24-Sep-2025  martin Pull up following revision(s) (requested by ozaki-r in ticket #1163):

external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.8
external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c: revision 1.9
external/cddl/osnet/dist/tools/ctf/cvt/ctfconvert.c: revision 1.7

PR/59659: Ryota Ozaki: Make the tool version behave the same way as the native.

ctfconvert: supply more HAVE_NBTOOL_CONFIG_H
PR toolchain/59659
 1.3 20-Jun-2019  skrll Toolify
 1.2 21-Feb-2010  darran branches: 1.2.46;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 21-Feb-2020  joerg Explicitly cast pointers to uintptr_t before casting to enums. They are
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
 1.3 24-Feb-2010  darran branches: 1.3.46;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.46.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4 09-Mar-2014  christos sync with freebsd
 1.3 24-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 10-Apr-2016  christos branches: 1.7.14;
Apply revision 274569 from FreeBSD:
Only compare visitation counters if they've both been set for the current
type graph walk.
 1.6 18-Mar-2016  christos Add support for c++ classes.
 1.5 18-Mar-2016  christos - Add processing for c++ references.
- Make sure we load the DIE that contains the types of array elements so
we can resolve them later.
- Print t_id (die offsets) in hex.
 1.4 27-Mar-2014  christos kill sprintf
 1.3 24-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10 25-Dec-2022  christos Don't bail out if the input file does not have a symbol table. This happens
with crtn.o which used to have an empty symbol table with binutils 2.34,
with binutils 2.39 has no symbol table.
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 18-Mar-2016  christos branches: 1.8.14;
Add support for c++ classes.
 1.7 18-Mar-2016  christos Add references.
 1.6 29-Sep-2015  christos for the endian macros don't use the _ names, Darwin does not define them.
 1.5 09-Mar-2014  christos sync with freebsd
 1.4 24-Feb-2010  darran branches: 1.4.6; 1.4.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 17-Mar-2016  christos branches: 1.7.14;
Avoid longjmp clobbering
 1.6 04-Feb-2016  roy More printflike and dead fixes.
 1.5 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 09-Mar-2014  christos sync with freebsd
 1.3 24-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 07-Feb-2015  christos branches: 1.5.14;
check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 09-Mar-2014  christos sync with freebsd
 1.3 24-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 20-Jun-2019  skrll Toolify
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.46;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.5 20-Jun-2019  skrll Toolify
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 20-Feb-2016  joerg branches: 1.3.14;
Shuffle include order to avoid missing free on glibc.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.10 23-May-2023  lukem ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented
 1.9 28-May-2018  chs branches: 1.9.12;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 18-Mar-2016  christos branches: 1.8.14;
Add support for c++ classes.
 1.7 18-Mar-2016  christos spell restrict
 1.6 18-Mar-2016  christos Add references, comments.
 1.5 18-Mar-2016  christos add references.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.12.1 30-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #221):

external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.18
external/cddl/osnet/sys/sys/opentypes.h: revision 1.7
tools/compat/configure: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.6
external/cddl/osnet/dist/tools/ctf/cvt/barrier.h: revision 1.4
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.7
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.8
tools/compat/configure.ac: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c: revision 1.10
tools/compat/nbtool_config.h.in: revision 1.54

ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:

ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented

ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).

This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103

tools/compat: regen for dispatch_semaphore_create

ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.

osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.

So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.6 18-Mar-2016  christos Add support for c++ classes.
 1.5 18-Mar-2016  christos - Add processing for c++ references.
- Make sure we load the DIE that contains the types of array elements so
we can resolve them later.
- Print t_id (die offsets) in hex.
 1.4 09-Mar-2014  christos sync with freebsd
 1.3 24-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 07-Feb-2015  christos branches: 1.5.14;
check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 09-Mar-2014  christos sync with freebsd
 1.3 24-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: Get the CTF tools building as part of the toolchain.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.3 12-Apr-2025  rin tools: Add ctfdump(1) when MKCTF is enabled

Although this is not required for build, this small (only with three
additional source files) tool provides good diagnostics.

Especially useful on non-BSD hosts.

Tested on Ubuntu/amd64 24.04 and macOS 13.7 in addition to NetBSD.
 1.2 21-Feb-2010  darran branches: 1.2.56; 1.2.58;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.58.1 02-Aug-2025  perseant Sync with HEAD
 1.2.56.1 14-Apr-2025  martin Pull up following revision(s) (requested by rin in ticket #1096):

tools/what/Makefile: revision 1.1
external/cddl/osnet/usr.bin/ctfdump/Makefile: revision 1.10
tools/ctfmerge/Makefile: revision 1.13
tools/Makefile: revision 1.228
tools/Makefile: revision 1.229
tools/Makefile.ctftools: revision 1.1
usr.bin/what/what.c: revision 1.16
tools/Makefile: revision 1.230
tools/ctfconvert/Makefile: revision 1.12
tools/ctfdump/Makefile: revision 1.1
external/cddl/osnet/dist/tools/ctf/dump/dump.c: revision 1.3
external/cddl/osnet/dist/tools/ctf/common/utils.c: revision 1.2
(all via patch)

tools: Factor out Makefile.ctftools from ctf{convert,merge}

This adds missing libelf.a dependency to ctfmerge. Otherwise NFC.
tools: Add ctfdump(1) when MKCTF is enabled

Although this is not required for build, this small (only with three
additional source files) tool provides good diagnostics.

Especially useful on non-BSD hosts.
Tested on Ubuntu/amd64 24.04 and macOS 13.7 in addition to NetBSD.

tools: Add what(1); not mandatory, but provides good diagnostics

tools/Makefile: Add missing `\` for previous
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.h was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 21-Jun-2013  christos branches: 1.1.1; 1.1.2; 1.1.8;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.8.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.8.1 21-Jun-2013  yamt file fasttrap_isa.h was added on branch yamt-pagecache on 2014-05-22 14:01:23 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file fasttrap_isa.h was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 27-Feb-2010  haad branches: 1.2.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.42 03-Aug-2023  mrg fix uninitialised variable usage.

found by GCC 12.
 1.41 17-Nov-2020  chs Remove a pointless printf.
 1.40 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.39 05-Jul-2019  hannken branches: 1.39.2;
Change module type to "MODULE_CLASS_MISC" to allow preloading.

Change "dtrace_nullop()" to return zero, it gets casted to "int (*)(...)".
 1.38 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.37 06-Jun-2018  kamil branches: 1.37.2;
Correct compilation of osnet/dist/uts/common/dtrace/dtrace.c under Clang

Add missing const keywords in dtrace_strncmp().

Initialize lim1 and lim2 to zero always. This prevents a false positive
about potentially unset but used variable.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.36 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.35 07-Jan-2017  christos branches: 1.35.4; 1.35.12;
PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.34 09-Oct-2016  christos PR/51539: Henning Petersen: replace , with ;
 1.33 17-Jul-2016  pgoyette Use C99 initializers for the cdevsw

No functional change intended or expected.
 1.32 23-Jun-2016  pgoyette branches: 1.32.2;
Import fix from FreeBSD - see [1], [2] references below...

Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
 1.31 14-May-2016  chs apply the ustack() parts of freebsd r211608:

r211608 | rpaulo | 2010-08-22 03:53:32 -0700 (Sun, 22 Aug 2010) | 8 lines

Kernel DTrace support for:
o uregs (sson@)
o ustack (sson@)
o /dev/dtrace/helper device (needed for USDT probes)

The work done by me was:
Sponsored by: The FreeBSD Foundation

plus a few netbsd-specific tweaks from me.
fixes PR 50790.
 1.30 07-Mar-2015  christos constify
 1.29 31-Jan-2015  wiz Comment out currently unused dtrace_dof_char function (for clang build).
 1.28 26-Jul-2014  ryoon branches: 1.28.2;
Fix dtrace kernel module build.
Add nodiscard to cdevsw.
They are not fixed in fallocate/fdiscard changes.
 1.27 27-Mar-2014  christos branches: 1.27.2;
kill sprintf
 1.26 07-Mar-2014  ozaki-r Fix build of DTrace with GCC 4.8

Use __diagused for a variable which is only referred by KASSERT.

Advised by matt@
 1.25 05-Mar-2014  tron Fix build of DTrace with GCC 4.8.
 1.24 05-Mar-2014  ozaki-r Add defined(__arm__)
 1.23 21-Jun-2013  christos rename delay to xdelay to avoid conflicts.
 1.22 14-Apr-2013  christos stub out for now
 1.21 03-Mar-2013  christos need to be a DRIVER class module to be able to autoload when /dev/dtrace/dtrace
is opened.
 1.20 16-Jun-2012  chs branches: 1.20.2;
reduce diff to freebsd:
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
 1.19 19-Oct-2011  yamt branches: 1.19.2;
because our xcall stuff can't be used in softint, use kernel threads
for cleaner/deadman low-level cyclic replacement. PR/44905
 1.18 07-Sep-2011  christos catch up with vmem_alloc signature change.
 1.17 31-Aug-2011  christos fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
 1.16 26-Jul-2011  yamt mark this driver D_MPSAFE
 1.15 26-Jul-2011  yamt fix a merge botch in rev.1.7
 1.14 18-Jul-2011  christos better fix for gcc uninitialized.
 1.13 18-Jul-2011  christos fix gcc uninitialized warnings
 1.12 22-Aug-2010  christos Adapt to new module locking regime. Is that even right?
 1.11 23-Apr-2010  ahoka Remove a couple of zero length kmem_frees.

It should fix at least one crash when unloading the dtrace module,
possibly many others.
 1.10 13-Mar-2010  christos make dtrace compile on amd64.
 1.9 12-Mar-2010  darran DTrace: Add the Function Boundary Trace (FBT) provider moduile. This
module instruments every function in the kernel with entry and exit
probes. These probes are true zero-effect probes in that they don't
exist in the code until they are enabled. The probes are enabled by
directly patching the function entry and exit points to make jumps into
the dtrace framework.
This gives us over 29,000 trace points in the kernel.
 1.8 11-Mar-2010  darran DTrace: fix a few build issues for tools and the dtrace provider operation
interface.
 1.7 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.6 25-Feb-2010  darran DTrace: okay *really* fix the deadman exit handling. No need for that
over-complicated handshake. Fixes a lockdebug mutex held issue.
 1.5 25-Feb-2010  darran DTrace: fix a problem with the code waiting for the deadman thread to exit
- now it does actually wait for it to exit. Thanks to Frank Kardel for
spotting this.
 1.4 24-Feb-2010  darran Fix a bug in the dtrace_state_deadman() thread; return should have been
a continue (thanks Frank!).
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.19.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.2.1 30-Oct-2012  yamt sync with head
 1.20.2.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.2.1 23-Jun-2013  tls resync from head
 1.27.2.1 10-Aug-2014  tls Rebase.
 1.28.2.1 10-Jul-2016  martin Pull up following revision(s) (requested by pgoyette in ticket #1189):
external/cddl/osnet/sys/kern/string.c: revision 1.3
external/cddl/osnet/dev/dtrace/dtrace_hacks.c: revision 1.5
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.32
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.6
Import fix from FreeBSD - see [1], [2] references below...
Fix DTrace's panic() action.
It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call
vpanic(9)
directly.
Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".
[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module. Removes another 'redefined symbol'
error when loading the module.
Related to PR kern/51265
One more removal of a redefined symbol while loading dtrace module.
Should finish the issues with PR kern/51265
 1.32.2.7 20-Mar-2017  pgoyette Sync with HEAD
 1.32.2.6 04-Nov-2016  pgoyette Sync with HEAD
 1.32.2.5 26-Jul-2016  pgoyette More renaming of LOCALCOUNT_INITIALIZER --> DEVSW_MODULE_INIT
 1.32.2.4 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.32.2.3 18-Jul-2016  pgoyette More rump drivers that need to have a 'struct localcount' when built
as modules.
 1.32.2.2 17-Jul-2016  pgoyette Add the d_localcount member to the various {b,c}devsw structures.

No need for these to be conditional on _MODULE as dtrace is always
a module.
 1.32.2.1 16-Jul-2016  pgoyette Add an initializer for the cdevsw's localcount.

XXX These should maybe be converted to C99-style structure initialization?
 1.35.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.35.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.35.4.2 29-Apr-2017  pgoyette Revise previous. Rather than explicitly including <sys/localcount.h>
in all the places where {b,c}devsw is initialized, just include it
from <sys/conf.h>. This avoids an include-sequence dependancy.
 1.35.4.1 29-Apr-2017  pgoyette Add DEVSW_MODULE_INIT to existing device-driver modules, so that they
willl have a localcount defined and thus be permitted to load. Without
a localcount, loading the module will return EINVAL.

XXX the dtrace and drm stuff might need to be fed back upstream?
 1.37.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.2.1 10-Jun-2019  christos Sync with HEAD
 1.39.2.1 06-Jul-2021  martin Pull up following revision(s) (requested by riastradh in ticket #1316):

external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.41

Remove a pointless printf.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dtrace_xoroshiro128_plus.c was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dtrace_xoroshiro128_plus.h was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 27-Mar-2014  christos branches: 1.4.24;
kill sprintf
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 24-Sep-2015  christos remove dup copies of code that we've moved to dev a long while ago
 1.4 21-Jun-2013  christos rename delay to xdelay to avoid conflicts.
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3.12.1 23-Jun-2013  tls resync from head
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4 24-Sep-2015  christos remove dup copies of code that we've moved to dev a long while ago
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 24-Sep-2015  christos remove dup copies of code that we've moved to dev a long while ago
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 24-Sep-2015  christos remove dup copies of code that we've moved to dev a long while ago
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 14-Dec-2010  haad branches: 1.2.44;
Add NetBSD version of zfs snapshot management code. IT needs testing it
was only compile tested for now, but I would like to have some code in to be
sure that it will not be lost.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file vnode.c was added on branch pgoyette-compat on 2018-06-25 07:25:20 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file THIRDPARTYLICENSE.lz4 was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file THIRDPARTYLICENSE.lz4.descrip was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.23 03-May-2026  kre Adapt to thorpej@'s uvm_lwp_is_pagedaemon() change

This is one step towards fixing the builds.
 1.22 03-Aug-2022  chs change the ARC reclaim code to use the pagedaemon's free page target
rather than having a separate target.
 1.21 04-May-2022  chs fix ARC checks for available memory:
there's an extra check that we inherited from FreeBSD that tries to
detect KVA exhaustion on platforms with limited KVA, but the condition
that decided whether to use the extra check was using a FreeBSDism
that doesn't exist on NetBSD, resulting in this check being used on
all platforms. on amd64 systems with lots of memory, this extra check
would result in the ARC thinking that it constantly needed to reclaim memory,
resulting in all the xcall threads running all the time but not doing
anything useful. change this condition so that this extra check for
KVA exhaustion is only used on 32-bit platforms. fixes PR 55707.
 1.20 21-Apr-2021  hannken Prevent blocking l2arc_feed_thread() forever, skip the
cv_timedwait() for negative or zero ticks.
 1.19 11-Jun-2020  ad uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.18 31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.17 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.16 09-Dec-2019  sevan We currently lack a tunable to control ZFS prefetch, so skip the warning and
FreeBSD specific instructions on settings.
 1.15 01-Dec-2019  jmcneill Provide a default ptob() implementation
 1.14 26-May-2019  hannken branches: 1.14.2;
Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
 1.13 23-May-2019  hannken Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.12 28-May-2018  chs branches: 1.12.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.11 27-Jan-2012  para branches: 1.11.38;
extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
 1.10 20-Nov-2011  christos enough with the compile time warnings.
 1.9 06-May-2010  haad branches: 1.9.6;
Disable uvm_reclaim_hook for userland builds.
 1.8 06-May-2010  haad Fix difference btween solaris cv_timedwait and NetBSD one. NetBSD takes
offset from current time and solaris exact time from unix born.
 1.7 03-Apr-2010  christos don't use NULL for 0
 1.6 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.5 11-Oct-2009  haad Cast physmem to (uint64_t) so it works on a amd64 system with more than 4Gb ram.
undef btop if it was already included from other NetBSD header file.
 1.4 12-Aug-2009  haad Register callbacks for reclaiming kvm kernel space to arc. Unregister both
kvm address space and memory callbacks from kernel during arc_fini call.
 1.3 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.9.6.1 17-Apr-2012  yamt sync with head
 1.11.38.1 25-Jun-2018  pgoyette Sync with HEAD
 1.12.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.12.2.1 10-Jun-2019  christos Sync with HEAD
 1.14.2.3 22-Apr-2021  martin Pull up following revision(s) (requested by hannken in ticket #1250):

external/cddl/osnet/dist/uts/common/fs/zfs/arc.c: revision 1.20

Prevent blocking l2arc_feed_thread() forever, skip the
cv_timedwait() for negative or zero ticks.
 1.14.2.2 11-Dec-2019  martin Pull up following revision(s) (requested by sevan in ticket #540):

external/cddl/osnet/dist/uts/common/fs/zfs/arc.c: revision 1.16

We currently lack a tunable to control ZFS prefetch, so skip the warning and
FreeBSD specific instructions on settings.
 1.14.2.1 08-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #515):

external/cddl/osnet/dist/uts/common/fs/zfs/arc.c: revision 1.15
share/mk/bsd.own.mk: revision 1.1167
external/cddl/osnet/dist/uts/common/os/fm.c: revision 1.2

Provide a default ptob() implementation
Need sys/atomic.h on NetBSD
Enable ZFS support on aarch64
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file blkptr.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file bpobj.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file bptree.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file bqueue.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.8 26-May-2019  hannken Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
 1.7 23-May-2019  hannken Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.6 28-May-2018  chs branches: 1.6.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 19-Feb-2016  joerg branches: 1.5.14;
Don't use #pragma weak to implicitly change argument types.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 11-Oct-2009  haad Cast physmem to (uint64_t) so it works on a amd64 system with more than 4Gb ram.
undef btop if it was already included from other NetBSD header file.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6.2.1 10-Jun-2019  christos Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 27-Mar-2014  christos branches: 1.2.24;
kill sprintf
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 27-Feb-2010  haad branches: 1.1.1.1.6; 1.1.1.1.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.1.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 27-Feb-2010  haad branches: 1.1.1.1.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7 05-Apr-2024  simonb Apply FreeBSD svn r373278 fix for ZFS corruption. Fix for NetBSD
PR kern/58111 .

It would be extremely unlikely to trip this bug on NetBSD, as we don't
expose SEEK_DATA and SEEK_HOLE and you need to call ioctl(2) with
FIOSEEKDATA and FIOSEEKHOLE directly which no currently known code does,
and even then be unlucky enough to trip a race condition.

With a reproducer based on that in https://www.illumos.org/issues/16087,
I saw 11 groups of failures over 8 hours. With this patch, no
failures in 10 hours. The repro for NetBSD will be attached to
https://gnats.netbsd.org/58111 .

Original FreeBSD commit message:
 1.6 28-May-2018  chs branches: 1.6.4; 1.6.12;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 11-Apr-2015  riastradh branches: 1.5.14;
Disable another xuio branch.
 1.4 19-Mar-2015  riastradh Move initialization of XUIO_XUZC_PRIV out of #ifdef PORT_SOLARIS.

This code is not currently used, so no functional change, but it may
be used when we hook zfs into the ubc.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6.12.1 18-Nov-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1014):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c: revision 1.7

Apply FreeBSD svn r373278 fix for ZFS corruption. Fix for NetBSD
PR kern/58111 .

It would be extremely unlikely to trip this bug on NetBSD, as we don't
expose SEEK_DATA and SEEK_HOLE and you need to call ioctl(2) with
FIOSEEKDATA and FIOSEEKHOLE directly which no currently known code does,
and even then be unlucky enough to trip a race condition.

With a reproducer based on that in https://www.illumos.org/issues/16087,
I saw 11 groups of failures over 8 hours. With this patch, no
failures in 10 hours. The repro for NetBSD will be attached to
https://gnats.netbsd.org/58111

Original FreeBSD commit message:
 1.6.4.1 18-Nov-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1928):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c: revision 1.7

Apply FreeBSD svn r373278 fix for ZFS corruption. Fix for NetBSD
PR kern/58111 .

It would be extremely unlikely to trip this bug on NetBSD, as we don't
expose SEEK_DATA and SEEK_HOLE and you need to call ioctl(2) with
FIOSEEKDATA and FIOSEEKHOLE directly which no currently known code does,
and even then be unlucky enough to trip a race condition.

With a reproducer based on that in https://www.illumos.org/issues/16087,
I saw 11 groups of failures over 8 hours. With this patch, no
failures in 10 hours. The repro for NetBSD will be attached to
https://gnats.netbsd.org/58111

Original FreeBSD commit message:
 1.4 15-Oct-2019  hannken Add missing "#ifdef _KERNEL" to fix the build of userland zfs libraries.
 1.3 14-Oct-2019  hannken Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"
 1.2 28-May-2018  chs branches: 1.2.2; 1.2.4; 1.2.6;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.6.1 15-Oct-2019  martin Pull up following revision(s) (requested by hannken in ticket #308):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.21
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c: revision 1.3
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h: revision 1.4

Change dmu_diff() back to use a "file" instead of a "vnode".

Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"

-

Add missing "#ifdef _KERNEL" to fix the build of userland zfs libraries.
 1.2.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file dmu_diff.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 12-Jan-2019  hannken Need FOF_UPDATE_OFFSET to update the offset on plain files.

Running "zfs send" to plain files no longer writes garbage.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 09-Oct-2020  kardel PR kern/55705:
don't attempt to sleep for negative time, we are late anyway - avoids DIAGNOSTIC panic
 1.5 09-Mar-2020  fox external/cddl/osnet: Fix possible signed integer overflow

Detected by UBSan and fixed upstream

Cherry-pick:
From 05852b3467b44cdf88541ec67624cd1f5f2ded1d Mon Sep 17 00:00:00 2001
From: luozhengzheng <luo.zhengzheng@zte.com.cn>
Date: Fri, 14 Oct 2016 05:25:05 +0800
Subject: [PATCH] Fix coverity defects: CID 147571, 147574

CID 147571: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
CID 147574: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5268

Reviewed by: kamil@
 1.4 21-Jun-2019  hannken Disable assertion: illumos 7793 ztest fails assertion in dmu_tx_willuse_space
 1.3 03-Jun-2018  chs branches: 1.3.2;
avoid calling kpause() with a delay of 0.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 24-Aug-2019  hannken Add missing dmu_zfetch_fini() when dnode_create() lost the race.
 1.7 26-May-2019  hannken branches: 1.7.2;
Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
 1.6 23-May-2019  hannken Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 21-Jun-2013  christos branches: 1.4.26;
rename delay to xdelay to avoid conflicts.
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.12.1 23-Jun-2013  tls resync from head
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.26.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.7.2.1 26-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #115):

external/cddl/osnet/dist/uts/common/fs/zfs/dnode.c: revision 1.8

Add missing dmu_zfetch_fini() when dnode_create() lost the race.
 1.7 07-Sep-2020  christos Comment out index out of bounds debugging code.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 21-Jun-2013  christos branches: 1.5.26;
rename delay to xdelay to avoid conflicts.
 1.4 06-May-2010  haad branches: 1.4.6; 1.4.12;
Fix zfs version 22 merge error.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.12.1 23-Jun-2013  tls resync from head
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.26.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_bookmark.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.5 13-Aug-2019  hannken Add missing "defined(__NetBSD__)" to make "zfs promote" work.
 1.4 22-May-2019  hannken branches: 1.4.2;
Enable the zvol minor management to create and remove device nodes.
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 19-Feb-2016  joerg branches: 1.2.14;
dmu_objset_rename is an alias for dsl_dataset_rename, but differs in
constness of the first argument. Newer clang checks for this and
prohibits it, so just be consistent by constifying the latter.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.4.2.1 13-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #52):

external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c: revision 1.5

Add missing "defined(__NetBSD__)" to make "zfs promote" work.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_deadlist.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_destroy.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.3 22-May-2019  hannken Enable the zvol minor management to create and remove device nodes.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 10-Jun-2019  christos Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 24-Jun-2020  jdolecek reduce stack usage in dsl_scan_recurse() - allocate memory for
temporary zbookmark_phys_t using kmem_alloc() rather than stack;
this recuses several times usually, and this saves 2x
sizeof(zbookmark_phys_t) == 64 bytes per recursion

part of fix for PR kern/55402 by Frank Kardel
 1.2 24-Jun-2020  jdolecek change dsl_scan_visitbp() to allocate blkptr_t dynamically rather than
on-stack - this function is called recursively, and the 120 bytes per call
add up; also remove unused variable

part of fix for PR kern/55402 by Frank Kardel
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_scan.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_userhold.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file edonr_zfs.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.2 01-Mar-2010  haad Remove fletcher.c from dist it was moved to common/zfs/zfs_fletcher.c in upstream.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file lz4.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 09-Mar-2020  fox external/cddl/osnet: Fix possible null pointer access.

Detected by UBSan and fixed upstream, pick only the fix from the commit.

Cherry-pick:
From 928e8ad47d3478a3d5d01f0dd6ae74a9371af65e Mon Sep 17 00:00:00 2001
From: Serapheim Dimitropoulos <serapheimd@gmail.com>
Date: Wed, 20 Feb 2019 09:59:57 -0800
Subject: [PATCH] Introduce auxiliary metaslab histograms

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #8358

Reviewed by: kamil@
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file multilist.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file range_tree.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 26-May-2019  hannken Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
 1.3 23-May-2019  hannken Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.2 28-May-2018  chs branches: 1.2.2; 1.2.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.4.1 10-Jun-2019  christos Sync with HEAD
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file sa.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file skein_zfs.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.12 12-Apr-2023  riastradh kern: Nix mutex_owner.

There is no valid reason to use this except in assertions of the form

KASSERT(mutex_owner(lock) == curlwp),

which is more obviously spelled as

KASSERT(mutex_owned(lock)).

Exception: There's one horrible kludge in zfs that abuses this, which
should be eliminated.

XXX kernel revbump -- deleting symbol

PR kern/47114
 1.11 09-Mar-2020  fox external/cddl/osnet: Fix possible signed integer overflow

Detected by UBSan and fixed upstream

Cherry-pick:
From 05852b3467b44cdf88541ec67624cd1f5f2ded1d Mon Sep 17 00:00:00 2001
From: luozhengzheng <luo.zhengzheng@zte.com.cn>
Date: Fri, 14 Oct 2016 05:25:05 +0800
Subject: [PATCH] Fix coverity defects: CID 147571, 147574

CID 147571: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
CID 147574: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5268

Reviewed by: kamil@
 1.10 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.9 22-May-2019  hannken Enable the zvol minor management to create and remove device nodes.
 1.8 07-May-2019  hannken This implementation of Solaris taskq API is incomplete and doesn't track
Solaris upstream. FreeBSD already replaced it with a glue to their
taskqueue API.

Replace it with a glue component that queues Solaris taskq requests to
threadpool jobs.
 1.7 28-May-2018  chs branches: 1.7.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 27-Mar-2014  christos branches: 1.6.24;
kill sprintf
 1.5 20-Nov-2011  christos branches: 1.5.6;
enough with the compile time warnings.
 1.4 10-May-2010  haad branches: 1.4.6;
Fix spa_thread to compile under the NetBSD.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 05-Oct-2009  haad Do not use sysent solaris framework there is no such thing in a NetBSD.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.6.1 17-Apr-2012  yamt sync with head
 1.5.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 21-Nov-2011  christos branches: 1.6.38;
make this compile again. VOP_CLOSE is really vn_close() through macros.
 1.5 21-Nov-2011  christos close file in a way that it does not trigger an assertion :-)
now zpool create works again.
 1.4 09-Mar-2011  riz branches: 1.4.4;
If the config is zero size, don't try to read it.

OK haad@
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.4.1 17-Apr-2012  yamt sync with head
 1.6.38.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 19-Feb-2020  riastradh Mark previous #ifdef __NetBSD__, per request from hannken.
 1.5 19-Feb-2020  riastradh Report the OS name and release appropriately for NetBSD.

We are not OpenSolaris or uts!
 1.4 28-May-2018  chs branches: 1.4.2; 1.4.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.4.1 25-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #725):

etc/rc.d/mountall: revision 1.12
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.59
external/cddl/osnet/sys/kern/misc.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.5
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.6
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.60
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.61

Define VOP_STRATEGY on zfs device nodes too.
Fixes eternal hangs in attempts to do I/O on device nodes on zfs.
XXX pullup

Teach zfs spec nodes to VOP_BWRITE too.
Fixes hang on writing to, e.g., ffs mounted on a device node that
lives on zfs.
XXX pullup

Teach device nodes on zfs to handle fsync by calling spec_fsync too.
If zfs=YES, unconditioally do zfs mount/unmount -a.

If you set zfs=YES, presumably you positively want the automatic rc.d
actions, so if there's no /sbin/zfs or if zfs can't find pools with
/etc/zfs/zpool.cache, presumably you would like feedback about that
in rc.log.

Report the OS name and release appropriately for NetBSD.
We are not OpenSolaris or uts!

Mark previous #ifdef __NetBSD__, per request from hannken.
 1.4.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5 07-May-2019  hannken Cleanup modules "solaris" and "zfs":

- Defer spa_config_load() until root is mounted.
- Restore the config path to "/etc/zfs/zpool.cache".
- Module "zfs" is type MODULE_CLASS_VFS and no longer depends on "rootvnode".
- Module "solaris" no longer depends on "mp_online".
- Fix rump component registration to not detach "/dev/zfs" if
it didn't attach it.
 1.4 15-Nov-2018  riastradh Be consistent about _KERNEL vs _HARDKERNEL in zfs.

As it happens, on x86 both _HARDKERNEL and _KERNEL get defined; see
the conditional in sys/rump/Makefile.rump that _refrains_ from
defining _RUMPKERNEL on x86.

So the only version of this code that has been tested is the one with
all of it included. But on, e.g., aarch64, we do not get _HARDKERNEL
here, and the code fails to build because some things use the field
struct spa::spa_deadman_cycid under _KERNEL when it is declared only
under _HARDKERNEL.

If there's a reason _not_ to use this in rump -- and it's not obvious
to me why -- then all access to the field needs to agree to use
_HARDKERNEL.
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 28-Mar-2014  ozaki-r branches: 1.2.24;
Complete migrating to snprintf_blkptr
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 19-May-2010  haad branches: 1.4.44;
Do not initialize space map cv twice.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file space_reftree.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file trim_map.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 20-Nov-2011  christos branches: 1.4.38;
enough with the compile time warnings.
 1.3 27-Feb-2010  haad branches: 1.3.6;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.6.1 17-Apr-2012  yamt sync with head
 1.4.38.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.7 15-Apr-2024  simonb Add a newline to a printf message.
 1.6 15-Nov-2018  riastradh branches: 1.6.2; 1.6.10;
"PRIu64", not llu, to print uint64_t.
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 20-Nov-2011  christos branches: 1.4.38;
enough with the compile time warnings.
 1.3 27-Feb-2010  haad branches: 1.3.6;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.6.1 17-Apr-2012  yamt sync with head
 1.4.38.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.4.38.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.6.10.1 18-Nov-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1014):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c: revision 1.7

Apply FreeBSD svn r373278 fix for ZFS corruption. Fix for NetBSD
PR kern/58111 .

It would be extremely unlikely to trip this bug on NetBSD, as we don't
expose SEEK_DATA and SEEK_HOLE and you need to call ioctl(2) with
FIOSEEKDATA and FIOSEEKHOLE directly which no currently known code does,
and even then be unlucky enough to trip a race condition.

With a reproducer based on that in https://www.illumos.org/issues/16087,
I saw 11 groups of failures over 8 hours. With this patch, no
failures in 10 hours. The repro for NetBSD will be attached to
https://gnats.netbsd.org/58111

Original FreeBSD commit message:
 1.6.2.1 18-Nov-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1928):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c: revision 1.7

Apply FreeBSD svn r373278 fix for ZFS corruption. Fix for NetBSD
PR kern/58111 .

It would be extremely unlikely to trip this bug on NetBSD, as we don't
expose SEEK_DATA and SEEK_HOLE and you need to call ioctl(2) with
FIOSEEKDATA and FIOSEEKHOLE directly which no currently known code does,
and even then be unlucky enough to trip a race condition.

With a reproducer based on that in https://www.illumos.org/issues/16087,
I saw 11 groups of failures over 8 hours. With this patch, no
failures in 10 hours. The repro for NetBSD will be attached to
https://gnats.netbsd.org/58111

Original FreeBSD commit message:
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.20 16-Apr-2022  hannken Unlock vnode for VOP_IOCTL().
 1.19 28-Nov-2020  yhardy Use vn_close to release the vnodes in the error handling blocks, since
the vnodes were opened for writing. Fix proposed on current-users
and improved by hannken@.
 1.18 25-Jun-2020  mlelstv Don't assume everything is a wedge and has a parent device. On non-wedges
this crashes.

Instead, just talk to the referenced device and rely on the dk driver
to pass requests correctly.
 1.17 21-Jun-2020  jmcneill If calling d_minphys on the parent disk device, make sure we use the
parent disk device's dev_t. Fixes zfs on wedges on ld(4).

XXX pullup-9
 1.16 29-Apr-2020  riastradh Set up more of a fake struct buf, for ldminphys.

Fixes:

arm64# zpool create rpool ld4
[ 198.4376097] panic: Trap: Data Abort (EL1): Translation Fault L1 with read access for 0000000000000178: pc ffffc0000017acf4: opcode f940bc00: ldr x0, [x0,#376]
[ 198.4694793] fp ffffc00073026660 ldminphys() at ffffc0000017acf4 netbsd:ldminphys+0x34
[ 198.4792624] fp ffffc00073026680 vdev_disk_open.part.4() at ffffc000013d4c4c zfs:vdev_disk_open.part.4+0x37c
[ 198.4792624] fp ffffc000730268d0 vdev_open() at ffffc000013d2530 zfs:vdev_open+0x68
[ 198.4792624] fp ffffc00073026920 vdev_open_children() at ffffc000013d2958 zfs:vdev_open_children+0x40
[ 198.4792624] fp ffffc00073026950 vdev_root_open() at ffffc000013dad48 zfs:vdev_root_open+0x30

XXX pullup-9
 1.15 02-Mar-2020  riastradh New ioctl DIOCGSECTORALIGN returns sector alignment parameters.

struct disk_sectoralign {
/* First aligned sector number. */
uint32_t dsa_firstaligned;

/* Number of sectors per aligned unit. */
uint32_t dsa_alignment;
};

- Teach wd(4) to get it from ATA.
- Teach cgd(4) to pass it through from the underlying disk.
- Teach dk(4) to pass it through with adjustments.
- Teach zpool (zfs) to take advantage of it.
=> XXX zpool doesn't seem to understand when the vdev's starting
sector is misaligned.

Missing:

- ccd(4) and raidframe(4) support -- these should support _using_
DIOCGSECTORALIGN to decide where to start putting ccd or raid
stripes on disk, and these should perhaps _implement_
DIOCGSECTORALIGN by reporting the stripe/interleave factor.

- sd(4) support -- I don't know any obvious way to get it from SCSI,
but if any SCSI wizards know better than I, please feel free to
teach sd(4) about it!

- any ld(4) attachments -- might be worth teaching the ld drivers for
nvme and various raid controllers to get the aligned sector size

There's some duplicate logic here for now. I'm doing it this way,
rather than gathering the logic into a new disklabel_sectoralign
function or something, so that this change is limited to adding a new
ioctl, without any new kernel symbols, in order to make it easy to
pull up to netbsd-9 without worrying about the module ABI.
 1.14 29-Feb-2020  mlelstv Use utility functions to handle disk geometry.
 1.13 01-Dec-2019  jmcneill Initialize b_dev before passing buf to d_minphys (ldminphys needs this)
 1.12 20-Aug-2019  hannken Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.
 1.11 12-Jun-2019  kamil branches: 1.11.2;
Fix build with -Wgnu-designator in the ZFS code

struct buf buf = { b_bcount: MAXPHYS }; is a legacy style designator
extension and this raised a compiler error reported by a.rin@mix.
 1.10 11-Jun-2019  hannken Try to retrieve the per-disk maximum transfer size and use it instead
of MAXPHYS. Eagerly waiting for the merge of tls-maxphys.

Addresses PR port-xen/54273: "zpool create pool xbd2" panics DOMU kernel
 1.9 26-May-2019  hannken upport wedges as vdevs, use DIOCGWEDGEINFO before DIOCGPARTINFO.

PR kern/54219 zpool create pool dk5 causes kernel panic
 1.8 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.7 28-May-2018  chs branches: 1.7.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 08-Dec-2015  christos branches: 1.6.14;
catch up with DIOCGPART -> DIOCGPARTINFO
 1.5 20-Nov-2011  christos enough with the compile time warnings.
 1.4 24-Jun-2010  hannken branches: 1.4.6;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.6.1 17-Apr-2012  yamt sync with head
 1.6.14.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.11.2.6 29-Nov-2020  martin Pull up following revision(s) (requested by yhardy in ticket #1138):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.19

Use vn_close to release the vnodes in the error handling blocks, since
the vnodes were opened for writing. Fix proposed on tech-kern
and improved by hannken@.
 1.11.2.5 30-Jun-2020  martin Pull up following revision(s) (requested by jmcneill in ticket #970):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.17
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.18

If calling d_minphys on the parent disk device, make sure we use the
parent disk device's dev_t. Fixes zfs on wedges on ld(4).
XXX pullup-9

Don't assume everything is a wedge and has a parent device. On non-wedges
this crashes.

Instead, just talk to the referenced device and rely on the dk driver
to pass requests correctly.
 1.11.2.4 29-Apr-2020  martin Pull up following revision(s) (requested by riastradh in ticket #870):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.16

Set up more of a fake struct buf, for ldminphys.

Fixes:
arm64# zpool create rpool ld4
[ 198.4376097] panic: Trap: Data Abort (EL1): Translation Fault L1 with read access for 0000000000000178: pc ffffc0000017acf4: opcode f940bc00: ldr x0, [x0,#376]
[ 198.4694793] fp ffffc00073026660 ldminphys() at ffffc0000017acf4 netbsd:ldminphys+0x34
[ 198.4792624] fp ffffc00073026680 vdev_disk_open.part.4() at ffffc000013d4c4c zfs:vdev_disk_open.part.4+0x37c
[ 198.4792624] fp ffffc000730268d0 vdev_open() at ffffc000013d2530 zfs:vdev_open+0x68
[ 198.4792624] fp ffffc00073026920 vdev_open_children() at ffffc000013d2958 zfs:vdev_open_children+0x40
[ 198.4792624] fp ffffc00073026950 vdev_root_open() at ffffc000013dad48 zfs:vdev_root_open+0x30

XXX pullup-9
 1.11.2.3 21-Mar-2020  martin Pull up following revision(s) (requested by riastradh in ticket #788):

sys/sys/dkio.h: revision 1.26
sys/dev/dkwedge/dk.c: revision 1.100
sys/sys/disk.h: revision 1.75
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.14
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.15
sys/dev/cgd.c: revision 1.121
sys/dev/ata/wdvar.h: revision 1.50
sys/kern/subr_disk_open.c: revision 1.15
sys/dev/ata/wd.c: revision 1.459

New ioctl DIOCGSECTORALIGN returns sector alignment parameters.

struct disk_sectoralign {
/* First aligned sector number. */
uint32_t dsa_firstaligned;
/* Number of sectors per aligned unit. */
uint32_t dsa_alignment;
};

- Teach wd(4) to get it from ATA.
- Teach cgd(4) to pass it through from the underlying disk.
- Teach dk(4) to pass it through with adjustments.
- Teach zpool (zfs) to take advantage of it.
=> XXX zpool doesn't seem to understand when the vdev's starting
sector is misaligned.

Missing:
- ccd(4) and raidframe(4) support -- these should support _using_
DIOCGSECTORALIGN to decide where to start putting ccd or raid
stripes on disk, and these should perhaps _implement_
DIOCGSECTORALIGN by reporting the stripe/interleave factor.
- sd(4) support -- I don't know any obvious way to get it from SCSI,
but if any SCSI wizards know better than I, please feel free to
teach sd(4) about it!
- any ld(4) attachments -- might be worth teaching the ld drivers for
nvme and various raid controllers to get the aligned sector size

There's some duplicate logic here for now. I'm doing it this way,
rather than gathering the logic into a new disklabel_sectoralign
function or something, so that this change is limited to adding a new
ioctl, without any new kernel symbols, in order to make it easy to
pull up to netbsd-9 without worrying about the module ABI.

Make getdiskinfo() compatible with a DIOCGWEDGEINFO.

dkw_parent is defined to hold the disk name as used by disk_find(), not
a partition (i.e. no partition letter appended).

Use utility functions to handle disk geometry.
 1.11.2.2 08-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #514):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.13

Initialize b_dev before passing buf to d_minphys (ldminphys needs this)
 1.11.2.1 20-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #101):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.12

Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 23-Sep-2013  christos branches: 1.2.24;
not nice to play with resid before checking for error, but this is how they
fixed it, and I am following suit. I would have preferred if (error && resid)
instead.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file vdev_geom.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.2 18-Aug-2018  christos vdev_inuse might not be called and spare_guid contains random stuff.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.2.44.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 27-Jun-2020  jdolecek fix bug introduced in conversion to kmem(9), passing address of the local
variable instead of pointer to allocated memory

should fix PR kern/55426 by Andreas Gustafsson
 1.2 24-Jun-2020  jdolecek reduce stack usage in vdev_queue_io_to_issue() - zio_t is about 1KB, and
the function potentially recurses into itself

part of fix for PR kern/55402 by Frank Kardel
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 07-Sep-2020  mrg i can't confirm or deny that GCC 9 is wrong about parity_valid[]
having uninitialised members, but since setting up reconstruct
isn't a hot path, just zero init the whole thing to be sure.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfeature.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs.conf was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.7 21-Dec-2021  hauke Default files to BSD group ownership in line with ffs, after the lead
of FreeBSD <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=139076>
(patch by hannken@)
 1.6 17-Mar-2020  fox external/cddl/osnet: Fix -Werror=maybe-uninitialized error in zfs_acl.c.

Detected by build.sh with MKLIBCSANITIZER=yes and fixed upstream, pick only the fix from the commit.

Upstream commits

https://github.com/zfsonfreebsd/ZoF/commit/100a91aa3e9773f2a2a373c5cb066b52c780716c
https://github.com/openzfs/zfs/commit/100a91aa3e9773f2a2a373c5cb066b52c780716c

Cherry-pick:
From 100a91aa3e9773f2a2a373c5cb066b52c780716c Mon Sep 17 00:00:00 2001
From: Chunwei Chen <david.chen@osnexus.com>
Date: Fri, 17 Jun 2016 17:36:01 -0700
Subject: [PATCH] Fix NFS credential

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4772
Closes #4758

Reviewed by: kamil@
 1.5 07-Sep-2018  christos branches: 1.5.2;
handle clang stupidity
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4.2.1 10-Jun-2019  christos Sync with HEAD
 1.5.2.1 06-Jan-2022  martin Pull up following revision(s) (requested by hauke in ticket #1400):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_acl.c: revision 1.7

Default files to BSD group ownership in line with ffs, after the lead
of FreeBSD <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D139076>
(patch by hannken@)
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.15 17-Feb-2023  kardel provide pathconf for .zfs control directory. avoids errors on
ls -l ../.zfs.
 1.14 04-Nov-2022  hannken branches: 1.14.2;
Add a helper to set or clear lower mount and use it.
Always add a reference to the lower mount.

Ride 9.99.105
 1.13 04-Jul-2021  hannken Add VOP_PARSEPATH to zfs control dir vnode op table.
 1.12 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.11 17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.10 22-Dec-2019  ad Make mntvnode_lock per-mount, and address false sharing of struct mount.
 1.9 18-Mar-2019  hannken Make ZFS exportable by NFS, implement zfsctl_vptofh(),
zfs_netbsd_vptofh() and zfs_netbsd_fhtovp().

Undo changes to now completely unused zfs_fhtovp().
 1.8 18-Mar-2019  hannken Implement zfsctl_lookup_objset() to look up "zfsvfs" of an mounted snapshot.
 1.7 18-Mar-2019  hannken Set "mnt_stat.f_fsid" and "mnt_stat.f_fsidx" from the objset guid
like FreeBSD and Illumos do.

Use "f_fsid" for "va_fsid" and cheat NFSD to export snapshots under
".zfs" by setting these snaphots "f_fsidx" to the parents "f_fsidx".
 1.6 20-Feb-2019  hannken Move fstrans_unmount() to vfs_rele(), just before it would free the mount.
Don't take a mount reference for fstrans as it gets notified about the release.

Defer the final free of the mount to fstrans_mount_dtor() when fstrans
has released all references to this mount. Prevents the mount's memory
to be reused as a new mount before fstrans released all references.

Address PR kern/53928 modules/t_builtin:disable test case randomly fails.
 1.5 05-Feb-2019  hannken Implement the ZFS control directory ".zfs" and its subdirectory 'snapshot".

Automatically mount snapshots on access of ".zfs/snapshot/<snapname>".
 1.4 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 14-Dec-2010  haad branches: 1.2.44;
Add NetBSD version of zfs snapshot management code. IT needs testing it
was only compile tested for now, but I would like to have some code in to be
sure that it will not be lost.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.14.2.1 20-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #872):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c: revision 1.15

provide pathconf for .zfs control directory. avoids errors on
ls -l ../.zfs.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs_debug.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.11 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 09-Apr-2015  riastradh branches: 1.10.14;
Fix return code of rmdir(nonempty) in zfs: ENOTEMPTY, not EEXIST.
 1.9 18-Oct-2012  riastradh Back out accidental commit of errno kludge for rmdir(".") &c.

Solaris returns EEXIST, whereas we want to return ENOTEMPTY (POSIX
allows both), but this got included in an unrelated commit and should
be separated into a common commit for other related error code fixes.
 1.8 15-Oct-2012  riastradh Fail lookup of .. in a deleted directory with ENOENT.

Don't try to zget the parent, whose znode id may have been recycled
by now.

It's not clear to me how Solaris avoids this, but maybe I'm just
missing something obvious.
 1.7 15-Oct-2012  riastradh Simplify zfs dirlock reference counting.

No need to pass dzp around; dl has a pointer to it.
 1.6 15-Oct-2012  riastradh Do reference counting for zfs dirlock waiters.

Solaris relies on cv_broadcast(&cv); cv_destroy(&cv) working, but
that hoses our cv_wait, which needs to continue using cv after it is
woken. Solaris's idiom is an abuse of the condvar abstraction, but
we can get the same effect with reference counting.
 1.5 27-Feb-2010  haad branches: 1.5.6; 1.5.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.4 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.3 07-Aug-2009  haad Fix bogus comment, and remove superfluous parenthesis.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.6.1 30-Oct-2012  yamt sync with head
 1.10.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 14-Sep-2018  christos The macros kidmap_getsidby{u,g}id always return 1 from sid.h on NetBSD,
and clang is complaining about the impossible... So initialize rid and
be done with it, it is the least intrusive fix.
 1.5 18-Aug-2018  christos make sure rid and idx are initialized.
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.3 30-Sep-2018  pgoyette Ssync with HEAD
 1.3.44.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 10-Jun-2019  christos Sync with HEAD
 1.27 27-Mar-2026  yamt zfs: port a fix for data corruption issue from illumos

see https://www.illumos.org/issues/17734 for the details.

note: i didn't bother to patch illumos/freebsd code in our tree.

the original commit message:

> commit f6559a18843abdfa5849b9e74f239f9bd15796d3
> Author: Andy Fiddaman <illumos@fiddaman.net>
> Date: Mon Nov 10 22:52:05 2025 +0000
>
> 17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
> Portions contributed by: Alexander Motin <mav@FreeBSD.org>
> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
> Reviewed by: Toomas Soome <tsoome@me.com>
> Approved by: Dan McDonald <danmcd@edgecast.io>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.26 10-Sep-2023  riastradh branches: 1.26.4;
Revert "Teach zfs bdevsw to do b_psize."

This is used only by dump and swap, which won't work safely on zvols
anyway. We should make swap work eventually, but right now it's
leading unwary ussers into deadlock scenarios, so let's make it fail
early instead.
 1.25 31-Oct-2022  simonb branches: 1.25.2;
Whitespace nit.
 1.24 28-Mar-2022  riastradh driver(9): devsw_detach never fails. Make it return void.

Prune a whole lotta dead branches as a result of this. (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back. To be
cleaned up in subsequent commits...)

XXX kernel ABI change to devsw_detach signature requires bump
 1.23 25-Mar-2021  gdt zfs_ioctl.c: Drop WARNING that ZFS is under development

Following discussions on current-users@, it seems many rely on ZFS to
store data, and there are not particularly large issues with ZFS. ATF
tests with /tmp as tmpfs, ffs2, and zfs are similar, with only a
slight increase in failures under zfs.

(This commit should probably NOT be pulled up to 9.)
 1.22 28-Feb-2020  riastradh Teach zfs bdevsw to do b_psize.

This is needed, among other things, to swap on zvols.

Attempting to swap on zvols currently deadlocks but that's a separate
issue that needs to be fixed too!
 1.21 14-Oct-2019  hannken Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"
 1.20 22-May-2019  hannken branches: 1.20.2;
Add missing zvol_close() to zfsdev_close().

Change zvol_size_changed() to initialize "zv->zv_volsize"
and initialize only "dg_secsize" and "dg_secperunit".
Calling disk_set_info() will initialize the remaining
parts of the geometry.

Set "doread" in zvol_strategy() to make reading from
device possible.

Reorganize/add disk_busy()/disk_unbusy() instrumentation.

Redo zvol_ioctl() to implement DIOCGWEDGEINFO and let
disk_ioctl() process the remaining ioctls.
 1.19 22-May-2019  hannken Enable the zvol minor management to create and remove device nodes.
 1.18 22-May-2019  hannken Update ddi environment:
- Put device major numbers into "dev_info_t".
- Fix an off-by-one in zvol_create_minor().
- When creating a node handle existing nodes
and add owner read/write permission.
- When removing nodes remove now empty directories.
 1.17 07-May-2019  hannken Cleanup modules "solaris" and "zfs":

- Defer spa_config_load() until root is mounted.
- Restore the config path to "/etc/zfs/zpool.cache".
- Module "zfs" is type MODULE_CLASS_VFS and no longer depends on "rootvnode".
- Module "solaris" no longer depends on "mp_online".
- Fix rump component registration to not detach "/dev/zfs" if
it didn't attach it.
 1.16 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.15 12-Jan-2019  hannken The ZFS onexit routines expect opening ZFS_DEV with O_EXCL to return
a cloned device with an unique minor number.

Use fd_clone() on this condition to return a cloned device descriptor.
 1.14 01-Jan-2019  hannken Cannot hold zfs object across call to vcache_get() as it might
deadlock with another reclaim.

Add vfs operation zfs_newvnode() to create a new zfs node and
hold the zfs object in zfs_loadvnode() and zfs_newvnode() only.
 1.13 20-Aug-2018  christos Avoid uninitialized warning.
 1.12 16-Jun-2018  gson branches: 1.12.2;
Use space between words
 1.11 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 10-Apr-2015  riastradh branches: 1.10.2; 1.10.6; 1.10.14;
Use dprintf, not printf, for debug messages.
 1.9 04-Mar-2013  christos let zfs autoload too.
 1.8 20-Nov-2011  christos branches: 1.8.6;
enough with the compile time warnings.
 1.7 21-Jan-2011  pooka branches: 1.7.4;
Don't allow module to init if root is not mounted since the modcmd
wants to traverse the file system. This *might* fix statically
linking zfs support into the kernel (at least it fixes rump kernel
bootstrap).
 1.6 19-May-2010  haad branches: 1.6.2;
Use ddi_copyin and ddi_copyout as solaris does, change them to
ioctl_copyin/ioctl_copyout in kernel and to bcopy in user space.
 1.5 19-May-2010  haad Do not call zfs_init and zfs_fini directly they will be called by vfs routines.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 07-Aug-2009  haad Enable zfs module only for machine with at least 512Mb ram.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.6.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.4.1 17-Apr-2012  yamt sync with head
 1.8.6.1 23-Jun-2013  tls resync from head
 1.10.14.3 18-Jan-2019  pgoyette Synch with HEAD
 1.10.14.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.10.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10.6.1 28-Apr-2017  pgoyette The zfs control device is loaded as a module under rump-server, so
add the localcount stuff to its {b,c}devsw

XXX How to feed this back to upstream?
 1.10.2.3 26-Jul-2016  pgoyette More renaming of LOCALCOUNT_INITIALIZER --> DEVSW_MODULE_INIT
 1.10.2.2 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.10.2.1 18-Jul-2016  pgoyette More rump drivers that need to have a 'struct localcount' when built
as modules.
 1.12.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.12.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.12.2.1 10-Jun-2019  christos Sync with HEAD
 1.20.2.1 15-Oct-2019  martin Pull up following revision(s) (requested by hannken in ticket #308):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.21
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c: revision 1.3
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h: revision 1.4

Change dmu_diff() back to use a "file" instead of a "vnode".

Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"

-

Add missing "#ifdef _KERNEL" to fix the build of userland zfs libraries.
 1.25.2.1 11-Sep-2023  martin Pull up following revision(s) (requested by riastradh in ticket #364):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.26

Revert "Teach zfs bdevsw to do b_psize."

This is used only by dump and swap, which won't work safely on zvols
anyway. We should make swap work eventually, but right now it's
leading unwary ussers into deadlock scenarios, so let's make it fail
early instead.
 1.26.4.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.2 27-Mar-2026  yamt zfs: port a fix for data corruption issue from illumos

see https://www.illumos.org/issues/17734 for the details.

note: i didn't bother to patch illumos/freebsd code in our tree.

the original commit message:

> commit f6559a18843abdfa5849b9e74f239f9bd15796d3
> Author: Andy Fiddaman <illumos@fiddaman.net>
> Date: Mon Nov 10 22:52:05 2025 +0000
>
> 17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
> Portions contributed by: Alexander Motin <mav@FreeBSD.org>
> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
> Reviewed by: Toomas Soome <tsoome@me.com>
> Approved by: Dan McDonald <danmcd@edgecast.io>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.16;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.16.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 12-Jan-2019  hannken The ZFS onexit routines expect opening ZFS_DEV with O_EXCL to return
a cloned device with an unique minor number.

Use fd_clone() on this condition to return a cloned device descriptor.
 1.2 28-May-2018  chs branches: 1.2.2; 1.2.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.2.4.1 10-Jun-2019  christos Sync with HEAD
 1.2.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.2.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 28-May-2018  pgoyette file zfs_onexit.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.12 22-Feb-2019  hannken Always set "cn_namelen" in addition to "cn_nameptr".

Fix vnode locking for REMOVE, RMDIR and RENAME.
 1.11 28-May-2018  chs branches: 1.11.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 07-Feb-2014  hannken branches: 1.10.24;
Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
 1.9 23-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.8 17-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
 1.7 30-Nov-2010  dholland branches: 1.7.6; 1.7.12;
SAVENAME and HASBUF namei flags have been abolished; update zfs to match.
 1.6 24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.5 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.4 11-Jan-2010  tron Replace VATTR_NULL() with vattr_null(). The ZFS module can be loaded
again now.
 1.3 10-Jan-2010  haad Fix problem in ZFS ZIL layer where unclean shutdown of filesystem can change
replayed file permissions to 777. Patch from FreeBSD. Original commit message:

Be careful which vattr fields are set during setattr replay.
Without this fix strange things can appear after unclean shutdown like
files with mode set to 07777.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.7.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11.2.1 10-Jun-2019  christos Sync with HEAD
 1.8 16-Mar-2026  yamt zfs: fix zfs_range_lock_try

the change "zfs: add zfs_range_lock_try" was incomplete.

i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```

this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.
 1.7 20-Feb-2026  yamt zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)

note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.

https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=60004
 1.6 28-May-2018  chs branches: 1.6.16;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 29-Feb-2016  riastradh branches: 1.5.14;
Sprinkle some more zfs range lock reference count kasserts.

From a debugging session months ago, might as well share them.
 1.4 11-Apr-2015  riastradh Make sure rl_t::r_zp is always initialized.
 1.3 11-Apr-2015  riastradh Reduce diff from upstream a little.
 1.2 15-Oct-2012  riastradh Do reference counting for zfs range lock waiters.

Avoid cv_broadcast(&cv); cv_destroy(&cv); which works in Solaris only
by abuse of the condvar abstraction.

There are parts of this code that should be factored into smaller
subroutines, mainly range lock allocation and initialization, but
that would make it harder to merge newer versions of zfs, so for now
I've just expanded those parts further in-line.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.1.2.6.1 30-Oct-2012  yamt sync with head
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6.16.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs_sa.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.35 27-Mar-2026  yamt zfs: use 32-bit st_dev for stat(2)

while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.

however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.

this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.

maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)
although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.

note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)

```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```

[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd

related to PR/60135
https://gnats.netbsd.org/60135
 1.34 26-Mar-2026  yamt zfs: put back deferred atime update to VOP_INACTIVE

we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:

> /*
> * On NetBSD, we need to push out atime updates. Solaris does
> * this during VOP_INACTIVE, but that does not work well with the
> * BSD VFS, so we do it in batch here.
> */

it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?

this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.

note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.

discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html
 1.33 22-Mar-2026  yamt zfs: fix "slow rm" issue

* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.

* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.

note that these two changes depend on each other:

* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.

* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.

an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.

PR/59885
https://gnats.netbsd.org/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html
 1.32 17-Mar-2026  yamt zfs: reject all mount op flags for now

- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)

- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)

this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.

maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.

related to PR/60026
https://gnats.netbsd.org/60026
 1.31 15-Mar-2026  yamt zfs: purge name cache on teardown

this fixes name cache inconsistencies on
certain events. eg. rollback

```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
 1.30 30-Nov-2021  simonb branches: 1.30.6;
In zfs_statvfs(), set f_bresvd and f_fresvd to 0. Fixes random kernel
accounting suspend/resumes with erroneous values leaking out.

Note: no userland leakage as statvfs(2) handler memset 0's the buffer.

XXX: Should be fixed with a memset in VFS_STATVFS().
 1.29 27-Aug-2020  hannken Enable NCLOOKUP for ZFS.
 1.28 26-May-2020  hannken Replace vp->v_count with vrefcnt(vp) and
remove now unneeded "#define v_count ...".
 1.27 13-Apr-2020  ad Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.
 1.26 17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.25 07-Aug-2019  maya validate the length of args (like other filesystems)

ok riastradh
 1.24 17-Jun-2019  hannken Add native vfs_suspend()/vfs_resume() before and after
zfs_suspend_fs()/zfs_resume_fs() and get rid of dead "z_sa_hdl == NULL"
znodes before vfs_resume() to keep the vnode cache consistent.

Live rollback should work now.

PR port-xen/54273 ("zpool create pool xbd2" panics DOMU kernel)
 1.23 22-May-2019  hannken Enable the zvol minor management to create and remove device nodes.
 1.22 15-Apr-2019  hannken Add support for fifos, character and block devices.
 1.21 18-Mar-2019  hannken Make ZFS exportable by NFS, implement zfsctl_vptofh(),
zfs_netbsd_vptofh() and zfs_netbsd_fhtovp().

Undo changes to now completely unused zfs_fhtovp().
 1.20 18-Mar-2019  hannken Set "mnt_stat.f_fsid" and "mnt_stat.f_fsidx" from the objset guid
like FreeBSD and Illumos do.

Use "f_fsid" for "va_fsid" and cheat NFSD to export snapshots under
".zfs" by setting these snaphots "f_fsidx" to the parents "f_fsidx".
 1.19 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.18 01-Jan-2019  hannken Cannot hold zfs object across call to vcache_get() as it might
deadlock with another reclaim.

Add vfs operation zfs_newvnode() to create a new zfs node and
hold the zfs object in zfs_loadvnode() and zfs_newvnode() only.
 1.17 16-Sep-2018  martin Do not initialize .vfs_fhtovp twice
 1.16 28-May-2018  chs branches: 1.16.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.15 17-Feb-2017  hannken branches: 1.15.10;
Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
 1.14 05-Dec-2014  hannken branches: 1.14.2; 1.14.4;
Change zfs to vcache.
- zfs_loadvnode() is based on zfs_zget() plus zfs_znode_alloc().
 1.13 24-May-2014  christos Introduce a selector function to the vfs vnode iterator so that we don't
need to vget() vnodes that we are not interested at, and optimize locking
a bit. Iterator changes reviewed by Hannken (thanks), the rest of the bugs
are mine.
 1.12 16-Apr-2014  maxv An (un)privileged user can easily make the kernel dereference a NULL
pointer.

The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).

ok christos@
 1.11 09-Apr-2014  riastradh Try vflush, which may fail, before we mark the file system mounted.
 1.10 27-Mar-2014  christos branches: 1.10.2;
kill sprintf
 1.9 17-Mar-2014  hannken Change zfs_sync() to use vfs_vnode_iterator.
 1.8 15-Oct-2012  riastradh Fix various issues in zfs life cycle, locking, and vop protocol.

- Restore some zfs locking and unlocking that got lost randomly.

- Enable use of the BSD vnode lock. Lock order: all BSD vnode locks
are taken before all zfs internal locks. There remains an issue with
O_EXCL, to be solved later (famous last words). KASSERT the locking
scheme up the wazoo.

- Take our cruft out of zfs_lookup and move it to zfs_netbsd_lookup.
Restore much of the way zfs_lookup looked to make merging future
versions easier. Disable use of the namecache for now because its
locking dance is too scary to contemplate.

- Implement BSD semantics for rename, to appease our tests. This is
a provisional kludge; eventually we need VOP_RENAME to take a flag
specifying whether to use BSD semantics or POSIX semantics.

- Simplify zfs_netbsd_reclaim and make it work. Now that getnewvnode
never tries to vclean anything itself, we need not worry about
recursion of ZFS_OBJ_MUTEX locks.

- Clarify and fix genfs node initialization and destruction.

zfs passes most of our atf vfs tests now, including the rename races.

Still to do:

- fix the impedance mismatch between our permissions model and zfs's;
- fix O_EXCL (nontrivial);
- throw dirconc at it and see how badly it explodes;
- find why zpool sometimes wedges itself during mkfs; and
- find why pool caches sometimes seem to get corrupted.
 1.7 20-Nov-2011  christos branches: 1.7.2; 1.7.6; 1.7.8; 1.7.10;
enough with the compile time warnings.
 1.6 07-Oct-2011  hannken branches: 1.6.2;
As vnalloc() always allocates with PR_WAITOK there is no longer the need
to test its result for NULL.
 1.5 21-Jul-2010  hannken Make holding v_interlock mandatory for callers of vget().

Announced some time ago on tech-kern.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.6.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.2.2 30-Oct-2012  yamt sync with head
 1.6.2.1 17-Apr-2012  yamt sync with head
 1.7.10.1 21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1050):
sys/ufs/chfs/chfs_vfsops.c: revision 1.11
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/fs/nilfs/nilfs_vfsops.c: revision 1.16
sys/ufs/mfs/mfs_vfsops.c: revision 1.107
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/kern/vfs_syscalls.c: revision 1.478
sys/kern/vfs_syscalls.c: revision 1.479
sys/fs/puffs/puffs_vfsops.c: revision 1.110
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/nfs/nfs_vfsops.c: revision 1.227
sys/fs/v7fs/v7fs_vfsops.c: revision 1.10
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/miscfs/nullfs/null_vfsops.c: revision 1.88
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50
sys/coda/coda_vfsops.c: revision 1.81
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/kern/vfs_syscalls.c: revision 1.480
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/kern/vfs_syscalls.c: revision 1.482
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.12
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/udf/udf_vfsops.c: revision 1.67
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.
ok christos@
An (un)privileged user can easily make the kernel dereference a NULL
pointer.
The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).
ok christos@
Some fs's - like kernfs - set their vfs_min_mount_data to zero. Add a check
to prevent an (un)privileged user from requesting a zero-sized allocation
(and thus a panic).
This thing is totally buggy: 'data_len' is modified by the fs, so calling
kmem_free with it while its value has changed since the kmem_alloc is far
from being a good idea.
If the kernel figures out that something mismatches, it will panic
(typically with kernfs).
 1.7.8.1 21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1050):
sys/ufs/chfs/chfs_vfsops.c: revision 1.11
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/fs/nilfs/nilfs_vfsops.c: revision 1.16
sys/ufs/mfs/mfs_vfsops.c: revision 1.107
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/kern/vfs_syscalls.c: revision 1.478
sys/kern/vfs_syscalls.c: revision 1.479
sys/fs/puffs/puffs_vfsops.c: revision 1.110
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/nfs/nfs_vfsops.c: revision 1.227
sys/fs/v7fs/v7fs_vfsops.c: revision 1.10
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/miscfs/nullfs/null_vfsops.c: revision 1.88
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50
sys/coda/coda_vfsops.c: revision 1.81
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/kern/vfs_syscalls.c: revision 1.480
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/kern/vfs_syscalls.c: revision 1.482
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.12
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/udf/udf_vfsops.c: revision 1.67
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.
ok christos@
An (un)privileged user can easily make the kernel dereference a NULL
pointer.
The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).
ok christos@
Some fs's - like kernfs - set their vfs_min_mount_data to zero. Add a check
to prevent an (un)privileged user from requesting a zero-sized allocation
(and thus a panic).
This thing is totally buggy: 'data_len' is modified by the fs, so calling
kmem_free with it while its value has changed since the kmem_alloc is far
from being a good idea.
If the kernel figures out that something mismatches, it will panic
(typically with kernfs).
 1.7.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.2.1 21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1050):
sys/ufs/chfs/chfs_vfsops.c: revision 1.11
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/fs/nilfs/nilfs_vfsops.c: revision 1.16
sys/ufs/mfs/mfs_vfsops.c: revision 1.107
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/kern/vfs_syscalls.c: revision 1.478
sys/kern/vfs_syscalls.c: revision 1.479
sys/fs/puffs/puffs_vfsops.c: revision 1.110
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/nfs/nfs_vfsops.c: revision 1.227
sys/fs/v7fs/v7fs_vfsops.c: revision 1.10
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/miscfs/nullfs/null_vfsops.c: revision 1.88
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50
sys/coda/coda_vfsops.c: revision 1.81
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/kern/vfs_syscalls.c: revision 1.480
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/kern/vfs_syscalls.c: revision 1.482
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.12
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/udf/udf_vfsops.c: revision 1.67
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.
ok christos@
An (un)privileged user can easily make the kernel dereference a NULL
pointer.
The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).
ok christos@
Some fs's - like kernfs - set their vfs_min_mount_data to zero. Add a check
to prevent an (un)privileged user from requesting a zero-sized allocation
(and thus a panic).
This thing is totally buggy: 'data_len' is modified by the fs, so calling
kmem_free with it while its value has changed since the kmem_alloc is far
from being a good idea.
If the kernel figures out that something mismatches, it will panic
(typically with kernfs).
 1.10.2.1 10-Aug-2014  tls Rebase.
 1.14.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.14.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.15.10.3 18-Jan-2019  pgoyette Synch with HEAD
 1.15.10.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.15.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.16.2.4 21-Apr-2020  martin Sync with HEAD
 1.16.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.16.2.1 10-Jun-2019  christos Sync with HEAD
 1.30.6.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.100 03-May-2026  kre Adapt to thorpej@'s uvm_lwp_is_pagedaemon() change

This is one step towards fixing the builds.
 1.99 27-Mar-2026  yamt zfs: port a fix for data corruption issue from illumos

see https://www.illumos.org/issues/17734 for the details.

note: i didn't bother to patch illumos/freebsd code in our tree.

the original commit message:

> commit f6559a18843abdfa5849b9e74f239f9bd15796d3
> Author: Andy Fiddaman <illumos@fiddaman.net>
> Date: Mon Nov 10 22:52:05 2025 +0000
>
> 17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
> Portions contributed by: Alexander Motin <mav@FreeBSD.org>
> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
> Reviewed by: Toomas Soome <tsoome@me.com>
> Approved by: Dan McDonald <danmcd@edgecast.io>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.98 27-Mar-2026  yamt zfs: use 32-bit st_dev for stat(2)

while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.

however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.

this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.

maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)
although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.

note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)

```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```

[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd

related to PR/60135
https://gnats.netbsd.org/60135
 1.97 26-Mar-2026  yamt zfs: put back deferred atime update to VOP_INACTIVE

we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:

> /*
> * On NetBSD, we need to push out atime updates. Solaris does
> * this during VOP_INACTIVE, but that does not work well with the
> * BSD VFS, so we do it in batch here.
> */

it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?

this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.

note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.

discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html
 1.96 24-Mar-2026  yamt zfs: fix deadlock with GOP_MARKUPDATE

because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")

this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.

for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.

the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.
 1.95 23-Mar-2026  yamt zfs_putapage: don't try to write to zfs in the page daemon context

basically zfs is not prepared to be called safely for page daemon.

for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.

if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.
 1.94 23-Mar-2026  yamt zfs: don't commit the zil for FSYNC_LAZY

FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.
 1.93 23-Mar-2026  yamt zfs: flush mmap pages on fsync

it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.

ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
 1.92 22-Mar-2026  yamt zfs: fix "slow rm" issue

* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.

* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.

note that these two changes depend on each other:

* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.

* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.

an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.

PR/59885
https://gnats.netbsd.org/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html
 1.91 21-Mar-2026  yamt zfs: fix case insensitive / utf-8 normalized file names (cont.)

this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")

for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
 1.90 17-Mar-2026  yamt zfs: remove mysterious comments on read/write ops for spec/fifo
 1.89 17-Mar-2026  yamt zfs_netbsd_gop_markupdate: actually update file timestamp

the implementation before this commit was basically no-op.

some notes:

* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.

* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.

* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.
 1.88 17-Mar-2026  yamt zfs_vnops.c: fix whitespace

no functional changes are intended.
 1.87 15-Mar-2026  yamt zfs: remove unused whiteout logic
 1.86 15-Mar-2026  yamt zfs: fix case insensitive / utf-8 normalized file names

zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.

cf. "casesensitivity" and "normalization" in zfs(8)
 1.85 01-Mar-2026  yamt zfs: reject read() on directory

right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.
 1.84 01-Mar-2026  yamt zfs: fix data loss with some combinations of mmap and write

in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
 1.83 01-Mar-2026  yamt zfs: fix a deadlock in read()

while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.

this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.

although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.
 1.82 20-Feb-2026  yamt zfs_netbsd_putpages: do not make the pagedaemon block on the range lock

blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.

fixes PR/60004
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=60004
 1.81 03-Mar-2023  hannken branches: 1.81.4;
Adapt zfs_netbsd_access() to ACL support. As ZFS itself only
handles VREAD, VWRITE, VEXEC and VAPPEND we use kauth_authorize_vnode()
to handle VADMIN.

From FreeBSD.
 1.80 03-Oct-2022  kardel branches: 1.80.2;
Revert. Spotted by hannken@ - fix needs to be in zfs_ctldir.c it is missing
VOP_PATHCONF.
 1.79 27-Sep-2022  kardel for unsupported names return EINVAL as per TOG
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fpathconf.html
discussed with christos@
 1.78 27-Mar-2022  christos add a kauth vnode check for adding links
 1.77 22-Dec-2021  simonb In zfs_setattr() don't recheck the auth policy for a "nodump" flags
change. zfs_netbsd_setattr() has already checked if this request is
authorised, and our secpolicy_xvattr() doesn't check kauth chflags.

XXX: Fix this propery when we migrate to openzfs.

riastradh@: Seems reasonable.
 1.76 20-Oct-2021  thorpej Overhaul of the EVFILT_VNODE kevent(2) filter:

- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
forcing each individual file system to deal with it (except VOP_RENAME(),
because VOP_RENAME() is a mess and we currently have 2 different ways
of handling it; at least it's reasonably well-centralized in the "new"
way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
to avoid doing work for events no one cares about (avoiding, e.g.
taking locks and traversing the klist to send a NOTE_WRITE when
someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
to be invoked before and after vop_pre() and vop_post(), respectively.
Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
vop_*_args structures. These context fields are used to convey information
between the file system VOP function and the VOP wrapper, but do not
occupy an argument slot in the VOP_*() call itself. These context fields
are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
back the resulting link count of the target vnode. Return this in tmpfs,
udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
 1.75 06-Sep-2021  simonb Clamp zfs nlinks at UINT32_MAX (nlink_t max) instead of (much) smaller
16-bit LINK_MAX until we bump LINK_MAX. Fixes fts(3) problems with
"rm -rf" on zfs directories with > 32766 subdirectories.

Thanks mlelstv@ and mrg@ for helping debug this.
 1.74 18-Jul-2021  dholland Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.
 1.73 18-Jul-2021  dholland Use macros for the canned parts of device and fifo vnode op tables.

Add GENFS_SPECOP_ENTRIES and GENFS_FIFOOP_ENTRIES macros that contain
the portion of the vnode ops table declaration that is
(conservatively) the same in every fs. Use these in every fs that
supports devices and/or fifos with separate ops tables.

Note that ptyfs works differently (it has one type of vnode with
open-coded dispatch to the specfs code, which I haven't changed in
this commit) and rump/librump/rumpvfs/rumpfs.c has an indirect dynamic
dispatch that already does more or less the same thing, which I also
haven't changed.

Also note that this anticipates a few bits in the next changeset here
and there, and adds missing but unreachable calls in some cases (e.g.
most fses weren't defining whiteout on devices and fifos, but it isn't
reachable there), and it changes parsepath on devices and fifos to
genfs_badop from genfs_parsepath (but it's not reachable there
either).

It appears that devices in kernfs were missing kqfilter, so it's
possible that if you try to use kqueue on /kern/rootdev that it'll
explode.

And finally note that the ops declaration tables aren't
order-dependent. (Other than vop_default_desc has to come first.)
Otherwise this wouldn't work.
 1.72 02-Jul-2021  dholland Add VOP_PARSEPATH to zfs's vnode table. "oops"

zfs not being under src/sys strikes again :-(
 1.71 15-Nov-2020  chs Commit the ZFS file that I forgot in this previous commit:

Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately. Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.
In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors. Fixes PR 55702.
 1.70 27-Aug-2020  hannken Enable NCLOOKUP for ZFS.
 1.69 21-May-2020  ad Fix bugs in previous.
 1.68 20-May-2020  ad zfs_netbsd_getpages:

- implement the PGO_LOCKED case
- handle npages > 1 for PGO_SYNCIO
 1.67 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.66 13-May-2020  chs fix the handling in putpage of the page containing EOF.
 1.65 07-May-2020  hannken Revert Rev. 1.63 and add a comment why we have to zil_commit() here:

Operation zfs_znode.c::zfs_zget_cleaner() depends on this
zil_commit() as a barrier to guarantee the znode cannot
get freed before its log entries are resolved.
 1.64 14-Mar-2020  ad Make uvm_pagemarkdirty() responsible for putting vnodes onto the syncer
work list. Proposed on tech-kern@.
 1.63 08-Mar-2020  riastradh Avoid unnecessary zil_commit on rm.

1. Issue zil_commit only if we're actually updating something --
there's no need to commit if we're unlinking the file or if
there's no atime update being applied.

2. Issue zil_commit only if the zfs has sync=always set -- for
sync=standard there's no need for us to commit anything here since
no application asked for an explicit sync.

Speeds up untarring base.tgz on top of itself by a factor of about
2x, and speeds up rm by a factor of about 10x, on my system with an
SSD SLOG over SATA. Histogram of unlink, rmdir, and rename timing
shows dramatic reduction in latency for most samples.

(To be fair, this was not an improvement over zfs; issuing the
unnecessary zil_commit was a self-inflicted performance wound.)
 1.62 23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.61 23-Feb-2020  riastradh Teach device nodes on zfs to handle fsync by calling spec_fsync too.
 1.60 23-Feb-2020  riastradh Teach zfs spec nodes to VOP_BWRITE too.

Fixes hang on writing to, e.g., ffs mounted on a device node that
lives on zfs.

XXX pullup
 1.59 19-Feb-2020  riastradh Define VOP_STRATEGY on zfs device nodes too.

Fixes eternal hangs in attempts to do I/O on device nodes on zfs.

XXX pullup
 1.58 15-Feb-2020  riastradh Teach zfs to revoke vnodes the usual way.

XXX pullup
 1.57 13-Feb-2020  hannken zfs_netbsd_setattr: ignore size changes on device nodes.
 1.56 18-Jan-2020  ad Track page dirtyness for ZFS (yamt-pagecache). I had forgotten that it had
its own cache. Thanks to hannken@ for the repro.
 1.55 15-Jan-2020  ad Merge from yamt-pagecache (after much testing):

- Reduce unnecessary page scan in putpages esp. when an object has a ton of
pages cached but only a few of them are dirty.

- Reduce the number of pmap operations by tracking page dirtiness more
precisely in uvm layer.
 1.54 13-Dec-2019  ad Break the global uvm_pageqlock into a per-page identity lock and a private
lock for use of the pagedaemon policy code. Discussed on tech-kern.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour
 1.53 04-Oct-2019  brad For ZFS on NetBSD there are a number of functions called
zfs_netbsd_{create,mknod,link,etc..} that call functions called
zfs_{create,mknod,link,etc..}. These later functions may return a
error code along with a *vpp that is NULL. This situation was not
handled by the zfs_netbsd_* functions and would result in a panic in a
number of cases. The simplest to trigger it was filling up a dataset
or pool resulting in a over quota condition. An attempt to create
another file, or directory at that point would panic.
 1.52 24-Aug-2019  hannken Implement kqueue support.
 1.51 24-Aug-2019  hannken Implement poll support.
 1.50 17-Jun-2019  hannken branches: 1.50.2;
Add fstrans_start()/fstrans_done() and bounds check to zfs_netbsd_getpages().
 1.49 17-Jun-2019  hannken Skip atime update on dead "z_sa_hdl == NULL" znodes.
 1.48 15-Apr-2019  hannken Add support for fifos, character and block devices.
 1.47 18-Mar-2019  hannken Set "mnt_stat.f_fsid" and "mnt_stat.f_fsidx" from the objset guid
like FreeBSD and Illumos do.

Use "f_fsid" for "va_fsid" and cheat NFSD to export snapshots under
".zfs" by setting these snaphots "f_fsidx" to the parents "f_fsidx".
 1.46 18-Mar-2019  hannken As zfs_netbsd_getpages() ignores "a_count" and processes exactly one page
return an error if "a_count != 1".
 1.45 18-Mar-2019  hannken Change zfs_readdir() to use malloc() instead of kmem_alloc() to
allocate cookies. Required by protocol, caller uses free().
 1.44 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.43 05-Feb-2019  hannken zfs_netbsd_reclaim(): validate "z_log" before zil_commit().
 1.42 05-Jan-2019  hannken Even though zfs_netbsd_putpages() cannot use ZFS_ENTER() it has
to respect the teardown lock.

Enter z_teardown_lock as reader and ZFS_EXIT().

Instead of ZFS_VERIFY_ZP() return without writing and without
error from zfs_putapage() if "z_sa_hdl == NULL".
 1.41 01-Jan-2019  hannken Cannot use ZFS_ENTER() / ZFS_EXIT() as zfs_netbsd_putpages() is used
during vnode reclaim.

Add missing protection with fstrans.
 1.40 01-Jan-2019  hannken As already noted in XXX comment do a zil_commit() on reclaim.
 1.39 13-Dec-2018  hannken Drop v_interlock for zfs_range_lock(), another thread might hold part
of this range and wait for v_interlock.
 1.38 13-Dec-2018  hannken Operation zfs_range_lock() needs range as (offset,length), not as (low,high).
 1.37 06-Dec-2018  hannken We have component names as counted strings (cn_nameptr, cn_namelen) but
ZFS expects a null-terminated name.

Always create a copy with PNBUF_GET()/strlcpy()/PNBUF_PUT().

For LOOKUP use a small buffer on stack and allocate/free compomnent names
longer than 30 chars.
 1.36 30-Nov-2018  hannken Zfs_write() may hide write errors if uiomove() succeeds but a
further dmu_tx_assign() fails because over quota or no space.

Use the emulated uiocopy() and uioskip() like illumos does.

Fix the uiocopy() emulation to not clobber the iovecs.
 1.35 28-Nov-2018  hannken Redo the access check for setting va_flags in zfs_netbsd_setattr().

Use user flag UF_NODUMP instead of UF_IMMUTABLE for the test as it
is the only user flag supported by all tested file systems.

PR kern/47656 test zfs_flags.
 1.34 28-Nov-2018  hannken Add missing access check for REMOVE into zfs_netbsd_lookup().

PR kern/47656 test zfs_dirperms.
 1.33 28-Nov-2018  hannken Add missing access check for setting va_Xtime into zfs_netbsd_setattr().

PR kern/47656 test zfs_times.
 1.32 28-Nov-2018  hannken We expect VOP_ACCESS() to return EACCESS as general error.

Change zfs_netbsd_access() to translate the common EPERM to EACCES.
 1.31 28-Nov-2018  hannken Don't try to release a NULL vnode in zfs_netbsd_rename().
 1.30 28-Nov-2018  hannken Remove an early test for "source and target are equal" from zfs_rename()
that broke BSD semantics.
 1.29 28-Nov-2018  hannken Always unbusy pages in zfs_putapage() after the data has been written
into the DMU. Running fsx no longer hangs the kernel.
 1.28 15-Nov-2018  riastradh Need <dev/mm.h> for mm_md_direct_mapped_phys.

It turns out this code always sees __HAVE_MM_MD_DIRECT_MAPPED_PHYS as
disabled on amd64, for reasons that I shall address forthwith, but it
is enabled on aarch64 and so the MKZFS=yes build breaks.
 1.27 28-May-2018  chs branches: 1.27.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.26 26-May-2017  riastradh branches: 1.26.8;
Make VOP_RECLAIM do the last unlock of the vnode.

VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
 1.25 26-Apr-2017  riastradh Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.

No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
 1.24 11-Apr-2017  riastradh Make VOP_INACTIVE preserve vnode lock on return.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
 1.23 20-Apr-2015  riastradh branches: 1.23.2; 1.23.4;
Make VOP_LINK return directory still locked and referenced.

Ride 7.99.10 bump.
 1.22 10-Apr-2015  riastradh Disable mmap on zfs for now.

The implementation is not coherent with read/write, and apparently it
is is so broken that write(2) on a region mapped from a zfs file will
often fail with EINVAL because something passes an offset that is too
large to getpages.
 1.21 09-Apr-2015  riastradh Pass NetBSD VA_UTIMES_NULL through to ZFS as Solaris ATTR_UTIME.

Makes t_unpriv:zfs_times fail the wrong way instead of silently
allowing the change.
 1.20 09-Apr-2015  riastradh Advisory locking for zfs.
 1.19 09-Apr-2015  riastradh Remove some vestigial #if 0 sections.
 1.18 09-Apr-2014  riastradh Don't forget ZFS_EXIT after ZFS_ENTER.
 1.17 07-Feb-2014  hannken branches: 1.17.2;
Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
 1.16 23-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.15 17-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
 1.14 18-Oct-2012  riastradh Take a first whack at making zfs permissions work.

zfs_access uses secpolicy_vnode_access, so it makes no sense for the
latter to call VOP_ACCESS!

Everything seems to return EACCES instead of EPERM, probably because
that's what kauth returns. This should be fixed, but that may
require some nontrivial surgery to zfs's calls to secpolicy_*, which
is where kauth gets involved.

This commit imports some code from illumos to implement the routine
secpolicy_vnode_setattr. This shouldn't be outside dist/, but for
now it is expedient to do so. We ought to fix that, along with all
the other CDDL code outside dist/, when we next import a newer
version of zfs.
 1.13 16-Oct-2012  riastradh Restore _PC_NO_TRUNC in zfs_netbsd_pathconf.

Accidentally clobbered it in a previous commit while moving patches
around between source trees -- oops.
 1.12 15-Oct-2012  riastradh Fix various issues in zfs life cycle, locking, and vop protocol.

- Restore some zfs locking and unlocking that got lost randomly.

- Enable use of the BSD vnode lock. Lock order: all BSD vnode locks
are taken before all zfs internal locks. There remains an issue with
O_EXCL, to be solved later (famous last words). KASSERT the locking
scheme up the wazoo.

- Take our cruft out of zfs_lookup and move it to zfs_netbsd_lookup.
Restore much of the way zfs_lookup looked to make merging future
versions easier. Disable use of the namecache for now because its
locking dance is too scary to contemplate.

- Implement BSD semantics for rename, to appease our tests. This is
a provisional kludge; eventually we need VOP_RENAME to take a flag
specifying whether to use BSD semantics or POSIX semantics.

- Simplify zfs_netbsd_reclaim and make it work. Now that getnewvnode
never tries to vclean anything itself, we need not worry about
recursion of ZFS_OBJ_MUTEX locks.

- Clarify and fix genfs node initialization and destruction.

zfs passes most of our atf vfs tests now, including the rename races.

Still to do:

- fix the impedance mismatch between our permissions model and zfs's;
- fix O_EXCL (nontrivial);
- throw dirconc at it and see how badly it explodes;
- find why zpool sometimes wedges itself during mkfs; and
- find why pool caches sometimes seem to get corrupted.
 1.11 01-Oct-2012  njoly Add _PC_NO_TRUNC support in zfs_netbsd_pathconf().
 1.10 01-Sep-2012  pooka branches: 1.10.2;
For now, make vop_islocked more like vop_lock and vop_unlock (i.e. don't
even attempt to do anything).
 1.9 20-Nov-2011  christos enough with the compile time warnings.
 1.8 02-Jan-2011  dholland branches: 1.8.6;
Remove references to SAVESTART in zfs.
 1.7 30-Nov-2010  dholland SAVENAME and HASBUF namei flags have been abolished; update zfs to match.
 1.6 25-Jul-2010  hannken VOP_LOCK() will not be called with LK_INTERLOCK.
 1.5 24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 28-Oct-2009  haad Add workaround about zfs vnode reclaiming deadlock by checking if we don't
ehld ZFS_MUTEX_OBJ already. If we can lock OBJ_MUTEX deffer execution of
zfs_zinactive to taskq. Code was inspired by FreeBSD zfs_freebsd_reclaim.

XXX. This needs to be fixed after finding final solution for vnode lifecycle.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.8.6.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.6.2 30-Oct-2012  yamt sync with head
 1.8.6.1 17-Apr-2012  yamt sync with head
 1.10.2.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.17.2.1 10-Aug-2014  tls Rebase.
 1.23.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.23.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.26.8.4 18-Jan-2019  pgoyette Synch with HEAD
 1.26.8.3 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.26.8.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.26.8.1 25-Jun-2018  pgoyette Sync with HEAD
 1.27.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.27.2.1 10-Jun-2019  christos Sync with HEAD
 1.50.2.11 23-Sep-2022  martin Apply patch, requested by dholland in ticket #1532:

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c (apply patch)

Fix mounting of wapbl volumes when the block device node is on a zfs volume.
Fixed differently as part of a bigger change in -current in rev 1.73.
 1.50.2.10 06-Jul-2021  martin Pull up following revision(s) - all via patch -
(requested by riastradh in ticket #1317):

sys/uvm/uvm_page.c: revision 1.248
sys/uvm/uvm_anon.c: revision 1.80
sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.40
sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.41
sys/rump/librump/rumpkern/vm.c: revision 1.191
sys/uvm/uvm_pager.c: revision 1.130
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.71
tests/rump/rumpkern/t_vm.c: revision 1.5
tests/rump/rumpkern/t_vm.c: revision 1.6
sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.39

Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately. Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.

In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors. Fixes PR 55702.

fix an incorrect assertion in the previous commit.

Handle PG_PAGEOUT in uvm_anon_release() too.

Commit the ZFS file that I forgot in this previous commit:

Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately. Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.

In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors. Fixes PR 55702.
update the rump copy of uvm_page_unbusy() to match the real version,
in particular handle PG_PAGEOUT. fixes a few atf tests.
the busypage test is buggy, expect it to fail.

make rump's uvm_aio_aiodone_pages() look more like the kernel version.
fixes some more rumpy assertions.

for the busypage test, replace atf_tc_expect_fail() with atf_tc_skip()
because atf apparently has no way to expect a test program to crash.
fixes PR 55945.
 1.50.2.9 13-May-2020  martin Pull up following revision(s) (requested by chs in ticket #903):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.66

fix the handling in putpage of the page containing EOF.
 1.50.2.8 09-May-2020  martin Pull up following revision(s) (requested by hannken in ticket #897):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.65

Revert Rev. 1.63 and add a comment why we have to zil_commit() here:

Operation zfs_znode.c::zfs_zget_cleaner() depends on this
zil_commit() as a barrier to guarantee the znode cannot
get freed before its log entries are resolved.

Operation zfs_zget_cleaner() cannot fail, comment and add assertions.
 1.50.2.7 09-Mar-2020  martin Pull up following revision(s) (requested by riastradh in ticket #769):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.63

Avoid unnecessary zil_commit on rm.

1. Issue zil_commit only if we're actually updating something --
there's no need to commit if we're unlinking the file or if
there's no atime update being applied.

2. Issue zil_commit only if the zfs has sync=always set -- for
sync=standard there's no need for us to commit anything here since
no application asked for an explicit sync.

Speeds up untarring base.tgz on top of itself by a factor of about
2x, and speeds up rm by a factor of about 10x, on my system with an
SSD SLOG over SATA. Histogram of unlink, rmdir, and rename timing
shows dramatic reduction in latency for most samples.

(To be fair, this was not an improvement over zfs; issuing the
unnecessary zil_commit was a self-inflicted performance wound.)
 1.50.2.6 25-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #725):

etc/rc.d/mountall: revision 1.12
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.59
external/cddl/osnet/sys/kern/misc.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.5
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.6
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.60
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.61

Define VOP_STRATEGY on zfs device nodes too.
Fixes eternal hangs in attempts to do I/O on device nodes on zfs.
XXX pullup

Teach zfs spec nodes to VOP_BWRITE too.
Fixes hang on writing to, e.g., ffs mounted on a device node that
lives on zfs.
XXX pullup

Teach device nodes on zfs to handle fsync by calling spec_fsync too.
If zfs=YES, unconditioally do zfs mount/unmount -a.

If you set zfs=YES, presumably you positively want the automatic rc.d
actions, so if there's no /sbin/zfs or if zfs can't find pools with
/etc/zfs/zpool.cache, presumably you would like feedback about that
in rc.log.

Report the OS name and release appropriately for NetBSD.
We are not OpenSolaris or uts!

Mark previous #ifdef __NetBSD__, per request from hannken.
 1.50.2.5 16-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #710):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.58

Teach zfs to revoke vnodes the usual way.
XXX pullup
 1.50.2.4 16-Feb-2020  martin Pull up following revision(s) (requested by hannken in ticket #709):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.57

zfs_netbsd_setattr: ignore size changes on device nodes.
 1.50.2.3 06-Oct-2019  martin Pull up following revision(s) (requested by brad in ticket #289):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.53

For ZFS on NetBSD there are a number of functions called
zfs_netbsd_{create,mknod,link,etc..} that call functions called
zfs_{create,mknod,link,etc..}. These later functions may return a
error code along with a *vpp that is NULL. This situation was not
handled by the zfs_netbsd_* functions and would result in a panic in a
number of cases. The simplest to trigger it was filling up a dataset
or pool resulting in a over quota condition. An attempt to create
another file, or directory at that point would panic.
 1.50.2.2 26-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #114):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.52

Implement kqueue support.
 1.50.2.1 26-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #113):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.51

Implement poll support.
 1.80.2.1 05-Mar-2023  martin Pull up following revision(s) (requested by hannken in ticket #110):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.81

Adapt zfs_netbsd_access() to ACL support. As ZFS itself only
handles VREAD, VWRITE, VEXEC and VAPPEND we use kauth_authorize_vnode()
to handle VADMIN.

From FreeBSD.
 1.81.4.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.36 22-Mar-2026  yamt zfs: fix "slow rm" issue

* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.

* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.

note that these two changes depend on each other:

* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.

* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.

an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.

PR/59885
https://gnats.netbsd.org/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html
 1.35 15-Mar-2026  yamt zfs: fix case insensitive / utf-8 normalized file names

zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.

cf. "casesensitivity" and "normalization" in zfs(8)
 1.34 27-Aug-2020  hannken branches: 1.34.10;
Enable NCLOOKUP for ZFS.
 1.33 07-May-2020  hannken Operation zfs_zget_cleaner() cannot fail, comment and add assertions.
 1.32 07-May-2020  hannken Revert Rev. 1.31 as it is no longer possible for the handle to be NULL.
 1.31 20-Mar-2020  hannken With zfs_netbsd_reclaim() no longer doing an unconditional
zil commit dmu_buf_get_user() may return a NULL handle when
the znode already disappeared.
 1.30 23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.29 17-Jun-2019  hannken branches: 1.29.2;
Unmap pages when zfs_rezget() re-establishes a znode with its dbufs.
 1.28 26-May-2019  hannken Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
 1.27 23-May-2019  hannken Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.26 15-Apr-2019  hannken Add support for fifos, character and block devices.
 1.25 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.24 01-Jan-2019  hannken Cannot hold zfs object across call to vcache_get() as it might
deadlock with another reclaim.

Add vfs operation zfs_newvnode() to create a new zfs node and
hold the zfs object in zfs_loadvnode() and zfs_newvnode() only.
 1.23 06-Dec-2018  hannken Add missing ZFS_OBJ_HOLD_ENTER() / ZFS_OBJ_HOLD_EXIT() to zfs_zget_cleaner().
 1.22 28-Nov-2018  hannken Add missing sa_buf_rele() into zfs_zget_cleaner().
 1.21 31-Jul-2018  hannken Initialize z_lockf for new znodes.

Ok: Chuck Silvers
 1.20 28-May-2018  chs branches: 1.20.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.19 20-Aug-2016  hannken branches: 1.19.12;
Remove now obsolete operation vcache_remove().

Welcome to 7.99.36
 1.18 05-Dec-2014  hannken Change zfs to vcache.
- zfs_loadvnode() is based on zfs_zget() plus zfs_znode_alloc().
 1.17 05-Dec-2014  hannken Remove vnode creation from zfs_create_fs() and zfs_create_share_dir()
as a vnode is not needed here.

Inspired by FreeBSD r253603.
 1.16 27-Mar-2014  christos kill sprintf
 1.15 21-Oct-2013  christos NetBSD does not have vn_in_dnlc
 1.14 23-Sep-2013  christos Don't forget to destroy the mutex we created to the zfsvfs transient object,
otherwise if we load and unload the module the lockdebug code will blow chunks.
 1.13 15-Oct-2012  riastradh Fix various issues in zfs life cycle, locking, and vop protocol.

- Restore some zfs locking and unlocking that got lost randomly.

- Enable use of the BSD vnode lock. Lock order: all BSD vnode locks
are taken before all zfs internal locks. There remains an issue with
O_EXCL, to be solved later (famous last words). KASSERT the locking
scheme up the wazoo.

- Take our cruft out of zfs_lookup and move it to zfs_netbsd_lookup.
Restore much of the way zfs_lookup looked to make merging future
versions easier. Disable use of the namecache for now because its
locking dance is too scary to contemplate.

- Implement BSD semantics for rename, to appease our tests. This is
a provisional kludge; eventually we need VOP_RENAME to take a flag
specifying whether to use BSD semantics or POSIX semantics.

- Simplify zfs_netbsd_reclaim and make it work. Now that getnewvnode
never tries to vclean anything itself, we need not worry about
recursion of ZFS_OBJ_MUTEX locks.

- Clarify and fix genfs node initialization and destruction.

zfs passes most of our atf vfs tests now, including the rename races.

Still to do:

- fix the impedance mismatch between our permissions model and zfs's;
- fix O_EXCL (nontrivial);
- throw dirconc at it and see how badly it explodes;
- find why zpool sometimes wedges itself during mkfs; and
- find why pool caches sometimes seem to get corrupted.
 1.12 20-Nov-2011  christos branches: 1.12.6;
enough with the compile time warnings.
 1.11 12-Jun-2011  rmind branches: 1.11.2;
Fix ZFS build.
 1.10 10-Mar-2011  pooka branches: 1.10.2;
pass in correct variable, the old code can't possibly be correct.
 1.9 21-Jul-2010  hannken Make holding v_interlock mandatory for callers of vget().

Announced some time ago on tech-kern.
 1.8 24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.7 10-May-2010  haad Get new vnode when creating zfs share dir for it's znode.
 1.6 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.5 11-Jan-2010  tron Replace VATTR_NULL() with vattr_null(). The ZFS module can be loaded
again now.
 1.4 29-Oct-2009  tron Make this build.
 1.3 28-Oct-2009  haad Add workaround about zfs vnode reclaiming deadlock by checking if we don't
ehld ZFS_MUTEX_OBJ already. If we can lock OBJ_MUTEX deffer execution of
zfs_zinactive to taskq. Code was inspired by FreeBSD zfs_freebsd_reclaim.

XXX. This needs to be fixed after finding final solution for vnode lifecycle.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.10.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.11.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.2.2 30-Oct-2012  yamt sync with head
 1.11.2.1 17-Apr-2012  yamt sync with head
 1.12.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.19.12.4 18-Jan-2019  pgoyette Synch with HEAD
 1.19.12.3 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.19.12.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.19.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.20.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.20.2.1 10-Jun-2019  christos Sync with HEAD
 1.29.2.1 09-May-2020  martin Pull up following revision(s) (requested by hannken in ticket #897):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.65

Revert Rev. 1.63 and add a comment why we have to zil_commit() here:

Operation zfs_znode.c::zfs_zget_cleaner() depends on this
zil_commit() as a barrier to guarantee the znode cannot
get freed before its log entries are resolved.

Operation zfs_zget_cleaner() cannot fail, comment and add assertions.
 1.34.10.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7 19-Jun-2020  jdolecek use pool_cache for (meta)data buffers also on NetBSD

this should generally slightly improve performance on MP systems, and
specifically for xbd(4) storage avoids slow unaligned I/O buffer handling

this change requires updated kernel, to allow up to SPA_MAXBLOCKSHIFT item
size for pools

fixes PR kern/55397 by Frank Kardel
 1.6 07-May-2019  hannken This implementation of Solaris taskq API is incomplete and doesn't track
Solaris upstream. FreeBSD already replaced it with a glue to their
taskqueue API.

Replace it with a glue component that queues Solaris taskq requests to
threadpool jobs.
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 27-Mar-2014  christos branches: 1.4.24;
kill sprintf
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.1 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zrlock.c was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.16 27-Mar-2026  yamt zfs: port a fix for data corruption issue from illumos

see https://www.illumos.org/issues/17734 for the details.

note: i didn't bother to patch illumos/freebsd code in our tree.

the original commit message:

> commit f6559a18843abdfa5849b9e74f239f9bd15796d3
> Author: Andy Fiddaman <illumos@fiddaman.net>
> Date: Mon Nov 10 22:52:05 2025 +0000
>
> 17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
> Portions contributed by: Alexander Motin <mav@FreeBSD.org>
> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
> Reviewed by: Toomas Soome <tsoome@me.com>
> Approved by: Dan McDonald <danmcd@edgecast.io>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.15 15-Mar-2026  yamt zfs zvol.c: #ifdef out zvol_log_truncate

the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
 1.14 03-Nov-2024  gdt branches: 1.14.2;
zvol: Implement DIOCCACHESYNC

Similarly to FreeBSD, simply call zil_commit when the DIOCCACHESYNC
ioctl is invoked on a zvol.

Tested in a xen dom0 with a domU's xbds provided by zvol on dom0. The
error message about DIOCCACHESYNC is gone, and (mysteriously)
operations in the domU seem faster.

Thanks to Michael van Elst via port-xen@ for pointing out where/how to
do this.
 1.13 29-Feb-2020  mlelstv branches: 1.13.8; 1.13.10;
Fix disk geometry calculation. Add DIOCGPARTINFO to support
getdisksize() used by other drivers, filesystems and specfs.
 1.12 22-May-2019  hannken Implement disk_rename()/iostat_rename() to rename a disk.

Use it from zvol_rename_minor() when renaming a ZVOL.
 1.11 22-May-2019  hannken Add missing zvol_close() to zfsdev_close().

Change zvol_size_changed() to initialize "zv->zv_volsize"
and initialize only "dg_secsize" and "dg_secperunit".
Calling disk_set_info() will initialize the remaining
parts of the geometry.

Set "doread" in zvol_strategy() to make reading from
device possible.

Reorganize/add disk_busy()/disk_unbusy() instrumentation.

Redo zvol_ioctl() to implement DIOCGWEDGEINFO and let
disk_ioctl() process the remaining ioctls.
 1.10 22-May-2019  hannken Enable the zvol minor management to create and remove device nodes.
 1.9 22-May-2019  hannken Update ddi environment:
- Put device major numbers into "dev_info_t".
- Fix an off-by-one in zvol_create_minor().
- When creating a node handle existing nodes
and add owner read/write permission.
- When removing nodes remove now empty directories.
 1.8 28-May-2018  chs branches: 1.8.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 29-Feb-2016  riastradh branches: 1.7.14;
uint64_t can't be negative.
 1.6 28-Jul-2014  joerg SPEC_MAXOFFSET_T doesn't exist anywhere else, so don't use it here
either.
 1.5 27-Mar-2014  christos branches: 1.5.2;
kill sprintf
 1.4 24-Jun-2010  hannken branches: 1.4.6; 1.4.12;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.2.1 10-Aug-2014  tls Rebase.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.8.2.1 10-Jun-2019  christos Sync with HEAD
 1.13.10.1 02-Aug-2025  perseant Sync with HEAD
 1.13.8.1 17-Nov-2024  martin Pull up following revision(s) (requested by gdt in ticket #1001):

external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.14

zvol: Implement DIOCCACHESYNC

Similarly to FreeBSD, simply call zil_commit when the DIOCCACHESYNC
ioctl is invoked on a zvol.

Tested in a xen dom0 with a domU's xbds provided by zvol on dom0. The
error message about DIOCCACHESYNC is gone, and (mysteriously)
operations in the domU seem faster.

Thanks to Michael van Elst via port-xen@ for pointing out where/how to
do this.
 1.14.2.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file blkptr.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file bpobj.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file bptree.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file bqueue.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 28-Mar-2014  ozaki-r branches: 1.2.24;
Complete migrating to snprintf_blkptr
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 27-Mar-2014  christos branches: 1.2.24;
kill sprintf
 1.1 27-Feb-2010  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 27-Feb-2010  haad branches: 1.1.1.1.6; 1.1.1.1.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.1.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 14-Oct-2019  hannken Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"
 1.3 28-May-2018  chs branches: 1.3.2; 1.3.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 10-Jan-2017  christos branches: 1.2.12;
fix a few warnings.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.28;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.4.1 15-Oct-2019  martin Pull up following revision(s) (requested by hannken in ticket #308):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.21
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c: revision 1.3
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h: revision 1.4

Change dmu_diff() back to use a "file" instead of a "vnode".

Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"

-

Add missing "#ifdef _KERNEL" to fix the build of userland zfs libraries.
 1.3.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dmu_send.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_bookmark.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 19-Feb-2016  joerg branches: 1.2.14;
dmu_objset_rename is an alias for dsl_dataset_rename, but differs in
constness of the first argument. Newer clang checks for this and
prohibits it, so just be consistent by constifying the latter.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_deadlist.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_destroy.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_scan.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dsl_userhold.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file multilist.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file range_tree.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file sa.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file sa_impl.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 10-Jan-2017  christos branches: 1.4.12;
fix a few warnings.
 1.3 28-Mar-2014  ozaki-r branches: 1.3.8;
Complete migrating to snprintf_blkptr
 1.2 28-Mar-2014  ozaki-r Fix migrating to snprintf_blkptr
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.6; 1.1.1.2.12;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.4.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 15-Nov-2018  riastradh Be consistent about _KERNEL vs _HARDKERNEL in zfs.

As it happens, on x86 both _HARDKERNEL and _KERNEL get defined; see
the conditional in sys/rump/Makefile.rump that _refrains_ from
defining _RUMPKERNEL on x86.

So the only version of this code that has been tested is the one with
all of it included. But on, e.g., aarch64, we do not get _HARDKERNEL
here, and the code fails to build because some things use the field
struct spa::spa_deadman_cycid under _KERNEL when it is declared only
under _HARDKERNEL.

If there's a reason _not_ to use this in rump -- and it's not obvious
to me why -- then all access to the field needs to agree to use
_HARDKERNEL.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file space_reftree.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file trim_map.h was added on branch pgoyette-compat on 2018-06-25 07:25:21 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 11-Jun-2019  hannken Try to retrieve the per-disk maximum transfer size and use it instead
of MAXPHYS. Eagerly waiting for the merge of tls-maxphys.

Addresses PR port-xen/54273: "zpool create pool xbd2" panics DOMU kernel
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 10-Aug-2009  haad branches: 1.2.44;
Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file vdev_raidz.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfeature.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-Dec-2021  riastradh zfs: Expose hostid to zfs, as in gethostid/sethostid(3).

If set to nonzero, the hostid is recorded in the metadata of a zpool,
and checked by `zpool import' when the pool has not been explicitly
exported. After reboot, zpool import will not need `-f' to reimport
the pool.

Setting the hostid must be done explicitly through sysctl (or the
sethostid(3) library call) on all ports except acorn32, amiga,
mvme68k, newsmips, sparc, sparc64, sun2, and sun3. So for most users
this change will have no immediate effect. But you can obviate the
need for `zpool import -f' by adding `kern.hostid=123456789' to
/etc/sysctl.conf and importing the pool one last time with `-f'.
 1.3 16-Feb-2021  hannken Use the right uid / gid for nobody:nobody like FreeBSD does.

Prevents null pointer dereferences when ZFS replaces this
illegal (according to IS_EPHEMERAL()) id with another
illegal id in operation zfs_fuid_create_cred() and
finally zfs_log_create() dereferences fuidp being NULL.

Adresses PR misc/55042 (Panic when creating a directory on a NFS served ZFS)
 1.2 22-Jun-2019  hannken branches: 1.2.2;
Sync with upstream r315983.

FreeBSD splits "zfs_context.h" into:
"lib/libzpool/common/sys/zfs_context.h" for user space
"uts/common/fs/zfs/sys/zfs_context.h" for kernel space

Do the same here, move and sync "sys/sys/zfs_context.h" to
"dist/lib/libzpool/common/sys/zfs_context.h" and
"dist/uts/common/fs/zfs/sys/zfs_context.h".

Change "Makefile.zfs" to search includes from "dist/lib"
before "dist/uts" so we get the right include file.

Adapt "usr.sbin/fstyp/Makefile" to get the right include file.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 22-Mar-2021  martin Pull up following revision(s) (requested by hannken in ticket #1235):

external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h: revision 1.3

Use the right uid / gid for nobody:nobody like FreeBSD does.

Prevents null pointer dereferences when ZFS replaces this
illegal (according to IS_EPHEMERAL()) id with another
illegal id in operation zfs_fuid_create_cred() and
finally zfs_log_create() dereferences fuidp being NULL.

Adresses PR misc/55042 (Panic when creating a directory on a NFS served ZFS)
 1.3 18-Mar-2019  hannken Make ZFS exportable by NFS, implement zfsctl_vptofh(),
zfs_netbsd_vptofh() and zfs_netbsd_fhtovp().

Undo changes to now completely unused zfs_fhtovp().
 1.2 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs_onexit.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.4 20-Feb-2026  yamt zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)

note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.

https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=60004
 1.3 28-May-2018  chs branches: 1.3.16;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 15-Oct-2012  riastradh branches: 1.2.28;
Do reference counting for zfs range lock waiters.

Avoid cv_broadcast(&cv); cv_destroy(&cv); which works in Solaris only
by abuse of the condvar abstraction.

There are parts of this code that should be factored into smaller
subroutines, mainly range lock allocation and initialization, but
that would make it harder to merge newer versions of zfs, so for now
I've just expanded those parts further in-line.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.6; 1.1.1.1.12;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.1.1.6.1 30-Oct-2012  yamt sync with head
 1.2.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.16.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs_sa.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zfs_stat.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.2 27-Mar-2026  yamt zfs: port a fix for data corruption issue from illumos

see https://www.illumos.org/issues/17734 for the details.

note: i didn't bother to patch illumos/freebsd code in our tree.

the original commit message:

> commit f6559a18843abdfa5849b9e74f239f9bd15796d3
> Author: Andy Fiddaman <illumos@fiddaman.net>
> Date: Mon Nov 10 22:52:05 2025 +0000
>
> 17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
> Portions contributed by: Alexander Motin <mav@FreeBSD.org>
> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
> Reviewed by: Toomas Soome <tsoome@me.com>
> Approved by: Dan McDonald <danmcd@edgecast.io>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.16;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.16.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11 27-Mar-2026  yamt zfs: port a fix for data corruption issue from illumos

see https://www.illumos.org/issues/17734 for the details.

note: i didn't bother to patch illumos/freebsd code in our tree.

the original commit message:

> commit f6559a18843abdfa5849b9e74f239f9bd15796d3
> Author: Andy Fiddaman <illumos@fiddaman.net>
> Date: Mon Nov 10 22:52:05 2025 +0000
>
> 17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
> Portions contributed by: Alexander Motin <mav@FreeBSD.org>
> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
> Reviewed by: Toomas Soome <tsoome@me.com>
> Approved by: Dan McDonald <danmcd@edgecast.io>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.10 22-Mar-2026  yamt zfs: fix "slow rm" issue

* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.

* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.

note that these two changes depend on each other:

* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.

* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.

an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.

PR/59885
https://gnats.netbsd.org/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html
 1.9 01-Jan-2019  hannken branches: 1.9.14;
Cannot hold zfs object across call to vcache_get() as it might
deadlock with another reclaim.

Add vfs operation zfs_newvnode() to create a new zfs node and
hold the zfs object in zfs_loadvnode() and zfs_newvnode() only.
 1.8 28-May-2018  chs branches: 1.8.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 09-Apr-2015  riastradh branches: 1.7.14;
Advisory locking for zfs.
 1.6 05-Dec-2014  hannken Change zfs to vcache.
- zfs_loadvnode() is based on zfs_zget() plus zfs_znode_alloc().
 1.5 15-Oct-2012  riastradh Do reference counting for zfs dirlock waiters.

Solaris relies on cv_broadcast(&cv); cv_destroy(&cv) working, but
that hoses our cv_wait, which needs to continue using cv after it is
woken. Solaris's idiom is an abuse of the condvar abstraction, but
we can get the same effect with reference counting.
 1.4 27-Feb-2010  haad branches: 1.4.6; 1.4.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.3 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.6.1 30-Oct-2012  yamt sync with head
 1.7.14.2 18-Jan-2019  pgoyette Synch with HEAD
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.2.1 10-Jun-2019  christos Sync with HEAD
 1.9.14.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zio_priority.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zrlock.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.5 22-May-2019  hannken Enable the zvol minor management to create and remove device nodes.
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 10-Aug-2009  haad Add some NetBSD fixes which I have forgot to commit during first round.
With these patches I can build solaris and zfs module again.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file callb.c was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 01-Dec-2019  jmcneill branches: 1.2.4;
Need sys/atomic.h on NetBSD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.2;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.2.1 08-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #515):

external/cddl/osnet/dist/uts/common/fs/zfs/arc.c: revision 1.15
share/mk/bsd.own.mk: revision 1.1167
external/cddl/osnet/dist/uts/common/os/fm.c: revision 1.2

Provide a default ptob() implementation
Need sys/atomic.h on NetBSD
Enable ZFS support on aarch64
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.4.1 01-Dec-2019  martin file fm.c was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.2 31-Oct-2022  simonb Provide an empty ASSERT macro ifdef _STANDALONE.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 26-Jun-2019  hannken branches: 1.1.1;
Initial revision
 1.1.1.1 26-Jun-2019  hannken branches: 1.1.1.1.6;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1.1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.1.1.6.1 26-Jun-2019  martin file asm_linkage.h was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs branches: 1.1.1.2.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.3 28-May-2018  chs branches: 1.3.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 13-Mar-2010  christos branches: 1.2.44;
make dtrace compile on amd64.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.14.1 02-Aug-2025  perseant Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 27-Mar-2014  christos branches: 1.2.24;
kill sprintf
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.6; 1.1.1.1.12;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.1.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4 04-May-2025  christos Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.3 28-May-2018  chs branches: 1.3.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.14.1 02-Aug-2025  perseant Sync with HEAD
 1.4 24-Sep-2015  christos sync with FreeBSD
 1.3 13-Mar-2010  christos make dtrace compile on amd64.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 23-Jan-2016  riastradh branches: 1.3.14;
Omit spurious include of <sys/isa_defs.h> in dtrace tools build.

Fixes dtrace tools cross-build from architectures with no dtrace
support:

# compile libctf/ctf_create.lo
[...]
/export/anoncvs/src/tools/libctf/../../external/cddl/osnet/sys/sys/isa_defs.h:50:2: error: #error "architecture not supported"
#error "architecture not supported"
^
 1.2 14-Dec-2010  tron Get DTrace to build again.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.19 10-Jan-2026  nia dtrace: sprinkle #include <sys/endian.h>
 1.18 15-Nov-2018  riastradh Omit conflicting definition that breaks build on aarch64.
 1.17 04-Jun-2018  christos branches: 1.17.2;
add <sys/proc.h> because the header needs proc_t kthread_t etc.
 1.16 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.15 27-Feb-2017  chs branches: 1.15.10;
apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
 1.14 02-Oct-2015  riz branches: 1.14.2; 1.14.4;
Restore some defines lost in last update, and don't include sys/cpuvar.h

MKDTRACE=yes now builds for arm platforms again.
 1.13 24-Sep-2015  christos include <sys/proc.h> explicitly for kthread_t
 1.12 24-Sep-2015  christos sync with FreeBSD
 1.11 07-Mar-2015  christos constify
 1.10 15-Mar-2014  ozaki-r Implement DTrace FBT provider for ARM

- Finding probable functions
- Replacing instructions
- Emulating instructions

It is tested only on ARMv7 CPUs yet, for example,
-m evbarm (-a earm) kernel=BEAGLEBONE.
 1.9 05-Mar-2014  ozaki-r Add defined(__arm__)
 1.8 17-Jul-2011  joerg branches: 1.8.2; 1.8.8;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.7 11-Mar-2010  darran DTrace: fix a few build issues for tools and the dtrace provider operation
interface.
 1.6 02-Mar-2010  darran DTrace: make sure we get a processorid_t definition (fix zfs module build).
 1.5 02-Mar-2010  darran DTrace: fix the dtps_provide_module definition.
 1.4 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.8.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.14.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.15.10.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.15.10.1 25-Jun-2018  pgoyette Sync with HEAD
 1.17.2.1 10-Jun-2019  christos Sync with HEAD
 1.7 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 24-Sep-2015  christos branches: 1.6.14;
sync with FreeBSD
 1.5 19-Oct-2011  yamt because our xcall stuff can't be used in softint, use kernel threads
for cleaner/deadman low-level cyclic replacement. PR/44905
 1.4 13-Mar-2010  christos make dtrace compile on amd64.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 23-Dec-2009  mbalmer branches: 1.2.44;
Fix typo in comments, no code change.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 07-Aug-2009  haad branches: 1.2.44;
Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file extdirent.h was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 20-Feb-2010  darran branches: 1.1.1.1.44;
Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_impl.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 07-Aug-2009  haad branches: 1.2.44;
Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file idmap.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file isa_defs.h was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 07-Aug-2009  haad branches: 1.2.44;
Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 15-Dec-2010  haad Revert last commit it's not needed anymore.
 1.2 14-Dec-2010  tron Get DTrace to build again.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 23-Oct-2018  christos prefix all nv* symbols with opensolaris_
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.2.44.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 01-Mar-2010  haad Removee compile time generated file from dist it is in osnet/sys/sys now.
 1.1 10-Aug-2009  haad Add missing header file.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 13-Mar-2010  christos branches: 1.5.44;
make dtrace compile on amd64.
 1.4 01-Mar-2010  darran DTrace: processorid_t is defined elsewhere (pset.h), so make it a sun only
definition here.
 1.3 27-Feb-2010  haad Merge NetBSD local changes to new zfs version 22 sources.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran branches: 1.1.1;
Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.5.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file procset.h was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 24-Jan-2016  christos branches: 1.2.14;
sys/conf.h is a kernel only header
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 27-Feb-2010  haad branches: 1.3.44;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 24-Jun-2019  hannken branches: 1.1.1; 1.1.6;
Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.6.1 24-Jun-2019  martin file sysmacros.h was added on branch phil-wifi on 2020-04-13 07:56:38 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 06-Jun-2019  hannken Handle files not present upstream:

dist/lib/libshare/common/libshare.h -> sys/libshare.h
dist/uts/common/sys/systeminfo.h -> sys/sys/systeminfo.h
dist/uts/common/sys/taskq_impl.h -> TRASH

No functional change intended.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 07-May-2019  hannken This implementation of Solaris taskq API is incomplete and doesn't track
Solaris upstream. FreeBSD already replaced it with a glue to their
taskqueue API.

Replace it with a glue component that queues Solaris taskq requests to
threadpool jobs.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 06-Jun-2019  hannken Handle files not present upstream:

dist/lib/libshare/common/libshare.h -> sys/libshare.h
dist/uts/common/sys/systeminfo.h -> sys/sys/systeminfo.h
dist/uts/common/sys/taskq_impl.h -> TRASH

No functional change intended.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs branches: 1.1.1.3.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 28-May-2018  chs branches: 1.1.1; 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file vnode.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1.1.1 26-Jun-2019  hannken import new CDDL dtrace and ZFS code from FreeBSD svn r315983

Add files missing from the initial import.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 07-Aug-2009  haad branches: 1.2.44;
Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 07-May-2019  hannken Cleanup modules "solaris" and "zfs":

- Defer spa_config_load() until root is mounted.
- Restore the config path to "/etc/zfs/zpool.cache".
- Module "zfs" is type MODULE_CLASS_VFS and no longer depends on "rootvnode".
- Module "solaris" no longer depends on "mp_online".
- Fix rump component registration to not detach "/dev/zfs" if
it didn't attach it.
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 03-Jan-2013  dsl branches: 1.4.28;
Compilation fixes:
- include sys/ioctl.h
- NULL isn't an int constant
- %llf isn't a printf format
 1.3 27-Feb-2010  haad branches: 1.3.6; 1.3.12;
Merge NetBSD local changes to new zfs version 22 sources.
 1.2 07-Aug-2009  haad Add NetBSD specific changes to OpenSolaris code. These changes were made
by Andrew Doran and me. Thank you Andrew for your great help.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.4.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file zut.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file dev.h was added on branch pgoyette-compat on 2018-06-25 07:25:22 +0000
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.3 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.2 27-Feb-2010  haad branches: 1.1.1.2.44;
Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 18-Jun-2016  christos branches: 1.2.14;
fix dup definitions in module.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2 18-Jun-2016  christos fix dup definitions in module.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 18-Jun-2016  christos branches: 1.2.14;
fix dup definitions in module.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.2 28-May-2018  chs import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1 07-Aug-2009  haad branches: 1.1.1.1.44;
Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.1.1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 18-Jun-2016  christos branches: 1.2.14;
fix dup definitions in module.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 18-Jun-2016  christos branches: 1.2.14;
fix dup definitions in module.
 1.1 07-Aug-2009  haad branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2009  haad Import Opensolaris source code used with zfs port. Zfs code si from date
200811.
 1.2.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:23 +0000
 1.1 20-Feb-2010  darran branches: 1.1.1;
Initial revision
 1.1.1.1 20-Feb-2010  darran Import the rest of Opensolaris 20081117 needed for DTrace. No conflicts
with ZFS.
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:23 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.h was added on branch pgoyette-compat on 2018-06-25 07:25:23 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:23 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.h was added on branch pgoyette-compat on 2018-06-25 07:25:23 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.c was added on branch pgoyette-compat on 2018-06-25 07:25:24 +0000
 1.1 28-May-2018  chs branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-2018  chs branches: 1.1.1.1.2;
import new CDDL dtrace and ZFS code from FreeBSD svn r315983.
 1.1.1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.1.1.2.1 28-May-2018  pgoyette file fasttrap_isa.h was added on branch pgoyette-compat on 2018-06-25 07:25:24 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add another set of headers files.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 21-Feb-2010  darran DTrace: remove assert.h - shouldn't have been checked in (breaks libdtrace
build).
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4 10-Jan-2017  christos fix a few warnings.
 1.3 21-Feb-2010  darran branches: 1.3.28;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add another set of headers files.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add another set of headers files.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.4 19-Jun-2019  hannken Sync with upstream r315983.
 1.3 21-Feb-2010  darran branches: 1.3.46;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 24-Sep-2015  christos branches: 1.3.14;
We have libproc now
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 21-Feb-2010  darran DTrace: remove extra libshare.h - shouldn't have added it and it breaks
the libzfs build.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1 28-Feb-2010  haad Add another set of headers files.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 01-Mar-2010  haad Commit last to fixes which make zfs version 22 compiling again.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.2 19-Jun-2019  hannken Sync with upstream r315983.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.5 19-Jun-2019  hannken Sync with upstream r315983.
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 10-May-2010  haad branches: 1.3.44;
If thread_create was called with thread_id = NULL use our local thread id
as replacement otherwise we will crash.
 1.2 03-May-2010  haad Add _mutex_held routine to test if mutex_t * is held.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file thread_pool.h was added on branch pgoyette-compat on 2018-06-25 07:25:24 +0000
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 04-Nov-2012  christos branches: 1.5.28;
we have _SC_PHYS_PAGES now
 1.4 28-Feb-2010  haad branches: 1.4.6; 1.4.8; 1.4.12;
Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.8.1 10-Dec-2012  riz Pull up following revision(s) (requested by riastradh in ticket #733):
external/cddl/osnet/include/unistd.h: revision 1.5
we have _SC_PHYS_PAGES now
 1.4.6.1 16-Jan-2013  yamt sync with (a bit old) head
 1.5.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.11 07-Apr-2021  simonb Revert the change to not build and install /usr/lib/dtrace/drti.o; this
is used by the ruby30-base package when compiled with the dtrace option
(enabled by default).

Problem found by ryoon@.
 1.10 29-Mar-2021  simonb Don't build or install /usr/lib/dtrace/drti.o - currently not used, may
be one day...
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 29-Feb-2016  riastradh branches: 1.8.14;
Let MKCTF alone control whether we build libctf.

If MKDTRACE=yes MKCTF=no makes no sense, we can express that
somewhere else, not as a confusing set lists error at the end -- as
far as I know, there's no way to express MKDTRACE *or* MKCTF as a
condition for set list entries.
 1.7 28-Feb-2016  christos hook drti
 1.6 25-Mar-2014  ozaki-r Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.
 1.5 11-Sep-2013  joerg If a library needs a symbol from another library, pull that library in
explicitly, even if the DT_NEEDED closure would normally already ensure
the presence.
 1.4 24-Feb-2010  tron branches: 1.4.6; 1.4.12;
Include "bsd.own.mk" before checking "MKDTRACE" to allow setting it
in "/etc/mk.conf".
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 04-Aug-2016  christos include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.4 23-Jan-2016  christos branches: 1.4.2;
Define _KERNTYPES for things that need it.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.6 04-Aug-2016  christos include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.5 11-Mar-2016  joerg branches: 1.5.2;
Drop FreeBSD RCS ID, add NetBSD's.
 1.4 01-Mar-2016  christos remove comment I used to test.
 1.3 01-Mar-2016  christos Build as PIC if requested
 1.2 28-Feb-2016  christos hook drti
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.5.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.6 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.5 04-Aug-2016  christos branches: 1.5.14; 1.5.16;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.4 13-Jan-2011  haad branches: 1.4.28;
Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is
enabled. Fix header assert conflicts + bump WARNS for some libs.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.28.1 06-Aug-2016  pgoyette Sync with HEAD
 1.5.16.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.5.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 22-Nov-2024  riastradh branches: 1.1.4;
external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 22-Nov-2024  perseant file avl.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:33 +0000
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.10 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.9 04-Aug-2016  christos branches: 1.9.12;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.8 24-Sep-2015  christos branches: 1.8.2;
Add build stuff.
 1.7 17-Sep-2015  christos don't depend on the installed version of libz
 1.6 16-Sep-2015  christos no need for LIBDPLIBS here
 1.5 15-Sep-2015  christos libctf depends on libz
 1.4 10-Sep-2013  christos -D and -I are CPPFLAGS
 1.3 03-Apr-2010  christos branches: 1.3.6; 1.3.12;
use relative .PATH, and remove one that is not needed.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.9.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 04-May-2025  christos branches: 1.2.4;
Apply diffs from FreeBSD to support CTF version 3 which eliminates the 64K
limits on various arrays holding items (eg. types)
 1.1 22-Nov-2024  riastradh external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.2.4.2 02-Aug-2025  perseant Sync with HEAD
 1.2.4.1 04-May-2025  perseant file ctf.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:33 +0000
 1.2 24-Sep-2015  christos Add build stuff.
 1.1 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.34 18-Sep-2025  mrg introduce a couple of new turn-off-gcc-warning variables and use them.

GCC 14 has a new annoying calloc() checker that we turn off in a bunch
of places, and there are a few more dangling-pointer issuse that come up,
but seem bogus.
 1.33 23-Nov-2024  riastradh libdtrace: Handle some x86-specific symbols in the .expsym file.

PR lib/58838: shared libraries in base should all have expsym lists
 1.32 03-Jun-2023  lukem branches: 1.32.2;
adapt to ${CC_WNO_MAYBE_UNINITIALIZED}

Use ${CC_WNO_MAYBE_UNINITIALIZED} instead of
the older style more complex expressions.

Remove workarounds if they were for a specific
version of gcc < 10.
 1.31 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.30 13-Apr-2021  mrg XXX: ignore warning about overlapping buffers for sprintf().
 1.29 29-Mar-2021  simonb Compile MIPS specific code.
 1.28 17-Mar-2020  fox external/cddl/osnet: Do not suppress the warning output for libdtrace.

Changed -Wno-maybe-uninitialized to -Wno-error=maybe-uninitialized to allow
warnings to be printed out during build.

Suggested by: christos@
 1.27 17-Mar-2020  fox external/cddl/osnet: Supress -Werror=maybe-uninitialized error in libdtrace.

It looks like this is a false positive, since the section of code triggering the error

external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c:400:42:

is only accessed after "err" is initialized.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
 1.26 03-Dec-2019  jmcneill dtrace: add support for aarch64
 1.25 13-Oct-2019  kre This previously had -Wno-format-truncation so I am presuming it should
have been converted to GCC_NO_FORMAT_TRUNCATION rather than
GCC_NO_STRINGOP_TRUNCATION which is what happened. This might unbreak
the build (olr at least get it further).
 1.24 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.23 10-Oct-2019  kre Only exclude gcc-8 warnings when the gcc we're using is gcc>=8
 1.22 09-Oct-2019  christos no error for string truncation
 1.21 11-Feb-2019  tnn branches: 1.21.2;
-Wno-format-truncation is only needed when using GCC
 1.20 06-Feb-2019  christos uses the idiom len = snprintf(&tmp, 1, ...) to compute length.
needs -Wno-format-truncation
 1.19 07-Jun-2018  kamil branches: 1.19.2;
Replace HAVE_GCC with ACTIVE_CC == gcc checks

Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
 1.18 06-Jun-2018  kamil Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes

Clang/LLVM does not recognize:
- -Wno-maybe-uninitialized
- -Wno-unused-but-set-variable

MKGCC=yes still builds the distribution.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.17 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.16 19-Dec-2016  christos branches: 1.16.12;
arrange for .in files to be rebuilt.
 1.15 04-Aug-2016  christos include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.14 05-Oct-2015  christos branches: 1.14.2;
Arrange to install the dtrace files (some are broken, sets will need to be
fixed)
 1.13 30-Sep-2015  christos do the stack protector stuff like the other files.
 1.12 29-Sep-2015  christos - make the generated file rules depend on the source files
- hack for clang on Darwin
 1.11 24-Sep-2015  christos Add build stuff.
 1.10 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.9 16-Mar-2014  ozaki-r Use MACHINE_CPU instead of MACHINE_ARCH with pattern matching

Include bsd.own.mk to use MACHINE_CPU.

Advised by matt@
 1.8 16-Mar-2014  ozaki-r Look up arm directory on MACHINE_ARCH=*arm*
 1.7 21-Jun-2013  christos Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.6 13-Feb-2012  wiz branches: 1.6.6;
Use the correct MACHINE_ARCH for amd64.
Remove temporary hack while here.
From Henning Petersen in PR 46001.
 1.5 03-Apr-2010  christos branches: 1.5.6;
- use CPPFLAGS instead of CFLAGS
- use relative .PATH
 1.4 24-Feb-2010  tron Disable stack protection warnings for more sources which use dynamically
sized stack buffers.
 1.3 24-Feb-2010  tron Disable stack protection warnings for sources which use dynamically
sized stack buffers.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.5.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.6.1 17-Apr-2012  yamt sync with head
 1.6.6.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.6.1 23-Jun-2013  tls resync from head
 1.14.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.14.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.16.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.19.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.19.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.19.2.1 10-Jun-2019  christos Sync with HEAD
 1.21.2.1 09-Dec-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #525):

external/cddl/osnet/dev/dtrace/aarch64/dtrace_isa.c: revision 1.1
distrib/sets/lists/modules/md.i386: revision 1.83
share/mk/bsd.own.mk: revision 1.1168
usr.bin/mkubootimage/mkubootimage.c: revision 1.25
sys/modules/dtrace/Makefile: revision 1.7
usr.bin/mkubootimage/mkubootimage.c: revision 1.26
sys/modules/dtrace/Makefile: revision 1.8
external/cddl/osnet/dist/lib/libdtrace/aarch64/dt_isadep.c: revision 1.2
distrib/sets/lists/modules/mi: revision 1.128
sys/arch/aarch64/include/frame.h: revision 1.3
sys/arch/evbarm/conf/mk.generic64: revision 1.4
external/cddl/osnet/dist/lib/libdtrace/common/dt_link.c: revision 1.12
sys/modules/cyclic/Makefile: revision 1.4
sys/arch/aarch64/conf/Makefile.aarch64: revision 1.16
external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c: revision 1.1
sys/arch/aarch64/aarch64/start.S: revision 1.3
sys/arch/aarch64/aarch64/trap.c: revision 1.22
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/dtrace_asm.S: revision 1.1
external/cddl/osnet/dev/fbt/aarch64/fbt_isa.h: revision 1.1
external/cddl/osnet/dev/dtrace/aarch64/regset.h: revision 1.1
external/cddl/osnet/lib/libdtrace/Makefile: revision 1.26
distrib/sets/lists/modules/md.amd64: revision 1.82
usr.bin/mkubootimage/mkubootimage.1: revision 1.13
distrib/sets/lists/modules/ad.arm: revision 1.14

Add KDTRACE_HOOKS support.

Define lwp_trapframe() macro

dtrace: add support for aarch64

Add syscall_linux back for other arm architectures (accidently removed
in previous)

Add -u flag for updating headers in place.

Fix alignment of .text section by changing load address to
0xffffffc000000000 and adding 64 bytes of padding before the entry point.

Update arm64 image header in place

Move dtrace_syscall_linux out of mi set list

Enable DTrace on aarch64

Fix signed/unsigned comparison
 1.32.2.1 02-Aug-2025  perseant Sync with HEAD
 1.1 23-Nov-2024  riastradh branches: 1.1.4;
libdtrace: Handle some x86-specific symbols in the .expsym file.

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 23-Nov-2024  perseant file dtrace.common.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:33 +0000
 1.2 23-Nov-2024  riastradh libdtrace: Handle some x86-specific symbols in the .expsym file.

PR lib/58838: shared libraries in base should all have expsym lists
 1.1 22-Nov-2024  riastradh external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1 23-Nov-2024  riastradh branches: 1.1.4;
libdtrace: Handle some x86-specific symbols in the .expsym file.

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 23-Nov-2024  perseant file dtrace.x86.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:33 +0000
 1.4 08-Mar-2020  mgorny Update dtrace errno.d mapping and add a script for it

Add a new script to autogenerate errno.d from errno.h, and use it
to regenerate the list to match NetBSD errno codes.
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 24-Sep-2015  christos branches: 1.1.14;
Add build stuff.
 1.1.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 08-Mar-2020  mgorny branches: 1.1.2;
Update dtrace errno.d mapping and add a script for it

Add a new script to autogenerate errno.d from errno.h, and use it
to regenerate the list to match NetBSD errno codes.
 1.1.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.2.1 08-Mar-2020  martin file make-errno-d.awk was added on branch phil-wifi on 2020-04-08 14:04:20 +0000
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 07-Oct-2015  christos branches: 1.5.14;
fix the remaining problem with pcinfo; the dtracetoolkit execsnoop script
works.
 1.4 06-Oct-2015  christos almost fixed... Need to figure out what to do with curlwp.
 1.3 05-Oct-2015  christos Start matching some of the field names to NetBSD's
XXX: needs work
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Sep-2015  christos Add build stuff.
 1.1 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.10 04-Jun-2019  hannken branches: 1.10.2;
Use native XDR for libnvpair in userland.
 1.9 28-May-2018  chs branches: 1.9.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 04-Aug-2016  christos branches: 1.8.12;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.7 10-Apr-2015  riastradh branches: 1.7.2;
Use the upstream xdr, with a rename dance to avoid clash with libc.

The upstream xdr provides some functionality expected by the upstream
libnvpair which our libc's xdr does not provide.

When modifying, double-check that libnvpair.so defines no xdr_*
symbols, only _solaris_xdr_*. (XXX Put this note somewhere...)
 1.6 13-Jan-2011  haad Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is
enabled. Fix header assert conflicts + bump WARNS for some libs.
 1.5 22-Feb-2010  haad Revert lib_nvpair hack now when it is not needed when njoly@ commited his fix to
bsd.lib.mk.
 1.4 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.3 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2 17-Feb-2010  christos Fix build issue with our make system building libnvpair.so from libnvpair.c
and libnvpair.so from *.so by renaming libnvpair.c to lib_nvpair.c
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.7.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.8.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.9.2.1 10-Jun-2019  christos Sync with HEAD
 1.10.2.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.1 22-Nov-2024  riastradh branches: 1.1.4;
external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 22-Nov-2024  perseant file nvpair.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:33 +0000
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.7 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.6 04-Aug-2016  christos branches: 1.6.14; 1.6.16;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.5 10-May-2010  haad branches: 1.5.28;
Disable building of stub_stand.c we build all locking primitives in libzpool.
 1.4 28-Feb-2010  haad Addmissing symbols to libumem.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.28.1 06-Aug-2016  pgoyette Sync with HEAD
 1.6.16.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.6.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add forgotten misc.h header file, which I forgot to commit.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 14-Dec-2010  haad branches: 1.2.44;
Define mutex_owned.
 1.1 28-Feb-2010  haad Addmissing symbols to libumem.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 26-May-2019  hannken Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
 1.2 02-May-2010  haad branches: 1.2.46;
In NetBSD pool cache constructor/destructor routines has inverted arguments.

C
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.46.1 10-Jun-2019  christos Sync with HEAD
 1.1 22-Nov-2024  riastradh branches: 1.1.4;
external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 22-Nov-2024  perseant file umem.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:33 +0000
 1.6 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.5 04-Aug-2016  christos branches: 1.5.14; 1.5.16;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.4 13-Jan-2011  haad branches: 1.4.28;
Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is
enabled. Fix header assert conflicts + bump WARNS for some libs.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.28.1 06-Aug-2016  pgoyette Sync with HEAD
 1.5.16.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.5.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1 22-Nov-2024  riastradh branches: 1.1.4;
external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 22-Nov-2024  perseant file uutil.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:34 +0000
 1.10 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.9 28-May-2018  chs branches: 1.9.2; 1.9.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 04-Aug-2016  christos branches: 1.8.12;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.7 11-Sep-2013  joerg branches: 1.7.8;
If a library needs a symbol from another library, pull that library in
explicitly, even if the DT_NEEDED closure would normally already ensure
the presence.
 1.6 13-Jan-2011  haad branches: 1.6.6; 1.6.12;
Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is
enabled. Fix header assert conflicts + bump WARNS for some libs.
 1.5 28-Feb-2010  haad Add missing zfs_fletcher.c to libzfs.
 1.4 28-Feb-2010  haad Add newly added stubs.c file to libzfs build.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.6.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.8.1 06-Aug-2016  pgoyette Sync with HEAD
 1.8.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.4.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.9.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 10-Jan-2017  christos branches: 1.3.12;
fix a few warnings.
 1.2 05-Jul-2012  christos branches: 1.2.14;
PR/46660: Henning Petersen: Fix typo in deviceid.c
 1.1 07-Aug-2009  haad branches: 1.1.6;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.6.1 30-Oct-2012  yamt sync with head
 1.2.14.1 20-Mar-2017  pgoyette Sync with HEAD
 1.3.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 10-Aug-2009  haad branches: 1.2.44;
Rename getline to zgetline to avoid clashes with NetBSD getline.

Problem found by zafer@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 28-Feb-2010  haad branches: 1.2.44;
Add fixes for missing symbols from libzfs and libzpool.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add fixes for missing symbols from libzfs and libzpool.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file thread_pool.c was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file thread_pool_impl.h was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 22-Nov-2024  riastradh branches: 1.1.4;
external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 22-Nov-2024  perseant file zfs.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:34 +0000
 1.2 12-Jan-2019  hannken Pass unmount flags down to syscall, "zfs unmount -f" now works.
 1.1 07-Aug-2009  haad branches: 1.1.44; 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 10-Jun-2019  christos Sync with HEAD
 1.1.44.1 18-Jan-2019  pgoyette Synch with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.1 28-May-2018  chs branches: 1.1.2; 1.1.4; 1.1.6;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.6.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.1.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file Makefile was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.1 28-May-2018  chs branches: 1.1.2;
add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file shlib_version was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.1 22-Nov-2024  riastradh branches: 1.1.4;
external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 22-Nov-2024  perseant file zfs_core.expsym was added on branch perseant-exfatfs on 2025-08-02 05:24:34 +0000
 1.13 22-Sep-2019  brad Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
 1.12 28-May-2018  chs branches: 1.12.2; 1.12.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.11 04-Aug-2016  christos branches: 1.11.12;
include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
 1.10 10-Apr-2015  riastradh branches: 1.10.2;
One usually puts .c, not .o, files in SRCS.
 1.9 22-Apr-2014  christos Add fake atomic 64 ops for those who don't have them.
XXX: used to be arm, now it is also i386.
 1.8 11-Sep-2013  joerg branches: 1.8.2;
If a library needs a symbol from another library, pull that library in
explicitly, even if the DT_NEEDED closure would normally already ensure
the presence.
 1.7 21-Jun-2013  christos Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.6 14-Dec-2010  haad branches: 1.6.6; 1.6.12; 1.6.18;
Do not built 64b atomic ops to libzpool they are in libc again.
 1.5 14-Dec-2010  haad Use only cas versions of 64 bit atomic ops.
 1.4 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.3 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2 06-Oct-2009  haad Enable build of 64 bit atomic ops in userspace for i386. This is needed for
all 32 bit archs which doesn't have a 64 atomic ops. This change enable MKZFS
build for a i386.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.6.18.2 31-Mar-2013  agc add symbol versioning information for libpthread
 1.6.18.1 26-Mar-2013  agc First pass at adding symbol versioning for libz.

Also fix up the ZFS infrastructure where it tried to link with the
wrong libz.so instance -- these problems showed up in testing with the
versioned libz.so.
 1.6.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.12.1 23-Jun-2013  tls resync from head
 1.6.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.2.1 10-Aug-2014  tls Rebase.
 1.10.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.11.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.12.4.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #252):

external/cddl/osnet/lib/libzpool/Makefile: revision 1.13
lib/libpthread/Makefile: revision 1.95
external/cddl/osnet/lib/libuutil/Makefile: revision 1.6
distrib/sets/lists/base/shl.mi: revision 1.871
external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2
external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11
external/cddl/osnet/lib/libzfs/Makefile: revision 1.10
external/cddl/osnet/lib/libavl/Makefile: revision 1.6
distrib/sets/lists/debug/shl.mi: revision 1.230
external/cddl/osnet/lib/libumem/Makefile: revision 1.7

Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.

Fix MKDEBUG distrib sets
Add libpthread, libnvpair and ZFS libs to dynamicroot.
 1.12.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 22-Apr-2014  christos branches: 1.3.2;
make compilable from the kernel
 1.2 22-Apr-2014  christos Add fake atomic 64 ops for those who don't have them.
XXX: used to be arm, now it is also i386.
 1.1 21-Jun-2013  christos branches: 1.1.2; 1.1.6;
Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
 1.1.6.1 10-Aug-2014  tls Rebase.
 1.1.2.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 21-Jun-2013  tls file atomic.c was added on branch tls-maxphys on 2013-06-23 06:28:31 +0000
 1.3.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.2.1 22-Apr-2014  yamt file atomic.c was added on branch yamt-pagecache on 2014-05-22 14:01:24 +0000
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 21-Jun-2013  christos branches: 1.8.26;
rename delay to xdelay to avoid conflicts.
 1.7 02-Jan-2013  dsl I've NFI why this code has userspace stuff playing with 'struct proc *'
nor why it uses &p0 as a magic constant (rather than NULL).
Re-instate the definition of p0, but enable the 'fake' definition
of 'struct proc' if the relevant part of sys/proc.h seems to have
been #if'ed away.
Should fix the build.
 1.6 01-Jan-2013  dsl Comment out the unused 'struct proc p0;'
This is userspace, it isn't supposed to know what a 'struct proc' is.
 1.5 28-Dec-2010  haad branches: 1.5.6; 1.5.12;
Fix problem where vnode vp_size was not updated when vndoe was already allocated,
for vdev. This makes ztest survive ztest_vdev_LUN_growth test. Replace dummy
VOP_GETATTR with vn_getattr routine which reset vp_size and vattr_size accordingly
to reality.
 1.4 02-May-2010  haad Initialize system_taskq during taskq init. This fixes ztest crash in taskq_dispatch.
 1.3 01-Mar-2010  haad Commit last to fixes which make zfs version 22 compiling again.
 1.2 28-Feb-2010  haad Add fixes for missing symbols from libzfs and libzpool.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.12.1 23-Jun-2013  tls resync from head
 1.5.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.26.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 11-May-2010  haad branches: 1.2.44;
Fix userspace cv_timedwait implementation to work on NetBSD.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 22-Nov-2024  riastradh libzpool: Nix expsym for now.

On some architectures this spuriously exports atomic_*_64 symbols,
and that should really be fixed first so we don't have to go to the
trouble of machine-dependent expected symbol lists.

PR lib/58847: libzpool exports atomic_*_64* on some architectures

PR PR lib/58838: shared libraries in base should all have expsym lists
 1.1 22-Nov-2024  riastradh external/cddl/osnet: Add expected symbols lists.

NOTE: libnvpair looks pretty wonky: `aok', `dump_nvlist',
`system_ops_def', buncha nv_* and nvlist_* names and then
opensolaris_nvpair_*. libuutil overlaps with libavl. And why do we
publish these libraries in /usr/lib anyway?

PR lib/58838: shared libraries in base should all have expsym lists
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 23-Jan-2016  christos Define _KERNTYPES for things that need it.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.6 31-Mar-2021  simonb Use compat/exec.mk - zfs isn't compat32 friendly (yet?).
 1.5 15-Sep-2019  brad Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
 1.4 28-May-2018  chs branches: 1.4.2; 1.4.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 28-Feb-2010  haad branches: 1.3.44;
Add NetBSD build glue to build new zfs version 22 sources.
 1.2 21-Oct-2009  joerg zfs(8) uses tbl.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.4.1 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #250):

external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.2
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.3
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.4
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.5
distrib/sets/lists/man/mi: revision 1.1652
distrib/sets/lists/man/mi: revision 1.1653
distrib/sets/lists/etc/mi: revision 1.259
etc/rc.d/mountall: revision 1.11
external/cddl/osnet/sbin/zfs/Makefile: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.7
etc/rc.d/Makefile: revision 1.105
distrib/sets/lists/base/mi: revision 1.1217
etc/rc.d/Makefile: revision 1.106
etc/rc.d/zfs: revision 1.1
etc/defaults/rc.conf: revision 1.152
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.1

Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
mount_zfs.8: add xref to fstab(5)

Use more markup.

Include mount_zfs man pages only for MKZFS builds.

Moved zfs out of MKX11 block.

Fix build failure without X11.

Add a copyright to the man page and a bit of history.
Use Pa macro for path
new sentence, new line
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 20-Sep-2019  sevan branches: 1.5.2; 1.5.6;
Use Pa macro for path
new sentence, new line
 1.4 20-Sep-2019  brad Add a copyright to the man page and a bit of history.
 1.3 16-Sep-2019  wiz Use more markup.
 1.2 15-Sep-2019  gutteridge mount_zfs.8: add xref to fstab(5)
 1.1 15-Sep-2019  brad Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
 1.5.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.6.1 20-Sep-2019  martin file mount_zfs.8 was added on branch phil-wifi on 2020-04-13 07:56:40 +0000
 1.5.2.2 27-Sep-2019  martin Pull up following revision(s) (requested by brad in ticket #250):

external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.2
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.3
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.4
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.5
distrib/sets/lists/man/mi: revision 1.1652
distrib/sets/lists/man/mi: revision 1.1653
distrib/sets/lists/etc/mi: revision 1.259
etc/rc.d/mountall: revision 1.11
external/cddl/osnet/sbin/zfs/Makefile: revision 1.5
external/cddl/osnet/dist/cmd/zfs/zfs_main.c: revision 1.7
etc/rc.d/Makefile: revision 1.105
distrib/sets/lists/base/mi: revision 1.1217
etc/rc.d/Makefile: revision 1.106
etc/rc.d/zfs: revision 1.1
etc/defaults/rc.conf: revision 1.152
external/cddl/osnet/sbin/zfs/mount_zfs.8: revision 1.1

Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs. With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does. This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things). Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall. Fix a problem in
mountall if ZFS is not compiled into the system.
mount_zfs.8: add xref to fstab(5)

Use more markup.

Include mount_zfs man pages only for MKZFS builds.

Moved zfs out of MKX11 block.

Fix build failure without X11.

Add a copyright to the man page and a bit of history.
Use Pa macro for path
new sentence, new line
 1.5.2.1 20-Sep-2019  martin file mount_zfs.8 was added on branch netbsd-9 on 2019-09-27 09:18:37 +0000
 1.3 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7 31-Mar-2021  simonb Use compat/exec.mk - zfs isn't compat32 friendly (yet?).
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 10-Apr-2015  riastradh branches: 1.5.14;
Use CPPFLAGS, not CFLAGS, so this actually takes effect.
 1.4 14-Dec-2010  haad branches: 1.4.18;
Define print_timestamp during build, to shut up gcc warning.
 1.3 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.2 21-Oct-2009  joerg zpool(8) uses tbl.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.18.2 31-Mar-2013  agc add symbol versioning information for libpthread
 1.4.18.1 26-Mar-2013  agc First pass at adding symbol versioning for libz.

Also fix up the ZFS infrastructure where it tried to link with the
wrong libz.so instance -- these problems showed up in testing with the
versioned libz.so.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1 28-May-2018  chs branches: 1.1.2; 1.1.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file zpool-features.7 was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.3 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 07-Jan-2017  christos PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.2 27-Dec-2015  christos branches: 1.2.2;
don't re-define __assert.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2 01-Apr-2024  riastradh elftoolchain: Be consistent about which ELF header files we use.

1. For tools that use elftoolchain: always use elftoolchain's
elfdefinitions.h. Don't even think about looking at the host's
sys/exec_elf.h, which makes no sense and should never happen.

(ELF tools that don't use elftoolchain, like m68k-elf2coff,
continue to use nbincludes/sys/exec_elf.h. But no more nbincludes
hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
sys/exec_elf.h, even in Solaris components via sys/elf.h.
elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
elfdefinitions.h via libelf header files (libelf.h, gelf.h).

libdtrace in particular requires _all_ R_* reloc type definitions,
but sys/exec_elf.h brings in only the _current machine's_ R_*
reloc type definitions. (While here: Use uintptr_t instead of
Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
provided only by sys/exec_elf.h, not by elfdefinitions.h.)

And most userland components using libelf don't rely on any
properties of the current machine from sys/exec_elf.h, so they can
use libelf's elfdefinition.h.

Exceptions:

- dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
but it also relies on sys/dtrace.h -> sys/elf.h ->
elfdefinitions.h like other userland components using sys/elf.h.

- kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
sys/elf.h -> elfdefinitions like other userland components using
sys/elf.h.

- t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
core files, but relies on sys/exec_elf.h for struct
netbsd_elfcore_procinfo.

None of these exceptions needs all R_* reloc type definitions, so
as a workaround, we can just suppress libelf's elfdefinitions.h by
defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake. This was:

- half bogus workarounds for missing build_install dependencies in
tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
tools involving libelf instead of libelf's elfdefinitions.h, which
collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.
 1.1 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 06-Jun-2019  hannken branches: 1.1.2;
Handle files not present upstream:

dist/lib/libshare/common/libshare.h -> sys/libshare.h
dist/uts/common/sys/systeminfo.h -> sys/sys/systeminfo.h
dist/uts/common/sys/taskq_impl.h -> TRASH

No functional change intended.
 1.1.2.2 10-Jun-2019  christos Sync with HEAD
 1.1.2.1 06-Jun-2019  christos file libshare.h was added on branch phil-wifi on 2019-06-10 21:52:03 +0000
 1.3 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.2 07-Jun-2019  hannken Sync with upstream r315983.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.46.1 10-Jun-2019  christos Sync with HEAD
 1.9 18-Mar-2022  riastradh osnet: Delete dead #if 0 code using hardclock_ticks.
 1.8 18-Jun-2019  kamil Drop unused retval pointer from do_sys_mknod{,at}()

No functional change intended.
 1.7 22-May-2019  hannken Update ddi environment:
- Put device major numbers into "dev_info_t".
- Fix an off-by-one in zvol_create_minor().
- When creating a node handle existing nodes
and add owner read/write permission.
- When removing nodes remove now empty directories.
 1.6 28-May-2018  chs branches: 1.6.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 10-Sep-2015  riz branches: 1.5.14;
include <sys/lwp.h> for curlwp. From ozaki-r.
 1.4 14-Dec-2010  haad Include sys/debug.h to get ASSERT defined.
 1.3 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.2 10-Aug-2009  haad Fix number of arguments passed to do_sys_mkdir.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6.2.1 10-Jun-2019  christos Sync with HEAD
 1.4 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.3 07-Jun-2019  hannken Sync with upstream r315983.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.2.1 10-Jun-2019  christos Sync with HEAD
 1.4 09-Sep-2023  riastradh solaris: Use pool_cache_reclaim, not pool_cache_invalidate.

pool_cache_invalidate invalidates cached objects, but doesn't return
any backing pages to the underlying page allocator.

pool_cache_reclaim does pool_cache_invalidate _and_ reutrns backing
pages to the underlying page alloator, so it is actually useful for
the page daemon to do when trying to free memory.

PR kern/57558

XXX pullup-10
XXX pullup-9
XXX pullup-8 (by patch to kmem.h instead of kmem.c)
 1.3 11-Nov-2020  chs branches: 1.3.6;
kmem_cache_create()'s "name" parameter can be on the stack,
so make a copy of it rather than keeping a pointer to it.
 1.2 23-May-2019  hannken branches: 1.2.2;
Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.1 28-May-2018  chs branches: 1.1.2; 1.1.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.4.1 10-Jun-2019  christos Sync with HEAD
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file kmem.c was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.2.2.2 02-Oct-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1735):

external/cddl/osnet/sys/kern/kmem.c: revision 1.4

solaris: Use pool_cache_reclaim, not pool_cache_invalidate.

pool_cache_invalidate invalidates cached objects, but doesn't return
any backing pages to the underlying page allocator.
pool_cache_reclaim does pool_cache_invalidate _and_ reutrns backing
pages to the underlying page alloator, so it is actually useful for
the page daemon to do when trying to free memory.

PR kern/57558
 1.2.2.1 03-Aug-2022  martin Pull up following revision(s) (requested by riastradh in ticket #1494):

external/cddl/osnet/sys/kern/kmem.c: revision 1.3

kmem_cache_create()'s "name" parameter can be on the stack,
so make a copy of it rather than keeping a pointer to it.
 1.3.6.1 02-Oct-2023  martin Pull up following revision(s) (requested by riastradh in ticket #383):

external/cddl/osnet/sys/kern/kmem.c: revision 1.4

solaris: Use pool_cache_reclaim, not pool_cache_invalidate.

pool_cache_invalidate invalidates cached objects, but doesn't return
any backing pages to the underlying page allocator.
pool_cache_reclaim does pool_cache_invalidate _and_ reutrns backing
pages to the underlying page alloator, so it is actually useful for
the page daemon to do when trying to free memory.

PR kern/57558
 1.6 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 11-Oct-2012  njoly branches: 1.4.28;
No need to include files more than once.
 1.3 26-Apr-2012  christos branches: 1.3.2;
Add FREAD for the benefit of kauth!
 1.2 21-Jan-2011  pooka branches: 1.2.4;
fix kobj_open_file_vnode()

patch from haad
 1.1 07-Aug-2009  haad branches: 1.1.2;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.2.4.2 30-Oct-2012  yamt sync with head
 1.2.4.1 23-May-2012  yamt sync with head.
 1.3.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 19-Jun-2012  njoly branches: 1.2.30;
Use CTLTYPE_QUAD for uint64_t type in sysctl_createv.
 1.1 07-Aug-2009  haad branches: 1.1.6;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.6.1 30-Oct-2012  yamt sync with head
 1.2.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10 30-Jul-2022  riastradh solaris: Give threads less bad names.
 1.9 11-Jun-2020  ad uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.8 19-Feb-2020  riastradh Report the OS name and release appropriately for NetBSD.

We are not OpenSolaris or uts!
 1.7 31-Dec-2019  pgoyette Another rename from uvm_free() --> uvm_availmem()
 1.6 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.5 28-May-2018  chs branches: 1.5.2; 1.5.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 05-Jun-2012  jym branches: 1.4.30;
Now that pool_cache_invalidate() is synchronous and can handle per-CPU
caches, merge together pool_drain_start() and pool_drain_end() into

bool pool_drain(struct pool **ppp);

"bool" value indicates whether reclaiming was fully done (true) or not (false)
"ppp" will contain a pointer to the pool that was drained (optional).

See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html
 1.3 10-Mar-2011  pooka branches: 1.3.4;
adjust some pretty likely broken assertion (stksize is hardcoded
from caller, but not used here). now zpool doesn't cause a
kernel crash anymore.
 1.2 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.4.1 30-Oct-2012  yamt sync with head
 1.4.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.4.3 18-Oct-2023  martin Apply patch, requested by riastradh in ticket #1752:

external/cddl/osnet/sys/kern/misc.c (apply patch)

Restore thread_create symbol for compatibility (after removal in
pullup-9 #1711).
 1.5.4.2 09-Aug-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1711):

external/cddl/osnet/sys/kern/misc.c: revision 1.10
external/cddl/osnet/sys/sys/proc.h: revision 1.10

solaris: Give threads less bad names.
 1.5.4.1 25-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #725):

etc/rc.d/mountall: revision 1.12
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.59
external/cddl/osnet/sys/kern/misc.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.5
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c: revision 1.6
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.60
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.61

Define VOP_STRATEGY on zfs device nodes too.
Fixes eternal hangs in attempts to do I/O on device nodes on zfs.
XXX pullup

Teach zfs spec nodes to VOP_BWRITE too.
Fixes hang on writing to, e.g., ffs mounted on a device node that
lives on zfs.
XXX pullup

Teach device nodes on zfs to handle fsync by calling spec_fsync too.
If zfs=YES, unconditioally do zfs mount/unmount -a.

If you set zfs=YES, presumably you positively want the automatic rc.d
actions, so if there's no /sbin/zfs or if zfs can't find pools with
/etc/zfs/zpool.cache, presumably you would like feedback about that
in rc.log.

Report the OS name and release appropriately for NetBSD.
We are not OpenSolaris or uts!

Mark previous #ifdef __NetBSD__, per request from hannken.
 1.5.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5 07-May-2019  hannken Cleanup modules "solaris" and "zfs":

- Defer spa_config_load() until root is mounted.
- Restore the config path to "/etc/zfs/zpool.cache".
- Module "zfs" is type MODULE_CLASS_VFS and no longer depends on "rootvnode".
- Module "solaris" no longer depends on "mp_online".
- Fix rump component registration to not detach "/dev/zfs" if
it didn't attach it.
 1.4 13-Dec-2018  hannken Don't allow module to init before mp_online.
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 12-Mar-2010  darran branches: 1.2.44;
DTrace: Add support for a simulated solaris_cpu[] data structure per
cpu. Needed for the FBT provider amongst other features.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.44.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.5 29-Jun-2024  riastradh sys/sdt.h: Define SET_ERROR(err) macro in sys/sdt.h.

err must be an errno(3) EFOO constant. SET_ERROR(err) yields err,
with a dtrace probe sdt:::set-error(err), so you have a better chance
of finding where EFOO first turned up in some twisty maze of kernel
logic.

Don't limit this to the opensolaris source compat layer -- this will
enable us to use it throughout the regular kernel sources, not just
zfs.

PR kern/58378

XXX kernel revbump -- moves sdt:::set-error probe symbol definition
from solaris.kmod to main netbsd kernel
 1.4 07-Aug-2022  riastradh bsd.kmodule.mk: Build modules with KDTRACE_HOOKS if MKDTRACE=yes.
 1.3 25-Jul-2021  skrll KNF
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 12-Mar-2010  darran branches: 1.1.44;
DTrace: Add support for a simulated solaris_cpu[] data structure per
cpu. Needed for the FBT provider amongst other features.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10 30-Mar-2022  christos Add link our policy.
 1.9 28-Aug-2020  hannken Glue operation secpolicy_fs_mount() passes wrong arguments to
operation kauth_authorize_system().

KAUTH_SYSTEM_MOUNT / KAUTH_REQ_SYSTEM_MOUNT_NEW wants the to be
covered vnode and the mount flags, not the mount structure.

Fix for PR kern/55602: zpool panic on mounting zfs filesystem
 1.8 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.7 28-May-2018  chs branches: 1.7.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 19-Oct-2012  riastradh branches: 1.6.28;
Let's try that again without the static...
 1.5 19-Oct-2012  riastradh Add omitted secpolicy_vnode_utime_modify, for zfs.
 1.4 18-Oct-2012  riastradh Take a first whack at making zfs permissions work.

zfs_access uses secpolicy_vnode_access, so it makes no sense for the
latter to call VOP_ACCESS!

Everything seems to return EACCES instead of EPERM, probably because
that's what kauth returns. This should be fixed, but that may
require some nontrivial surgery to zfs's calls to secpolicy_*, which
is where kauth gets involved.

This commit imports some code from illumos to implement the routine
secpolicy_vnode_setattr. This shouldn't be outside dist/, but for
now it is expedient to do so. We ought to fix that, along with all
the other CDDL code outside dist/, when we next import a newer
version of zfs.
 1.3 15-Oct-2012  riastradh secpolicy_vnode_access must be called with the vnode lock held.

Don't unlock the vnode and then tell the caller about what the world
was like while the vnode was locked. The world changes fast.
 1.2 24-Jun-2010  hannken branches: 1.2.6; 1.2.12;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.6.1 30-Oct-2012  yamt sync with head
 1.6.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.4.1 28-Aug-2020  martin Pull up following revision(s) (requested by hannken in ticket #1066):

external/cddl/osnet/sys/kern/policy.c: revision 1.9

Glue operation secpolicy_fs_mount() passes wrong arguments to
operation kauth_authorize_system().

KAUTH_SYSTEM_MOUNT / KAUTH_REQ_SYSTEM_MOUNT_NEW wants the to be
covered vnode and the mount flags, not the mount structure.

Fix for PR kern/55602: zpool panic on mounting zfs filesystem
 1.3 03-Mar-2020  riastradh Use vpanic, not vprintf and then panic.
 1.2 28-May-2018  chs branches: 1.2.2; 1.2.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.4.1 06-Jul-2021  martin Pull up following revision(s) (requested by riastradh in ticket #1315):

external/cddl/osnet/sys/kern/printf.c: revision 1.3

Use vpanic, not vprintf and then panic.
 1.2.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3 23-Jun-2016  pgoyette On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module. Removes another 'redefined symbol'
error when loading the module.

Related to PR kern/51265
 1.2 14-Dec-2010  haad branches: 1.2.24;
Simple routine to convert long to string.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.24.1 10-Jul-2016  martin Pull up following revision(s) (requested by pgoyette in ticket #1189):
external/cddl/osnet/sys/kern/string.c: revision 1.3
external/cddl/osnet/dev/dtrace/dtrace_hacks.c: revision 1.5
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.32
external/cddl/osnet/dev/dtrace/amd64/dtrace_asm.S: revision 1.6
Import fix from FreeBSD - see [1], [2] references below...
Fix DTrace's panic() action.
It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call
vpanic(9)
directly.
Fixes immediate problem in PR-51265. However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".
[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module. Removes another 'redefined symbol'
error when loading the module.
Related to PR kern/51265
One more removal of a redefined symbol while loading dtrace module.
Should finish the issues with PR kern/51265
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file sysevent.c was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.11 20-Aug-2019  hannken task_executor: prevent use after free, the task function may free
the tasq entry.
 1.10 11-Jun-2019  hannken branches: 1.10.2;
There is no 1:1 relation between cv_signal() and cv_timedwait() as
the latter implicitly calls cv_signal() on error.

This leads to "tq_waiting > 0" with "tq_running == 0" and the
taskq stalls.

Change task_executor() to increment and decrement "tq_waiting"
and always check and run the queue after cv_timedwait().

Use mstohz(), fix timeout and sort includes.

Addresses PR port-xen/54273: "zpool create pool xbd2" panics DOMU kernel
 1.9 07-May-2019  hannken This implementation of Solaris taskq API is incomplete and doesn't track
Solaris upstream. FreeBSD already replaced it with a glue to their
taskqueue API.

Replace it with a glue component that queues Solaris taskq requests to
threadpool jobs.
 1.8 12-Jan-2019  hannken Disable valid assertion "!(flags & TQ_NOQUEUE)" as "zfs send" triggers it.
 1.7 28-May-2018  chs branches: 1.7.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 07-Jan-2017  christos branches: 1.6.12;
PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.5 11-Apr-2015  riastradh branches: 1.5.2;
Fix ASSERT(x == y | z). Interpret nthreads as pct when requested.

Reduces the number of threads created by zfs to a slightly less
insane value.

XXX This whole taskq business is questionable, and we really really
should not have copies of external code outside dist/ and without
vendor branches to record provenance and local changes.
 1.4 11-Apr-2015  riastradh Make taskq_dispatch fail for now with TQ_NOQUEUE; make caller retry.
 1.3 21-Jun-2013  christos rename delay to xdelay to avoid conflicts.
 1.2 28-Feb-2010  haad branches: 1.2.6; 1.2.12;
Add NetBSD build glue to build new zfs version 22 sources.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.12.1 23-Jun-2013  tls resync from head
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.6.12.2 18-Jan-2019  pgoyette Synch with HEAD
 1.6.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.10.2.1 20-Aug-2019  martin Pull up following revision(s) (requested by hannken in ticket #102):

external/cddl/osnet/sys/kern/taskq.c: revision 1.11

task_executor: prevent use after free, the task function may free
the tasq entry.
 1.10 01-Mar-2026  yamt solaris vfs_optionisset: treat 0 as unspecified

this allows users to leave it default.

before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.

looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.

references:
"Temporary Mount Point Properties" section of zfs(8)

PR/60024
https://gnats.netbsd.org/60024
 1.9 05-Sep-2021  mlelstv branches: 1.9.6;
Don't use __FBSDID, similar to kern/kobj.c, kern/misc.c, kern/sysevent.c
 1.8 22-May-2019  hannken Implement the needed part of Solaris lookupname().

Remove unneeded protoype lookupnameat().
 1.7 28-May-2018  chs branches: 1.7.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.6 06-May-2015  hannken branches: 1.6.14;
Remove miscfs/syncfs and

- move the syncer into kern/vfs_subr.c.

- change the syncer to process the mountlist and VFS_SYNC as appropriate.

- use an API for mount points similiar to the API for vnodes:
- vfs_syncer_add_to_worklist(struct mount *mp) to add
- vfs_syncer_remove_from_worklist(struct mount *mp) to remove a mount.

No objections on tech-kern@
 1.5 25-Nov-2013  christos fix one more mountlist instant
 1.4 02-Apr-2011  rmind branches: 1.4.4; 1.4.10;
Remove unused M_MOUNT.
 1.3 24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.2 11-Oct-2009  haad Properly return error when namei_kernel_simple fails.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.10.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.7.2.1 10-Jun-2019  christos Sync with HEAD
 1.9.6.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.3 05-Feb-2019  hannken Prepare the implementation of the ZFS control directory ".zfs".

- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 28-Feb-2010  haad branches: 1.3.44;
Add NetBSD build glue to build new zfs version 22 sources.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 03-May-2022  jkoshy Minor: fix a typo.
 1.1 03-Jun-2018  christos branches: 1.1.2;
Add a blurb of a general approach how to maintain these files.
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 03-Jun-2018  pgoyette file README was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 10-Jan-2026  nia use <sys/endian.h> until I get this to play with rump builds
 1.4 10-Jan-2026  nia osnet: sprinkle #include <machine/endian.h>
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.3 21-Feb-2010  darran branches: 1.3.46;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 01-Mar-2010  haad branches: 1.1.44;
Add header files needed for building zfs as kernel_module.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 07-Jan-2026  nia osnet: Sprinkle <sys/endian.h> inclusion.

prompted by PR pkg/59839
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 28-Feb-2010  haad branches: 1.4.44;
Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 05-Sep-2021  rillig osnet: fix lint warning about empty declaration

proc_bkpt.c(32): warning: empty declaration [0]

Use the same definition as in libarchive.
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file cdefs.h was added on branch pgoyette-compat on 2018-06-25 07:25:25 +0000
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 17-Jul-2011  joerg branches: 1.4.40;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.40.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.3 21-Feb-2010  darran branches: 1.3.46;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 13-Mar-2010  christos branches: 1.7.44;
make dtrace compile on amd64.
 1.6 12-Mar-2010  darran DTrace: Add support for a simulated solaris_cpu[] data structure per
cpu. Needed for the FBT provider amongst other features.
 1.5 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.7.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.8 12-Oct-2020  hannken Stub groupmember() has to test both group list and current group id.

Fixes kern/55675: ZFS mounts do not work with setuid programs
 1.7 29-Apr-2020  riastradh Fix crgetgroups shim.

- Don't use a static buffer for the result.

- kauth_cred_getgroups refuses to return more than the actual number
of groups, so passing NGROUPS_MAX generally doesn't work.

To avoid patching zfs, just expose struct kauth_cred::cr_groups
directly, with __KAUTH_PRIVATE. Unclear why the official API only
exposes it via memcpy or copyout anyway.

This makes unprivileged zfs operations work, by anyone with access to
/dev/zfs (which is conventionally mode 777, and which we should maybe
set it to by default; zfs has its own ACL system, zfs allow).
 1.6 06-Feb-2019  christos branches: 1.6.2;
use sizeof() properly (gcc-7)
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 13-Mar-2010  christos branches: 1.4.44;
make dtrace compile on amd64.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.6.2.2 12-Oct-2020  martin Pull up following revision(s) (requested by hannken in ticket #1111):

external/cddl/osnet/sys/sys/cred.h: revision 1.8

Stub groupmember() has to test both group list and current group id.

Fixes kern/55675: ZFS mounts do not work with setuid programs
 1.6.2.1 29-Apr-2020  martin Pull up following revision(s) (requested by riastradh in ticket #871):

external/cddl/osnet/sys/sys/cred.h: revision 1.7
sys/sys/kauth.h: revision 1.84

Fix crgetgroups shim.

- Don't use a static buffer for the result.
- kauth_cred_getgroups refuses to return more than the actual number
of groups, so passing NGROUPS_MAX generally doesn't work.

To avoid patching zfs, just expose struct kauth_cred::cr_groups
directly, with __KAUTH_PRIVATE. Unclear why the official API only
exposes it via memcpy or copyout anyway.

This makes unprivileged zfs operations work, by anyone with access to
/dev/zfs (which is conventionally mode 777, and which we should maybe
set it to by default; zfs has its own ACL system, zfs allow).
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.6 23-Jul-2019  hannken Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 02-Dec-2012  chs branches: 1.4.28;
update cyclic module to the freebsd 8-stable version as of svn r219520.
 1.3 21-Feb-2010  darran branches: 1.3.6; 1.3.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.1 16-Jan-2013  yamt sync with (a bit old) head
 1.4.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 02-Dec-2012  chs branches: 1.4.28;
adapt the cyclic module and profile dtrace provider to netbsd.
for now, just hook the cyclic callback into hardclock().
 1.3 02-Dec-2012  chs update cyclic module to the freebsd 8-stable version as of svn r219520.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.12.1 25-Feb-2013  tls resync with head
 1.2.6.1 16-Jan-2013  yamt sync with (a bit old) head
 1.4.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.4 28-May-2018  chs branches: 1.4.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.14.1 02-Aug-2025  perseant Sync with HEAD
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 16-Apr-2024  riastradh opensolaris/sys/sys/elf.h: Omit needless __ELF_WORD_SIZE.
 1.7 01-Apr-2024  riastradh elftoolchain: Be consistent about which ELF header files we use.

1. For tools that use elftoolchain: always use elftoolchain's
elfdefinitions.h. Don't even think about looking at the host's
sys/exec_elf.h, which makes no sense and should never happen.

(ELF tools that don't use elftoolchain, like m68k-elf2coff,
continue to use nbincludes/sys/exec_elf.h. But no more nbincludes
hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
sys/exec_elf.h, even in Solaris components via sys/elf.h.
elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
elfdefinitions.h via libelf header files (libelf.h, gelf.h).

libdtrace in particular requires _all_ R_* reloc type definitions,
but sys/exec_elf.h brings in only the _current machine's_ R_*
reloc type definitions. (While here: Use uintptr_t instead of
Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
provided only by sys/exec_elf.h, not by elfdefinitions.h.)

And most userland components using libelf don't rely on any
properties of the current machine from sys/exec_elf.h, so they can
use libelf's elfdefinition.h.

Exceptions:

- dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
but it also relies on sys/dtrace.h -> sys/elf.h ->
elfdefinitions.h like other userland components using sys/elf.h.

- kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
sys/elf.h -> elfdefinitions like other userland components using
sys/elf.h.

- t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
core files, but relies on sys/exec_elf.h for struct
netbsd_elfcore_procinfo.

None of these exceptions needs all R_* reloc type definitions, so
as a workaround, we can just suppress libelf's elfdefinitions.h by
defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake. This was:

- half bogus workarounds for missing build_install dependencies in
tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
tools involving libelf instead of libelf's elfdefinitions.h, which
collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 01-Mar-2010  darran branches: 1.5.44;
DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 01-Feb-2016  christos prevent re-defines
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.3 28-May-2018  chs branches: 1.3.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.14.1 02-Aug-2025  perseant Sync with HEAD
 1.3 21-Feb-2010  darran DTrace: remove file.h - it shouldn't have been added and breaks zfs.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 28-Feb-2010  haad branches: 1.3.44;
Add NetBSD build glue to build new zfs version 22 sources.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Jul-2019  hannken Remove unneeded includes.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 24-Jul-2019  hannken Remove unneeded includes.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.4 19-Jun-2019  hannken Sync with upstream r315983.
 1.3 14-Nov-2018  riastradh Define _LP64 or _ILP32 for all architectures.

Rather than write out a table for each architecture, rely on the C
compiler to define _LP64 for 64-bit ones, on the assumption that
anything not LP64 is ILP32, and on CTASSERTs to verify this
assumption so that if it's wrong it'll fail safely with a noisy build
failure.

Gives zfs half a chance of building on, e.g., powerpc.
 1.2 21-Feb-2015  ozaki-r branches: 1.2.14; 1.2.16;
Fix dtrace build error with gcc 4.8 on i386 and arm

_ILP32 is required by dt_popc.

The fix is inspired by FreeBSD.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.16.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.16.1 10-Jun-2019  christos Sync with HEAD
 1.2.14.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.6 11-Jul-2023  martin Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.
 1.5 30-Jul-2022  riastradh branches: 1.5.2;
zfs: Give condvars more meaningful names.

These will be truncated to 16 characters, but hey, better'n `zfscv'.
 1.4 28-May-2018  chs branches: 1.4.4;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.4.1 09-Aug-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1710):

external/cddl/osnet/sys/sys/kcondvar.h: revision 1.5

zfs: Give condvars more meaningful names.

These will be truncated to 16 characters, but hey, better'n `zfscv'.
 1.5.2.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11 23-May-2019  hannken Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
 1.10 28-May-2018  chs branches: 1.10.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.9 18-Nov-2017  kre branches: 1.9.2;

Let's define symbols before using them.
 1.8 18-Nov-2017  christos use symbolic constant for 0
 1.7 17-Nov-2017  christos our pool code needs either PR_SLEEP or PR_NOWAIT; arrange for that explaining
the current choice :-)
 1.6 21-Feb-2010  darran branches: 1.6.38;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.5 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4 08-Jan-2010  ober Fix comment to meet style guidelines.
 1.3 03-Jan-2010  ober Make sure the comment is specific to being a hack and that it needs to be pulled before production release and the real issues with UVM and ZFS need to be resolved.
 1.2 03-Jan-2010  ober Set KM_PUSHPAGE to KM_SLEEP to prevent the arc_buf_alloc panics in ZFS.
ok haad@
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.6.38.1 22-Mar-2018  martin Pull up following revision(s) (requested by maya in ticket #651):
external/cddl/osnet/sys/sys/kmem.h: revision 1.8
external/cddl/osnet/sys/sys/kmem.h: revision 1.9
external/cddl/osnet/sys/sys/kmem.h: revision 1.7

our pool code needs either PR_SLEEP or PR_NOWAIT; arrange for that explaining
the current choice :-)

use symbolic constant for 0

Let's define symbols before using them.
 1.9.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.10.2.1 10-Jun-2019  christos Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 07-Jan-2017  christos PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.1 07-Aug-2009  haad branches: 1.1.28;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 14-Dec-2010  haad branches: 1.4.44;
NetBSD doesn't have /etc/mnttab replace it with /dev/null.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 01-Mar-2010  darran branches: 1.5.44;
DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 04-Mar-2014  ozaki-r branches: 1.7.24;
Get rid of unused variable definition za from mount.h

There is no user for it. Even worse, it breaks dtrace build for arm.
 1.6 20-Oct-2012  riastradh Use 0 for MS_NOMNTTAB since we have no mnttab anyway.
 1.5 20-Oct-2012  joerg Hack to avoid missing macro to unbuild the tree.
 1.4 28-Feb-2010  haad branches: 1.4.6; 1.4.12;
Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.6.1 30-Oct-2012  yamt sync with head
 1.7.24.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 03-Jun-2018  christos The native mutex.h has a userland visible portion. make it so and fix the
build.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 29-Mar-2021  simonb Don't define mtx_owner here. mtx_owner is always available, and not
all architecutres use the same structure for a kernel mutex.

OK thorpej@
 1.1 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 23-Oct-2018  christos branches: 1.1.2; 1.1.4;
Avoid conflicts with "our" (the FreeBSD) nvpair/nvlist implementation by
prefixing all symbols with "opensolaris_".
 1.1.4.2 10-Jun-2019  christos Sync with HEAD
 1.1.4.1 23-Oct-2018  christos file nvnamespace.h was added on branch phil-wifi on 2019-06-10 21:52:04 +0000
 1.1.2.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.2.1 23-Oct-2018  pgoyette file nvnamespace.h was added on branch pgoyette-compat on 2018-11-26 01:50:01 +0000
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.8 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.7 25-May-2023  lukem branches: 1.7.2;
osnet: on macOS, use <mach/boolean.h> for boolean_t

macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.
So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.

May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.6 15-Apr-2021  christos branches: 1.6.6;
avoid second typedef for boolean_t in kernel code originally defined in
<sys/types.h>
 1.5 05-Dec-2019  riastradh Avoid redefining uint_t &c. if compat_defs.h already defines them.
 1.4 06-Sep-2018  christos branches: 1.4.2;
remove duplicate typedef (it is in sunddi.h)
 1.3 01-Jun-2018  kre branches: 1.3.2;

Avoid duplicate typedefs so these headers can be used
as part of tools build, when the base system compiler does
not allow duplicate type definitions.

Someone please fix this some better way than this!
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 01-Feb-2016  christos branches: 1.1.14;
Split the opensolaris types into opentypes.h because linux includes
sysmacros.h from types.h and we can't interpose ourselves to define
the needed types otherwise.
Disable unused macros, get rid of __APPLE__
 1.1.14.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.2.1 10-Jun-2019  christos Sync with HEAD
 1.4.2.1 17-Dec-2019  martin Pull up following revision(s) (requested by riastradh in ticket #564):

external/cddl/osnet/sys/sys/opentypes.h: revision 1.5

Avoid redefining uint_t &c. if compat_defs.h already defines them.
 1.6.6.1 30-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #221):

external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.18
external/cddl/osnet/sys/sys/opentypes.h: revision 1.7
tools/compat/configure: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.6
external/cddl/osnet/dist/tools/ctf/cvt/barrier.h: revision 1.4
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.7
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.8
tools/compat/configure.ac: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c: revision 1.10
tools/compat/nbtool_config.h.in: revision 1.54

ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:

ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented

ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).

This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103

tools/compat: regen for dispatch_semaphore_create

ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.

osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.

So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.5 02-Jun-2018  christos branches: 1.5.14;
don't include <sys/proc.h>
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.14.1 02-Aug-2025  perseant Sync with HEAD
 1.5 22-May-2019  hannken Implement the needed part of Solaris lookupname().

Remove unneeded protoype lookupnameat().
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 10-Jun-2019  christos Sync with HEAD
 1.5 24-Jul-2019  hannken Remove unneeded includes.
 1.4 28-May-2018  chs branches: 1.4.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.9 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 19-Oct-2012  riastradh branches: 1.7.28;
Add omitted secpolicy_vnode_utime_modify, for zfs.
 1.6 18-Oct-2012  riastradh Take a first whack at making zfs permissions work.

zfs_access uses secpolicy_vnode_access, so it makes no sense for the
latter to call VOP_ACCESS!

Everything seems to return EACCES instead of EPERM, probably because
that's what kauth returns. This should be fixed, but that may
require some nontrivial surgery to zfs's calls to secpolicy_*, which
is where kauth gets involved.

This commit imports some code from illumos to implement the routine
secpolicy_vnode_setattr. This shouldn't be outside dist/, but for
now it is expedient to do so. We ought to fix that, along with all
the other CDDL code outside dist/, when we next import a newer
version of zfs.
 1.5 01-Mar-2010  darran branches: 1.5.6; 1.5.12;
DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.6.1 30-Oct-2012  yamt sync with head
 1.7.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 01-Mar-2010  haad branches: 1.1.44;
Add header files needed for building zfs as kernel_module.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 01-Mar-2010  haad This id compile time generated file add it to sys/sys and do not polute
dist dir with it.
 1.10 30-Jul-2022  riastradh solaris: Give threads less bad names.
 1.9 15-Nov-2018  riastradh branches: 1.9.2;
Omit unused definition with broken cpp conditional.
 1.8 03-Jun-2018  chs branches: 1.8.2;
tweak the osnet compat headers to allow building on MacOS and Linux hosts.
 1.7 02-Jun-2018  christos - Remove more extraneous includes to avoid circular dependencies with the
real header files.
- Add <sys/errno.h> to <sys/systm.h> to avoid changing the source, but
it should really belong to the source.
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 13-Mar-2010  christos branches: 1.5.44;
make dtrace compile on amd64.
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.5.44.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.5.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.2.1 10-Jun-2019  christos Sync with HEAD
 1.9.2.1 09-Aug-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1711):

external/cddl/osnet/sys/kern/misc.c: revision 1.10
external/cddl/osnet/sys/sys/proc.h: revision 1.10

solaris: Give threads less bad names.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.3 19-Jun-2019  hannken Sync with upstream r315983.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 28-May-2018  chs branches: 1.1.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.1.2.1 28-May-2018  pgoyette file racct.h was added on branch pgoyette-compat on 2018-06-25 07:25:26 +0000
 1.6 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.5 03-Jan-2013  dsl branches: 1.5.28;
Spell cprng_fast() properly
 1.4 03-Jan-2013  dsl Use cprgn_fast() not rnd_extract_data().
The latter isn't in any header files any more.
 1.3 21-Feb-2010  darran branches: 1.3.6; 1.3.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.5.28.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.10 29-Jun-2024  riastradh sys/sdt.h: Define SET_ERROR(err) macro in sys/sdt.h.

err must be an errno(3) EFOO constant. SET_ERROR(err) yields err,
with a dtrace probe sdt:::set-error(err), so you have a better chance
of finding where EFOO first turned up in some twisty maze of kernel
logic.

Don't limit this to the opensolaris source compat layer -- this will
enable us to use it throughout the regular kernel sources, not just
zfs.

PR kern/58378

XXX kernel revbump -- moves sdt:::set-error probe symbol definition
from solaris.kmod to main netbsd kernel
 1.9 30-Jul-2022  riastradh osnet: Stop disabling dtrace probes.
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 02-Oct-2015  christos branches: 1.7.14;
put back the DTRACE macros
 1.6 02-Oct-2015  christos we don't need any of this now.
 1.5 01-Mar-2010  darran DTrace: fix to only define sdt_provider_t if in the kernel. Not for
user space.
 1.4 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 24-Jul-2019  hannken Remove unneeded includes.
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 28-Feb-2010  haad Add NetBSD/Solaris compatibility SHA header.
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4 24-Jul-2019  hannken Remove unneeded includes.
 1.3 28-May-2018  chs branches: 1.3.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 21-Feb-2010  darran branches: 1.2.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.2.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 14-Dec-2010  haad branches: 1.4.44;
Simple routine to convert long to string.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.6 22-May-2019  hannken Update ddi environment:
- Put device major numbers into "dev_info_t".
- Fix an off-by-one in zvol_create_minor().
- When creating a node handle existing nodes
and add owner read/write permission.
- When removing nodes remove now empty directories.
 1.5 28-May-2018  chs branches: 1.5.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 19-May-2010  haad branches: 1.4.44;
Use ddi_copyin and ddi_copyout as solaris does, change them to
ioctl_copyin/ioctl_copyout in kernel and to bcopy in user space.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 01-Mar-2010  haad branches: 1.1.44;
Add header files needed for building zfs as kernel_module.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 28-Feb-2010  haad branches: 1.1.44;
Add our local version of sysevent.h file without door.h useage.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.10 19-Jun-2019  hannken Sync with upstream r315983.
 1.9 03-Jun-2018  chs branches: 1.9.2;
tweak the osnet compat headers to allow building on MacOS and Linux hosts.
 1.8 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 01-Feb-2016  christos branches: 1.7.14;
Split the opensolaris types into opentypes.h because linux includes
sysmacros.h from types.h and we can't interpose ourselves to define
the needed types otherwise.
Disable unused macros, get rid of __APPLE__
 1.6 27-Dec-2015  christos Override roundup.
 1.5 07-Feb-2015  christos check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
 1.4 02-Mar-2010  darran DTrace: Get DTrace to build on OS X platforms.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 06-Jun-2019  hannken branches: 1.1.2;
Handle files not present upstream:

dist/lib/libshare/common/libshare.h -> sys/libshare.h
dist/uts/common/sys/systeminfo.h -> sys/sys/systeminfo.h
dist/uts/common/sys/taskq_impl.h -> TRASH

No functional change intended.
 1.1.2.2 10-Jun-2019  christos Sync with HEAD
 1.1.2.1 06-Jun-2019  christos file systeminfo.h was added on branch phil-wifi on 2019-06-10 21:52:04 +0000
 1.6 02-Jun-2018  christos - Remove more extraneous includes to avoid circular dependencies with the
real header files.
- Add <sys/errno.h> to <sys/systm.h> to avoid changing the source, but
it should really belong to the source.
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 21-Jun-2013  christos branches: 1.4.26;
rename delay to xdelay to avoid conflicts.
 1.3 21-Feb-2010  darran branches: 1.3.6; 1.3.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.12.1 23-Jun-2013  tls resync from head
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.26.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 24-Jul-2019  hannken Remove unneeded includes.
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.15 31-Oct-2022  simonb branches: 1.15.4;
Only need TIMESPEC_OVERFLOW() to check against INT32_{MIN,MAX} on FreeBSD.
 1.14 19-Sep-2022  mlelstv Reference kernel-wide hz constant instead of using a private but possibly
different value.
 1.13 29-Aug-2021  christos Include <time.h> for all GNU systems (hurd). From Damien Zammit
 1.12 03-Jun-2018  chs tweak the osnet compat headers to allow building on MacOS and Linux hosts.
 1.11 02-Jun-2018  christos - Remove more extraneous includes to avoid circular dependencies with the
real header files.
- Add <sys/errno.h> to <sys/systm.h> to avoid changing the source, but
it should really belong to the source.
 1.10 01-Jun-2018  kre Avoid duplicate typedefs so these headers can be used
as part of tools build, when the base system compiler does
not allow duplicate type definitions.

Someone please fix this some better way than this!
 1.9 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 07-Jan-2018  christos branches: 1.8.2;
add casts
 1.7 28-Apr-2016  christos include stdio.h for NULL
 1.6 27-Dec-2015  christos We don't need to declare clock_gettime if we don't have it and we don't need
to __RENAME if we are not NetBSD.
 1.5 21-Dec-2015  joerg Our time.h defines clock_gettime with assembler name after including
sys/time.h. The Solaris compat code in sys/time.h wants to use it in an
inline function, but misses a prototype (and the relabeling). As stopgap
for getting consistent defines of clock_gettime duplicate the prototype
here.
 1.4 26-Mar-2010  christos deal with missing CLOCK_REALTIME
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.8.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.15.4.1 02-Aug-2025  perseant Sync with HEAD
 1.21 11-Sep-2024  christos - Remove conditional code for HAVE_NBTOOLS_CONFIG_H. The variable name was
wrong anyway (it is HAVE_NBTOOL_CONFIG_H) so the code never worked as
intended.
- Do not define _NETBSD_SOURCE even temporarily. It broke the tools
build because <sys/types.h> includes <sys/endian.h> and with _NETBSD_SOURCE
defined, this exposes the *enc and *dec functions which libctf redefines
if it thinks that the system does not define them (and nbtools_config.h
tells libctf that we are not defining them).
 1.20 03-Jun-2018  chs branches: 1.20.4; 1.20.12; 1.20.14;
tweak the osnet compat headers to allow building on MacOS and Linux hosts.
 1.19 01-Jun-2018  kre Avoid duplicate typedefs so these headers can be used
as part of tools build, when the base system compiler does
not allow duplicate type definitions.

Someone please fix this some better way than this!
 1.18 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.17 01-Feb-2016  christos branches: 1.17.14;
Split the opensolaris types into opentypes.h because linux includes
sysmacros.h from types.h and we can't interpose ourselves to define
the needed types otherwise.
Disable unused macros, get rid of __APPLE__
 1.16 31-Jan-2016  christos define it when we have vaddr_t exposed.
 1.15 31-Jan-2016  christos we don't keed page count in userland.
 1.14 31-Jan-2016  christos only need pgcnt_t in kernel.
 1.13 12-Dec-2013  matt Don't define ptrdiff_t since that's done in the NetBSD <sys/types.h>
 1.12 17-Jul-2011  joerg branches: 1.12.2; 1.12.8;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.11 11-Mar-2010  darran DTrace: fix a few build issues for tools and the dtrace provider operation
interface.
 1.10 10-Mar-2010  darran DTrace: fix a libctf toolchain build problem.
 1.9 02-Mar-2010  darran DTrace: another fix for OS X builds, stdint.h location.
 1.8 02-Mar-2010  darran DTrace: Get DTrace to build on OS X platforms.
 1.7 01-Mar-2010  darran DTrace: fix a few problems introduced by the recent ZFS update (expected
problems from the OpenSolaris merge).
 1.6 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.5 25-Feb-2010  darran DTrace: fix CTF tools for non-toolchain build.
 1.4 24-Feb-2010  darran DTrace: Get the CTF tools building as part of the toolchain.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.12.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.20.14.1 02-Aug-2025  perseant Sync with HEAD
 1.20.12.1 03-Oct-2024  martin Pull up following revision(s) (requested by rin in ticket #923):

external/cddl/osnet/sys/sys/types.h: revision 1.21

- Remove conditional code for HAVE_NBTOOLS_CONFIG_H. The variable name was
wrong anyway (it is HAVE_NBTOOL_CONFIG_H) so the code never worked as
intended.
- Do not define _NETBSD_SOURCE even temporarily. It broke the tools
build because <sys/types.h> includes <sys/endian.h> and with _NETBSD_SOURCE
defined, this exposes the *enc and *dec functions which libctf redefines
if it thinks that the system does not define them (and nbtools_config.h
tells libctf that we are not defining them).
 1.20.4.1 26-Oct-2024  martin Pull up following revision(s) (requested by rin in ticket #1915):

external/cddl/osnet/sys/sys/types.h: revision 1.21

- Remove conditional code for HAVE_NBTOOLS_CONFIG_H. The variable name was
wrong anyway (it is HAVE_NBTOOL_CONFIG_H) so the code never worked as
intended.
- Do not define _NETBSD_SOURCE even temporarily. It broke the tools
build because <sys/types.h> includes <sys/endian.h> and with _NETBSD_SOURCE
defined, this exposes the *enc and *dec functions which libctf redefines
if it thinks that the system does not define them (and nbtools_config.h
tells libctf that we are not defining them).
 1.2 24-Jul-2019  hannken Remove unneeded includes.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.13 24-Jul-2025  hans Fix OpenSolaris-derived headers and sources to avoid conflicts with
system headers when cross-building on illumos.
 1.12 30-Nov-2018  hannken branches: 1.12.12;
Zfs_write() may hide write errors if uiomove() succeeds but a
further dmu_tx_assign() fails because over quota or no space.

Use the emulated uiocopy() and uioskip() like illumos does.

Fix the uiocopy() emulation to not clobber the iovecs.
 1.11 28-May-2018  chs branches: 1.11.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.10 07-Jan-2018  christos branches: 1.10.2;
add casts
 1.9 26-Sep-2015  christos avoid compiler warnings
 1.8 21-Apr-2015  riastradh Remove bogus size_t->int casts in uiomove.
 1.7 11-Apr-2015  riastradh Nuke UIO_XUIO so nothing accidentally misuses it.
 1.6 19-Mar-2015  riastradh These are expressions, not statements. No semicolon.
 1.5 14-Dec-2010  haad Do not include debug.h
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.10.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.10.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.11.2.1 10-Jun-2019  christos Sync with HEAD
 1.12.12.1 02-Aug-2025  perseant Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 01-Mar-2010  haad branches: 1.1.44;
Add header files needed for building zfs as kernel_module.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 24-Jul-2019  hannken Remove unneeded includes.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 17-Jul-2011  joerg branches: 1.4.40;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.40.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.4 28-Feb-2010  haad branches: 1.4.44;
Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.4.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.23 23-Mar-2026  yamt zfs: fix "slow rm" issue (cont.)

commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
 1.22 20-Mar-2026  yamt zfs: fix file vdev

make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.

this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```

cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
 1.21 17-Dec-2021  simonb branches: 1.21.6;
In vattr_init_mask() check for va_flags and if set add to the mask of
to the things that setattr is interested in.
Fixes chflags(2) on ZFS.

Thanks riastradh@ for fix.
 1.20 18-Jul-2021  kardel PR kern/56316: vn_open doesn't follow symlinks

remove setting of O_NOFOLLOW. restores ZFS being able
to open devices via symlinks again.
 1.19 29-Jun-2021  dholland Add containment for the cloning devices hack in vn_open.

Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)
 1.18 15-Apr-2021  christos remove extra typedef for vnode_t done in <sys/vnode.h>
 1.17 26-May-2020  hannken Replace vp->v_count with vrefcnt(vp) and
remove now unneeded "#define v_count ...".
 1.16 13-Apr-2020  ad Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.
 1.15 12-Jan-2019  hannken Allow zfs_vn_rdwr() with "rw == UIO_READ" too.
 1.14 28-May-2018  chs branches: 1.14.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.13 09-Apr-2015  riastradh branches: 1.13.14;
Fix vattr_init_mask: mode is mode_t, not u_short.

Fixes fs/vfs/t_vnops:zfs_attrs test.
 1.12 29-Oct-2013  hannken Vnode API cleanup pass 1.

- Make these defines and functions private to vfs_vnode.c:

VC_MASK, VC_LOCK, DOCLOSE, VI_IANCTREDO and VI_INACTNOW
vclean() and vrelel()

- Remove the long time unused lwp argument from vrecycle().

- Remove vtryget(), it is responsible for ugly hacks and doesn't
look that effective.

Presented on tech-kern.

Welcome to 6.99.25
 1.11 23-Sep-2013  christos don't use IO_APPEND. In the vdev_file.c we end up appending to our virtual
file as a filesystem! With this change:

$ dd if=/dev/zero of=disk1 count=266144
$ zpool create crap $PWD/disk1

mounts /crap and it seems to work ok, until I try unmounting
 1.10 23-Sep-2013  christos Hack: Instead of dying in vrele with a kernel assertion, detect that the
usecount of the vnode is 0 and treat it as a noop. This is wrong, buf it
get us through the VN_RELE() after the close in vdev_file.c
 1.9 12-Jun-2011  mrg branches: 1.9.2; 1.9.8;
v_interlock is now a pointer to kmutex_t, use it as one.
fixes many of the 5.99.53 build issues in zfs, but not all of them.
 1.8 21-Jan-2011  pooka branches: 1.8.2;
fix kobj_open_file_vnode()

patch from haad
 1.7 14-Dec-2010  haad branches: 1.7.2;
Add some more solaris vnode defs for zfs_ctldir.
 1.6 19-Nov-2010  dholland Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
 1.5 24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.4 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.3 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.7.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.8.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.9.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.14.2 18-Jan-2019  pgoyette Synch with HEAD
 1.13.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.14.2.2 21-Apr-2020  martin Sync with HEAD
 1.14.2.1 10-Jun-2019  christos Sync with HEAD
 1.21.6.1 03-Apr-2026  martin Pull up following revision(s) (requested by yamt in ticket #244):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.31
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.9
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.32
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c: revision 1.36
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.33
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.82
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.34
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.83
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.35
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.84
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.85
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.86
external/cddl/osnet/sys/sys/vnode.h: revision 1.22
external/cddl/osnet/sys/kern/vfs.c: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.87
external/cddl/osnet/sys/sys/vnode.h: revision 1.23
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.88
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.10
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.89
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h: revision 1.11
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c: revision 1.27
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_rlock.h: revision 1.4
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.15
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.90
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c: revision 1.16
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.91
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.92
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.93
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.94
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.95
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.96
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.97
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h: revision 1.2
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.98
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.99
sys/kern/vfs_mount.c: revision 1.111
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.7
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c: revision 1.8
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c: revision 1.2

zfs: add zfs_range_lock_try

i plan to use this to fix pgdaemon deadlock issue. (PR/60004)
(thus i didn't bother to implement RL_READER.)
note: recent openzfs has a similar function. (zfs_rangelock_tryenter)
this commit ought to be reverted when/if we switch to it.
PR 60004

zfs_netbsd_putpages: do not make the pagedaemon block on the range lock
blocking here can end up with a deadlock because ordinary
vnops can wait for memory holding the range lock.
fixes PR/60004

solaris vfs_optionisset: treat 0 as unspecified
this allows users to leave it default.
before this change, when a user runs "zfs mount -a",
it was processed as "mount them read-write, overriding readonly property".
i don't think it's what the user usually intends.
looking at the illumos code, it seems that mount options there are
basically tri-state. that is, "ro", "rw", and unspecified.
as NetBSD only has a single bit, MNT_RDONLY or !MNT_RDONLY, this commit
maps !MNT_RDONLY to unspecified, which i believe more often matches
the user's intention. it also seems like what illumos does for the legacy
MS_RDONLY bit if i read their code correctly. that is, if MS_RDONLY is set,
it sets MNTOPT_RO. on the other hand, a lack of MS_RDONLY doesn't imply
MNTOPT_RW.
references:
"Temporary Mount Point Properties" section of zfs(8)
PR/60024

zfs: fix a deadlock in read()
while zfs on netbsd is a non-UBC filesystem, we have a logic to try
mimicking UBC-like consistency between mmap and read/write, which
some "broken" applications might rely on. however, the logic is not
safe as indicated by the XXXNETBSD comment. it isn't safe because
touching user pages can involve page faults, which may need to block
on other (or even same) pages with an undefined locking order.
this commit fixes it by using an intermediate buffer to avoid touching
user pages while keeping a file page busy.
although this probably can be optimized by checking VV_MAPPED, i'm not
in a mood to complicate this already-complicated code further. because
zfs doesn't use UBC, if a file has uvm pages, it almost certainly has
VV_MAPPED anyway.

tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c
an alternative fix would be to drop these UBC-compat logic altogether.
while it surely simplifies the code, it might break some applications
which don't use msync properly. i suspect such applications are not
so rare, because UBC is ubiquitous among modern operating systems
these days.

zfs: fix data loss with some combinations of mmap and write
in write(), make a mmap page clean only when we are overwriting the
whole page. otherwise, modifications made via mmap which are outside
the overwritten region will be lost.
tested with https://github.com/yamt/garbage/blob/master/c/ubc/ubctest.c

zfs: reject read() on directory
right now, netbsd in general allows read() on directory for
the compatibility with historical applications. (i have not
seen such an application by myself though. is anyone around
here still keeping such ancient binaries? i'm curious if such
a binary still works on today's UFS.)

this commit makes zfs reject such an attempt because zfs is
not prepared to produce the historical UFS dirent structure.


zfs: fix case insensitive / utf-8 normalized file names
zfs has a few options for file name comparison.
when they are enabled, disable netbsd's name cache, which only
supports exact-byte-matching, to avoid inconsistent behaviors.
cf. "casesensitivity" and "normalization" in zfs(8)

zfs: purge name cache on teardown
this fixes name cache inconsistencies on
certain events. eg. rollback
```
zfs create $FS
echo a > /$FS/a.txt
echo b > /$FS/b.txt
echo c > /$FS/c.txt
zfs snap $FS@2
rm /$FS/b.txt
cat /$FS/a.txt
cat /$FS/b.txt || : # create negative cache entry
cat /$FS/c.txt
zfs rollback $FS@2
cat /$FS/a.txt
cat /$FS/b.txt # hit the negative cache entry because of the bug
cat /$FS/c.txt
```
zfs zvol.c: #ifdef out zvol_log_truncate
the functions is currently not used by netbsd.
disable compilation of it to make it easier to port patches.
zfs: remove unused whiteout logic
zfs: fix zfs_range_lock_try
the change "zfs: add zfs_range_lock_try" was incomplete.
i've observed the following deadlock:
```
db{0}> tr /a ffff96777f74f400
trace: pid 0 lid 125 at 0xffffce80c3203b50
sleepq_block() at netbsd:sleepq_block+0xf4
cv_wait() at netbsd:cv_wait+0xca
pool_grow() at netbsd:pool_grow+0x47b
pool_get() at netbsd:pool_get+0xae
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x136
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x27d
kmem_intr_alloc() at netbsd:kmem_intr_alloc+0x13c
kmem_alloc() at netbsd:kmem_alloc+0x2a
zfs_range_lock_impl() at zfs:zfs_range_lock_impl+0x30
zfs_netbsd_putpages() at zfs:zfs_netbsd_putpages+0x1c0
VOP_PUTPAGES() at netbsd:VOP_PUTPAGES+0x43
uvm_pageout() at netbsd:uvm_pageout+0x257
db{0}>
```
this commit fixes it by using KM_NOSLEEP when non-blocking
operation is requested.


zfs: reject all mount op flags for now
- our logic in zfs_vfsops.c is inconsistent. sometimes it checks
uap->flags, sometimes vfsp->vfs_flag. (aka mnt_flag)
- our userland tools (zfs, mount_zfs) currently don't seem to have
a way to pass these flags anyway. (zmount in libzfs always passes
0 to both of mount(2) 'flags' argument and 'uap->flags'. although
it stores something in uap->mflag and uap->optptr, nothing uses
them. it doesn't even set MS_OPTIONSTR. we don't implement
MS_OPTIONSTR anyway.)
this commit simply rejects them for safety. as these operations have
never been implemented in NetBSD, it shouldn't have any impact to users.
maybe someday we should fix these, but i guess it involves some
ABI changes, which i'm not in a mood to do right now.
related to PR/60026


zfs_vnops.c: fix whitespace
no functional changes are intended.


zfs_netbsd_gop_markupdate: actually update file timestamp
the implementation before this commit was basically no-op.
some notes:
* this is (ab)used in zfs_netbsd_write for fifo/spec vnodes.
i feel it's a bit excessive to update the timestamp on every
writes to /dev/null. unfortunately, zfs doesn't have nodevmtime
option. well, i suspect netbsd is the only os with the traditional
devmtime behavior these days. we may want to implement delayed
mtime update as ffs does.
* this is used by zfs_netbsd_putpages via genfs_putpages. but it's
redundant because zfs_putapage updates the timestamp as well.
* this is not used by zfs_netbsd_getpages. zfs doesn't use
genfs_getpages. zfs_netbsd_getpages doesn't have the
corresponding logic either. maybe it's ok for most of applications
as far as mtime will be updated sooner or later.


zfs: remove mysterious comments on read/write ops for spec/fifo


zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.


zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
dounmount/vfs_insmntque: allow vcache_get during VFS_UNMOUNT
we currently have assertions to prevent file systems from
populating its vnode cache during VFS_UNMOUNT. this commit
relaxes the assertions a bit to allow vcache_get during
VFS_UNMOUNT. although VFS_UNMOUNT should still eventually
drain the vnode cache for the mount, this commit allows it
to populate its vnode cache temporarily.
this is for zfs, which sometimes need to access znode when
committing the log. (zfs_get_data) a forthcoming zfs change
will depend on this change.
PR/59885
discussed on tech-kern.


zfs: fix "slow rm" issue
* stop commiting zil in zfs_netbsd_reclaim and other operations
in vnode reclaim path.
* retire zfs_zget_cleaner/VN_RELE_CLEANER.
instead, just use normal zfs_zget and vrele_async.
note that these two changes depend on each other:
* zfs_zget_cleaner relies on zil_commit in zfs_netbsd_reclaim to
ensure that the znode referenced by TX_WRITE itx is always in-core.
* otoh, zfs_zget_clear makes zil_commit in the vnode reclaim path
possible. that is, zfs_netbsd_reclaim (VOP_RECLAIM) is called with
the vnode in VS_RECLAIMING state, which would make vcache_vget
block.
if the vnode being reclaimed happened to have TX_WRITE itx on the
zil, it deadlocks.
an alternative would be to make the upper layer (vfs_vnode.c) retain
unlinked vnodes for a while. (a bit longer than the 5 sec txg commit
interval should be enough.) eg. by making zfs_netbsd_inactive report
a_recycle = 0. but i guess it's better to remove
zfs_zget_cleaner/VN_RELE_CLEANER to to keep the code less diverged
from the upstream zfs.

also, this commit makes zfs_umount retry vflush a bit.
it's necessary because, for some reasons, during unmount, zil_close
commits the log, which can load some referenced vnodes back to the
cache. i don't understand why zil_close needs to commit the log
when we are syncing txg for unmount anyway. although it might be
possible to avoid the zil commit at all, probably this change
is less invasive than that. this logic is partly from J. Hannken-Illjes.
PR/59885
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/02/20/msg030817.html


zfs: flush mmap pages on fsync
it seems the logic to flush page cache in fsync has been removed
during the initial port to netbsd. at that point it was probably ok
because we simply didn't support mmap. since then, mmap support has
been added. but the fsync logic has not been restored. it means that
mmap-modified pages are left dirty basically forever, unless the
application explicitly performs msync on them or page daemon tries
to reclaim them on system memory shortage. it's bad especially for
a file system like zfs because writing data to zfs involves complex
locking and memory allocations, and thus not safe in the context of
the page daemon.

this commit fixes (well, at least improves the situation a bit) by
putting back the page flushing logic.
ideally netbsd needs to have some throttling mechanism on
page-dirtying activities. i suppose such a mechanism can be
implemented in a mostly filesystem-independent manner.
(it was one of my motivations of yamt-pagecache branch.)
zfs: don't commit the zil for FSYNC_LAZY
FSYNC_LAZY is meant for periodic syncer activity.
unlike fsync() system call, it doesn't give any promises
about data integrity to users.


zfs_putapage: don't try to write to zfs in the page daemon context
basically zfs is not prepared to be called safely for page daemon.
for now, if we found the page dirty, (thus we need to push it into zfs)
just punt with ENOMEM. hopefully the page daemon will find some other
pages to reclaim.
if the system is already full of dirty pages backed by zfs, i suppose
there is no good way to recover. for a longer term, we probably need
some dirty-page throttling mechanism to avoid the situation in the
first place.


zfs: fix "slow rm" issue (cont.)
commit a change which was lost during a porting from
my local git repo to cvs.
fortunately, it was harmless to miss this change though.
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.


zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
/*
* On NetBSD, we need to push out atime updates. Solaris does
* this during VOP_INACTIVE, but that does not work well with the
* BSD VFS, so we do it in batch here.
*/
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
note: deferring it further to VOP_RECLAIM as we do for ffs has
its advantages. however, i prefer to keep the divergance from the
upstream smaller for now. i also have vague concerns on the
interactions with zfs features like snapshots. may revisit later.
discussed on tech-kern.
https://mail-index.netbsd.org/tech-kern/2026/03/17/msg030895.html


zfs: use 32-bit st_dev for stat(2)
while dev_t is 64-bit on NetBSD since the merge of
christos-time_t branch in 2009, we only use the lower
32-bit of it, at least for the purpose of specifying
a device in the kernel.
however, dev_t is also used as a file system id. eg. st_dev
reported by stat(2). as zfs has no device to naturally represent
its file system, currently it reports 56-bit guid of the file
system for the purpose.

unfortunately, some user applications still consider it as
a good old device id and assumes operations like
makedev(major(dev),minor(dev)) preserves the value.
it doesn't hold for NetBSD's implementation of makedev and
friends, which only honors the lower 32-bit of the dev_t.
this commit makes zfs report fsid with the high 32-bit zeros
to avoid the issues in such applications. namely, this fixes an
issue with rsync, reported by HIROSE yuuji on a japanese ML [1]
in 2024. you can find his reproduce recipe below. i was able to
reproduce the issue with rsync-3.4.1 from pkgsrc.
maybe we can "fix" our, at least userland-visible version of,
makedev and friends to provide full 64-bit round-trip as some
of other platforms do. (eg. glibc, freebsd)

although it might be an improvement and can benefit other things
like nfs v3, it isn't an alternative to this fix because it
doesn't fix existing application binaries built with the current
version of the macros.

note: this commit also changes statvfs f_fsid. as f_fsid is a long,
before this change, we were truncating the value only on 32-bit ports.
note: this commit doesn't change the "netbsd-extended" fsid
(f_fsidx), which is used for nfs file handles.

note: this commit would cause a flag day for applications which
somehow save st_dev of files. are there such applications?

note: this commit would increase the chance of fsid conflicts.
currently zfs ensures its fsids unique within zfs, but not with
other netbsd file systems. with this commit, there can be conflict
even within zfs. (mentioned in PR/60135)
```
rm -rf src
rm -rf dest
mkdir -p src/a/b/c
mkdir -p src/1/2/3
mkdir dest
rsync -avx --delete src dest
rm -r src/1
rsync -avx --delete src dest
test -d dest/src/1 && echo "this directory should have been removed"
```
[1] http://www.re.soum.co.jp/~jun/welcome.html#netbsd
related to PR/60135


zfs: port a fix for data corruption issue from illumos
see https://www.illumos.org/issues/17734

note: i didn't bother to patch illumos/freebsd code in our tree.
the original commit message:
commit f6559a18843abdfa5849b9e74f239f9bd15796d3
Author: Andy Fiddaman <illumos%fiddaman.net@localhost>
Date: Mon Nov 10 22:52:05 2025 +0000
17734 ZFS fsync can trigger ZIL transaction reordering and data corruption
Portions contributed by: Alexander Motin <mav%FreeBSD.org@localhost>
Reviewed by: Ryan Zezeski <ryan%zinascii.com@localhost>
Reviewed by: Toomas Soome <tsoome%me.com@localhost>
Approved by: Dan McDonald <danmcd%edgecast.io@localhost>

a review request on tech-kern:
https://mail-index.netbsd.org/tech-kern/2026/03/04/msg030862.html
 1.23 22-Jun-2019  hannken Sync with upstream r315983.

FreeBSD splits "zfs_context.h" into:
"lib/libzpool/common/sys/zfs_context.h" for user space
"uts/common/fs/zfs/sys/zfs_context.h" for kernel space

Do the same here, move and sync "sys/sys/zfs_context.h" to
"dist/lib/libzpool/common/sys/zfs_context.h" and
"dist/uts/common/fs/zfs/sys/zfs_context.h".

Change "Makefile.zfs" to search includes from "dist/lib"
before "dist/uts" so we get the right include file.

Adapt "usr.sbin/fstyp/Makefile" to get the right include file.
 1.22 17-Jun-2019  hannken Unmap pages when zfs_rezget() re-establishes a znode with its dbufs.
 1.21 07-May-2019  hannken This implementation of Solaris taskq API is incomplete and doesn't track
Solaris upstream. FreeBSD already replaced it with a glue to their
taskqueue API.

Replace it with a glue component that queues Solaris taskq requests to
threadpool jobs.
 1.20 15-Nov-2018  riastradh Use callout_halt, not callout_stop, for FreeBSD callout_drain shim.

Callers expect callout_drain will wait for it to complete if it has
fired.
 1.19 28-May-2018  chs branches: 1.19.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.18 10-Jan-2017  christos branches: 1.18.12;
fix a few warnings.
 1.17 07-Jan-2017  christos PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
 1.16 28-Mar-2014  ozaki-r branches: 1.16.8;
Add missing 3rd argument of nicenum
 1.15 21-Jun-2013  christos rename delay to xdelay to avoid conflicts.
 1.14 02-Jan-2013  dsl I've NFI why this code has userspace stuff playing with 'struct proc *'
nor why it uses &p0 as a magic constant (rather than NULL).
Re-instate the definition of p0, but enable the 'fake' definition
of 'struct proc' if the relevant part of sys/proc.h seems to have
been #if'ed away.
Should fix the build.
 1.13 02-Jan-2013  dsl Replace alloca(256) with an array.
The code ended up using alloca() from libc - which 'just can't work' (tm).
It is also pointless!
 1.12 21-Nov-2011  christos branches: 1.12.6;
make this compile again. VOP_CLOSE is really vn_close() through macros.
 1.11 21-Nov-2011  christos correct declaration of vn_close()
XXX: Should all those dup declarations be here?
 1.10 17-Jul-2011  joerg branches: 1.10.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.9 28-Dec-2010  haad Define vn_getattr in zfs_context.h.
 1.8 28-Dec-2010  haad Fix problem where vnode vp_size was not updated when vndoe was already allocated,
for vdev. This makes ztest survive ztest_vdev_LUN_growth test. Replace dummy
VOP_GETATTR with vn_getattr routine which reset vp_size and vattr_size accordingly
to reality.
 1.7 14-Dec-2010  haad Remove now unneeded print_timestamp.
 1.6 28-Feb-2010  haad Add NetBSD build glue to build new zfs version 22 sources.
 1.5 12-Oct-2009  haad Finaly fix ptob problem. ptob was defined for amd64 and not for i386, and
NetBSD version of ptob is not compatible with Solaris one.
 1.4 11-Oct-2009  haad Define ptob only if it wasn't defined already in NetBSD headers.
 1.3 11-Oct-2009  haad undef ptob if it was already defined/included in some NetBSD header file.
 1.2 07-Oct-2009  haad Use ptob function from zfs and not NetBSD one.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.10.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.2.1 23-Jan-2013  yamt sync with head
 1.12.6.3 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.6.2 23-Jun-2013  tls resync from head
 1.12.6.1 25-Feb-2013  tls resync with head
 1.16.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.18.12.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.18.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.19.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.19.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 24-Jul-2019  hannken Remove unneeded includes.
 1.1 07-Aug-2009  haad branches: 1.1.46;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.46.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 21-Feb-2010  darran branches: 1.3.44;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.2 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3 25-Mar-2014  ozaki-r Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.
 1.2 21-Feb-2010  darran branches: 1.2.6; 1.2.12;
Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 23-Jan-2016  christos Define _KERNTYPES for things that need it.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.12 18-Sep-2025  mrg introduce a couple of new turn-off-gcc-warning variables and use them.

GCC 14 has a new annoying calloc() checker that we turn off in a bunch
of places, and there are a few more dangling-pointer issuse that come up,
but seem bogus.
 1.11 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.10 13-Apr-2021  mrg ignore a "should be impossible" uninitialised variable error.
 1.9 09-Feb-2020  fox external/cddl/osnet: Suppress -Werror=stringop-truncation error.

Add GCC_NO_STRINGOP_TRUNCATION dwarf.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
 1.8 28-May-2018  chs branches: 1.8.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.7 04-Feb-2016  roy branches: 1.7.14;
Disable -Wformat-nonliteral here to build.
 1.6 09-Mar-2014  christos Tidy up paths.
 1.5 09-Mar-2014  christos use merged ctf rules
 1.4 18-Jan-2013  christos add man pages
 1.3 21-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: fix a problem with library references for libctf and libdtrace.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.7.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.8.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 20-Jan-2013  wiz branches: 1.3.2; 1.3.6; 1.3.32;
Put optional args before non-optional ones.
 1.2 19-Jan-2013  wiz Sort options in SYNOPSIS and text.
XXX: please check if SYNOPSIS are correct, I think they missing some .Op.
 1.1 18-Jan-2013  christos add man pages
 1.3.32.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3.6.2 25-Feb-2013  tls resync with head
 1.3.6.1 20-Jan-2013  tls file ctfconvert.1 was added on branch tls-maxphys on 2013-02-25 00:26:47 +0000
 1.3.2.2 23-Jan-2013  yamt sync with head
 1.3.2.1 20-Jan-2013  yamt file ctfconvert.1 was added on branch yamt-pagecache on 2013-01-23 00:04:40 +0000
 1.10 12-Apr-2025  rin tools: Add ctfdump(1) when MKCTF is enabled

Although this is not required for build, this small (only with three
additional source files) tool provides good diagnostics.

Especially useful on non-BSD hosts.

Tested on Ubuntu/amd64 24.04 and macOS 13.7 in addition to NetBSD.
 1.9 28-May-2018  chs branches: 1.9.12; 1.9.14;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.8 04-Feb-2016  roy branches: 1.8.14;
Fix build.
 1.7 28-Apr-2014  christos need bsd.own.mk
 1.6 09-Mar-2014  christos branches: 1.6.2;
Tidy up paths.
 1.5 09-Mar-2014  christos use merged ctf rules
 1.4 18-Jan-2013  christos add man pages
 1.3 03-Apr-2010  christos branches: 1.3.6; 1.3.12;
relative .PATH
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.6.2.1 10-Aug-2014  tls Rebase.
 1.8.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.14.1 02-Aug-2025  perseant Sync with HEAD
 1.9.12.1 14-Apr-2025  martin Pull up following revision(s) (requested by rin in ticket #1096):

tools/what/Makefile: revision 1.1
external/cddl/osnet/usr.bin/ctfdump/Makefile: revision 1.10
tools/ctfmerge/Makefile: revision 1.13
tools/Makefile: revision 1.228
tools/Makefile: revision 1.229
tools/Makefile.ctftools: revision 1.1
usr.bin/what/what.c: revision 1.16
tools/Makefile: revision 1.230
tools/ctfconvert/Makefile: revision 1.12
tools/ctfdump/Makefile: revision 1.1
external/cddl/osnet/dist/tools/ctf/dump/dump.c: revision 1.3
external/cddl/osnet/dist/tools/ctf/common/utils.c: revision 1.2
(all via patch)

tools: Factor out Makefile.ctftools from ctf{convert,merge}

This adds missing libelf.a dependency to ctfmerge. Otherwise NFC.
tools: Add ctfdump(1) when MKCTF is enabled

Although this is not required for build, this small (only with three
additional source files) tool provides good diagnostics.

Especially useful on non-BSD hosts.
Tested on Ubuntu/amd64 24.04 and macOS 13.7 in addition to NetBSD.

tools: Add what(1); not mandatory, but provides good diagnostics

tools/Makefile: Add missing `\` for previous
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 19-Jan-2013  wiz branches: 1.2.2; 1.2.6; 1.2.32;
Sort options in SYNOPSIS and text.
XXX: please check if SYNOPSIS are correct, I think they missing some .Op.
 1.1 18-Jan-2013  christos add man pages
 1.2.32.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.6.2 25-Feb-2013  tls resync with head
 1.2.6.1 19-Jan-2013  tls file ctfdump.1 was added on branch tls-maxphys on 2013-02-25 00:26:47 +0000
 1.2.2.2 23-Jan-2013  yamt sync with head
 1.2.2.1 19-Jan-2013  yamt file ctfdump.1 was added on branch yamt-pagecache on 2013-01-23 00:04:40 +0000
 1.12 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.11 07-Jun-2020  fox external/cddl/osnet: Suppress -Werror=stringop-truncation error

This logic correctly uses strncpy(3) to fully initialize a fixed-width field, and also ensures
NUL-termination on the next line as other users of the field expect.

Add -Werror=stringop-truncation to prevent build failure, when run with MKSANITIZER=yes.

Error was reported when build.sh was run with MKSANITIZER=yes flag.

Reviewed by: kamil@
 1.10 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.9 04-Feb-2016  roy branches: 1.9.14;
Disable -Wformat-nonliteral here to build.
 1.8 27-Jan-2016  christos don't link/depend on libpthread if we are a hostprog.
XXX: should be using -pthread instead?
 1.7 29-Sep-2015  christos no other ctf program needs -lrt, why does this one?
 1.6 09-Mar-2014  christos Tidy up paths.
 1.5 09-Mar-2014  christos use merged ctf rules
 1.4 18-Jan-2013  christos add man pages
 1.3 21-Feb-2010  darran branches: 1.3.6; 1.3.12;
DTrace: fix a problem with library references for libctf and libdtrace.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.3.12.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.9.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.5 04-May-2024  uwe ctfmerge(1): brush up markup
 1.4 04-May-2024  christos Document environment variable use.
 1.3 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.2 19-Jan-2013  wiz branches: 1.2.2; 1.2.6; 1.2.32;
Sort options in SYNOPSIS and text.
XXX: please check if SYNOPSIS are correct, I think they missing some .Op.
 1.1 18-Jan-2013  christos add man pages
 1.2.32.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.6.2 25-Feb-2013  tls resync with head
 1.2.6.1 19-Jan-2013  tls file ctfmerge.1 was added on branch tls-maxphys on 2013-02-25 00:26:48 +0000
 1.2.2.2 23-Jan-2013  yamt sync with head
 1.2.2.1 19-Jan-2013  yamt file ctfmerge.1 was added on branch yamt-pagecache on 2013-01-23 00:04:40 +0000
 1.4 08-Dec-2018  sevan Include ztest(1) in builds.
 1.3 30-Oct-2014  justin branches: 1.3.14; 1.3.16;
Add libraries in order that they will link if static as well as dynamic
 1.2 16-Sep-2009  haad Remove bogus -L entry.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.16.1 10-Jun-2019  christos Sync with HEAD
 1.3.14.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.4 10-Dec-2018  sevan branches: 1.4.2; 1.4.4;
Describe how unaccounted changes are detected without Star Trek references, for
everyone in 2018.

Thanks to maya & gdt
 1.3 08-Dec-2018  sevan Spelling
 1.2 08-Dec-2018  wiz Improve man page.
 1.1 08-Dec-2018  sevan Add a draft manual for ztest(1), based on the comments from zfstest.c (WIP).
 1.4.4.2 10-Jun-2019  christos Sync with HEAD
 1.4.4.1 10-Dec-2018  christos file ztest.1 was added on branch phil-wifi on 2019-06-10 21:52:04 +0000
 1.4.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.4.2.1 10-Dec-2018  pgoyette file ztest.1 was added on branch pgoyette-compat on 2018-12-26 14:01:18 +0000
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.2 23-Jan-2016  christos Define _KERNTYPES for things that need it.
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.15 27-Mar-2021  simonb Use LDADD/DPADD instead of PROGDPLIBS - we are linking against installed
libraries.

Use compat/exec.mk - dtrace isn't compat32 friendly (yet?).
 1.14 04-Apr-2020  christos Add libproc
 1.13 29-Jun-2018  kamil Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build

Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
 1.12 07-Jun-2018  kamil branches: 1.12.2;
Replace HAVE_GCC with ACTIVE_CC == gcc checks

Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
 1.11 06-Jun-2018  kamil Make cddl/osnet/usr.sbin/dtrace -W compatible with MKLLVM=yes

Clang/LLVM does not recognize:
- -Wno-discarded-qualifiers
- -Wno-unused-but-set-variable

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
 1.10 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.9 05-Feb-2016  roy branches: 1.9.14;
Fix the actual issue rather than silencing the warning.

Thanks to gson@
 1.8 04-Feb-2016  roy Add -Wno-format-nonliteral
 1.7 04-Feb-2016  roy dtrace needs Wno-format-security for clang it seems.
 1.6 24-Sep-2015  christos Add build stuff.
 1.5 12-Jan-2014  riz Disable the extra-args warning for printf formats in dtrace.c
 1.4 22-Feb-2010  tron branches: 1.4.6; 1.4.12;
Disable stack protection warnings for "dtrace.c" which uses alloca(3).
 1.3 21-Feb-2010  darran DTrace: fix a problem with library references for libctf and libdtrace.
 1.2 21-Feb-2010  darran Apply NetBSD changes to DTrace.

Ok with core@.
 1.1 21-Feb-2010  darran Add the FreeBSD 8-RC1 changes for DTrace.

Ok with core@.
 1.4.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.9.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.12.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.12.2.1 10-Jun-2019  christos Sync with HEAD
 1.4 28-May-2018  chs merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.3 24-Feb-2010  tron branches: 1.3.44;
Disable stack protection warnings for "zdb_il.c" which uses a dynamically
sized array on the stack.
 1.2 21-Oct-2009  joerg zdb(8) uses tbl
 1.1 07-Aug-2009  haad Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.3.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.3 24-Jun-2019  hannken Sync with upstream r315983.

Move files originating from upstream below "dist/":

OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
include/libintl.h -> dist/head/libintl.h
include/stdio_ext.h -> dist/head/stdio_ext.h
include/thread.h -> dist/head/thread.h
sys/kern/callb.c -> dist/uts/common/os/callb.c
sys/kern/fm.c -> dist/uts/common/os/fm.c
sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
sys/sys/procset.h -> dist/uts/common/sys/procset.h
sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
 1.2 28-May-2018  chs branches: 1.2.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.1 07-Aug-2009  haad branches: 1.1.44;
Add NetBSD Solaris compat code and reachover Makefiles. Most of code written
by Andrew Doran some of it by me.

This is still work in progress code. There are known issues. Zfs can panic
your system still. I will commit integration bits and needed kernel bits
later when we fix most obvious bugs. This code need some support from our
kernel which I will commit in a separate patch and therefore itnot work yet.

Issues:

1) Support for openat/fstatat syscalls.
2) getnewvnode locking against myself panic when reclaiming vnodes
3) Replace solaris taskq with our workqueue which doesn't need to alloc
anything during work.
4) Investigate problems with NO_WAIT allocations.

Oked by core@ and ad@.
 1.1.44.1 25-Jun-2018  pgoyette Sync with HEAD
 1.2.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411

RSS XML Feed