This allows libzfs to pick up correct default value for autotrim property.
Details
- Reviewers
imp mm - Group Reviewers
ZFS - Commits
- rGd2a45e9e817a: openzfs: use IN_BASE instead of IN_FREEBSD_BASE in spa.h
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Yea, we should change spa.h, honestly, rather than this stupid #define. There's already enough stupid, non-idempotent hacks in ZFS integration, and it would be better to fix this instance the right way. You've also missed the need for this in stand...
git diff diff --git a/sys/contrib/openzfs/include/sys/spa.h b/sys/contrib/openzfs/include/sys/spa.h index b96a9ef1d42f..a45d15ee423f 100644 --- a/sys/contrib/openzfs/include/sys/spa.h +++ b/sys/contrib/openzfs/include/sys/spa.h @@ -723,12 +723,12 @@ typedef enum spa_mode { * Send TRIM commands in-line during normal pool operation while deleting. * OFF: no * ON: yes - * NB: IN_FREEBSD_BASE is defined within the FreeBSD sources. + * NB: IN_BASE is defined within the FreeBSD sources. */ typedef enum { SPA_AUTOTRIM_OFF = 0, /* default */ SPA_AUTOTRIM_ON, -#ifdef IN_FREEBSD_BASE +#ifdef IN_BASE SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_ON, #else SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_OFF,
I *guess* it was done this way as it's the only FreeBSD-specific part in the "common" code, and everything using IN_BASE is located under sys/contrib/openzfs/lib/libzfs/os/freebsd and sys/contrib/openzfs/include/os/freebsd proper.
re: stand, I don't see a call to zpool_prop_init() in there anywhere, zpool_prop.c does not seem to be compiled as well; am I missing something obvious?
Sadly, I had to revert this, with all these defines being ambiguously named I missed the fact that IN_BASE is only used in FreeBSD-specific code to signify userland/kernel differences, while IN_FREEBSD_BASE really means FreeBSD-specific code inside the common code. Will need to think more about proper approach (and naming?) here.