set autotrim default to 'off' everywhere

As it turns out having autotrim default to 'on' on FreeBSD never really
worked due to mess with defines where userland and kernel module were
getting different default values (userland was defaulting to 'off',
module was thinking it's 'on').

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Closes #15079
This commit is contained in:
Yuri Pankov 2023-07-20 18:06:55 +02:00 committed by GitHub
parent d3d63cac4d
commit 8beabfd3bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View File

@ -723,16 +723,10 @@ typedef enum spa_mode {
* Send TRIM commands in-line during normal pool operation while deleting. * Send TRIM commands in-line during normal pool operation while deleting.
* OFF: no * OFF: no
* ON: yes * ON: yes
* NB: IN_FREEBSD_BASE is defined within the FreeBSD sources.
*/ */
typedef enum { typedef enum {
SPA_AUTOTRIM_OFF = 0, /* default */ SPA_AUTOTRIM_OFF = 0, /* default */
SPA_AUTOTRIM_ON, SPA_AUTOTRIM_ON,
#ifdef IN_FREEBSD_BASE
SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_ON,
#else
SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_OFF,
#endif
} spa_autotrim_t; } spa_autotrim_t;
/* /*

View File

@ -160,7 +160,7 @@ zpool_prop_init(void)
"wait | continue | panic", "FAILMODE", failuremode_table, "wait | continue | panic", "FAILMODE", failuremode_table,
sfeatures); sfeatures);
zprop_register_index(ZPOOL_PROP_AUTOTRIM, "autotrim", zprop_register_index(ZPOOL_PROP_AUTOTRIM, "autotrim",
SPA_AUTOTRIM_DEFAULT, PROP_DEFAULT, ZFS_TYPE_POOL, SPA_AUTOTRIM_OFF, PROP_DEFAULT, ZFS_TYPE_POOL,
"on | off", "AUTOTRIM", boolean_table, sfeatures); "on | off", "AUTOTRIM", boolean_table, sfeatures);
/* hidden properties */ /* hidden properties */