HomeFreeBSD

Use linux __KERNEL__ define

Description

Use linux KERNEL define

Previously the project contained who zfs_context.h files,
one for user space builds and one for kernel space builds.
It was the responsibility of the source including the file
to ensure the right one was included based on the order of
the include paths.

This was the way it was done in OpenSolaris but for our
purposes I felt it was overly obscure. The user and kernel
zfs_context.h files have been combined in to a single file
and a #define determines if you get the user or kernel
context.

The issue here was that I used the _KERNEL macro which is
defined as part of the spl which will only be defined for
most builds after you include the right zfs_context. It is
safer to use the KERNEL macro which is automatically
defined as part of the kernel build process and passed as
a command line compiler option. It will always be defined
if your building in the kernel and never for user space.

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Sep 10 2010, 4:36 PM
Parents
rG8ec8000f95d6: Fix "format not a string literal" warning
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGe37e1d3040ed: Use linux __KERNEL__ define (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Sep 10 2010, 4:36 PM