summaryrefslogtreecommitdiff
path: root/external/cddl
AgeCommit message (Collapse)Author
2023-06-03adapt to ${CC_WNO_MAYBE_UNINITIALIZED}lukem
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.
2023-06-03bsd.own.mk: rename GCC_NO_* to CC_WNO_*lukem
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.
2023-05-25osnet: on macOS, use <mach/boolean.h> for boolean_tlukem
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...
2023-05-25ctfmerge: fix macOS semaphore implementation, part 2lukem
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.
2023-05-23ctfmerge: fix macOS semaphore implementationlukem
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.
2023-05-23ctfmerge: error check sem_*() and pthread_*() APIslukem
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
2023-05-22dtrace_fbt: Read and write instructions appropriately-endian on arm.riastradh
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
2023-05-09dtrace_fbt: Read and write instruction words in little-endian.riastradh
Step toward making this work on aarch64eb.
2023-04-17(missed in pervious commit)skrll
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.
2023-04-12kern: Nix mutex_owner.riastradh
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
2023-03-03Adapt zfs_netbsd_access() to ACL support. As ZFS itself onlyhannken
handles VREAD, VWRITE, VEXEC and VAPPEND we use kauth_authorize_vnode() to handle VADMIN. From FreeBSD.
2023-02-17provide pathconf for .zfs control directory. avoids errors onkardel
ls -l ../.zfs.
2023-02-07dtrace: remove unnecessary fflush()chs
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
2023-02-06dtrace: re-fix aggregations to report from all online CPUschs
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.
2022-12-25Don't bail out if the input file does not have a symbol table. This happenschristos
with crtn.o which used to have an empty symbol table with binutils 2.34, with binutils 2.39 has no symbol table.
2022-11-04Add a helper to set or clear lower mount and use it.hannken
Always add a reference to the lower mount. Ride 9.99.105
2022-10-31Provide an empty ASSERT macro ifdef _STANDALONE.simonb
2022-10-31Whitespace nit.simonb
2022-10-31Only need TIMESPEC_OVERFLOW() to check against INT32_{MIN,MAX} on FreeBSD.simonb
2022-10-24Remove references to GEOM from zpool(8).nia
2022-10-03Revert. Spotted by hannken@ - fix needs to be in zfs_ctldir.c it is missingkardel
VOP_PATHCONF.
2022-09-27for unsupported names return EINVAL as per TOGkardel
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fpathconf.html discussed with christos@
2022-09-19Reference kernel-wide hz constant instead of using a private but possiblymlelstv
different value.
2022-09-02dtrace_fbt: Allow tracing names that start with `__'.riastradh
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.
2022-08-31dtrace_sdt: Fix bug in builtin module reference counting.riastradh
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.
2022-08-21dtrace/i386: Need machine/cpufunc.h for x86_read_flags and rcr2.riastradh
2022-08-07bsd.kmodule.mk: Build modules with KDTRACE_HOOKS if MKDTRACE=yes.riastradh
2022-08-07dtrace_sdt: Register sdt providers and probes in loaded modules too.riastradh
2022-08-03change the ARC reclaim code to use the pagedaemon's free page targetchs
rather than having a separate target.
2022-07-30solaris: Give threads less bad names.riastradh
2022-07-30osnet: Stop disabling dtrace probes.riastradh
2022-07-30zfs: Give condvars more meaningful names.riastradh
These will be truncated to 16 characters, but hey, better'n `zfscv'.
2022-05-04fix ARC checks for available memory:chs
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.
2022-05-03Minor: fix a typo.jkoshy
2022-05-02Follow FreeBSD revision <0e15d9fbeba4> and simplify #ifdef'ed code.jkoshy
This change avoids redefining 'SHN_SUNW_IGNORE' if the symbol is already present.
2022-04-16Unlock vnode for VOP_IOCTL().hannken
2022-03-30Add link our policy.christos
2022-03-28driver(9): devsw_detach never fails. Make it return void.riastradh
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
2022-03-27add a kauth vnode check for adding linkschristos
2022-03-18osnet: Delete dead #if 0 code using hardclock_ticks.riastradh
2022-02-27lockstat(4): KNF. No functional change intended.riastradh
2022-02-27lockstat(4): Membar audit.riastradh
- 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.
2021-12-28zfs: Expose hostid to zfs, as in gethostid/sethostid(3).riastradh
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'.
2021-12-22In zfs_setattr() don't recheck the auth policy for a "nodump" flagssimonb
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.
2021-12-21Default files to BSD group ownership in line with ffs, after the leadhauke
of FreeBSD <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=139076> (patch by hannken@)
2021-12-17In vattr_init_mask() check for va_flags and if set add to the mask ofsimonb
to the things that setattr is interested in. Fixes chflags(2) on ZFS. Thanks riastradh@ for fix.
2021-11-30In zfs_statvfs(), set f_bresvd and f_fresvd to 0. Fixes random kernelsimonb
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().
2021-10-27Hacks to get zdb working on NetBSD:simonb
- 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@.
2021-10-20Overhaul of the EVFILT_VNODE kevent(2) filter:thorpej
- 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.
2021-09-06Clamp zfs nlinks at UINT32_MAX (nlink_t max) instead of (much) smallersimonb
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.