Skip to content

Commit

Permalink
spa.h: use IN_BASE instead of IN_FREEBSD_BASE
Browse files Browse the repository at this point in the history
Consistently get the proper default value for autotrim.

Currently, only the kernel module is built with IN_FREEBSD_BASE,
and libzfs get the wrong default value, leading to confusion and
incorrect output when autotrim value was not set explicitly.

Reviewed-by: Warner Losh <[email protected]>
Signed-off-by: Yuri Pankov <[email protected]>
Closes openzfs#15016
  • Loading branch information
Yuri Pankov authored Jun 29, 2023
1 parent 62ace21 commit 77a3bb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/sys/spa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 77a3bb1

Please sign in to comment.