Skip to content

Commit

Permalink
Add define to enable autotrim to default to on
Browse files Browse the repository at this point in the history
In FreeBSD trim has defaulted to on for several
years. In order to minimize POLA violations on
import it's important to maintain this default
when importing vendored openzfs in to FreeBSD
base.

Signed-off-by: Matt Macy <[email protected]>
  • Loading branch information
mattmacy committed Aug 15, 2020
1 parent fc34dfb commit cb6037e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion include/sys/spa.h
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,12 @@ typedef enum spa_mode {
*/
typedef enum {
SPA_AUTOTRIM_OFF = 0, /* default */
SPA_AUTOTRIM_ON
SPA_AUTOTRIM_ON,
#ifdef AUTOTRIM_DEFAULT_ON
SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_ON,
#else
SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_OFF,
#endif
} spa_autotrim_t;

/*
Expand Down
2 changes: 1 addition & 1 deletion module/zcommon/zpool_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ zpool_prop_init(void)
ZIO_FAILURE_MODE_WAIT, PROP_DEFAULT, ZFS_TYPE_POOL,
"wait | continue | panic", "FAILMODE", failuremode_table);
zprop_register_index(ZPOOL_PROP_AUTOTRIM, "autotrim",
SPA_AUTOTRIM_OFF, PROP_DEFAULT, ZFS_TYPE_POOL,
SPA_AUTOTRIM_DEFAULT, PROP_DEFAULT, ZFS_TYPE_POOL,
"on | off", "AUTOTRIM", boolean_table);

/* hidden properties */
Expand Down

0 comments on commit cb6037e

Please sign in to comment.