HomeFreeBSD

stand: Work around upstream issues in the standalone environment

Description

stand: Work around upstream issues in the standalone environment

There's a number of issues with including zfs_context.h from a
standalone environment. First, sys/uio_imp.h isn't at all safe for this
environment, so define its guard #defines so that its contents are
skipped. Next, there's a problem including string.h to get the mem*
routines, so just define them here. ZFS_MODULE_PARAM_ARGS isn't defined
properly. I had wanted to define it when I was upstreaming changes to
include/os/freebsd/spl/sys/zfs_context.h, but they ran into resistance
so I'm defining that here now (it is also defined in zstd_shim.c, but
that will disappear once the issues it works around are
cleared). Finally, sys/sysmacros.h has to be included now before
sys/atomic.h, but upstream includes it after so include it here so that
the guards make the out-of-order includes in upstream irrelevant.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D35750

(cherry picked from commit faf25f48d601ae39f5752602f3020e2e92605625)

Details

Provenance
impAuthored on Jul 8 2022, 11:34 PM
Reviewer
kevans
Parents
rGf05568d2cae6: stand: For ZFS build, add new directory
Branches
Unknown
Tags
Unknown