summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-08-18 09:52:30 -0700
committerGitHub <[email protected]>2020-08-18 09:52:30 -0700
commit5e7eaf8fbda348db9878ce013ecb4ab5e9b5cf5a (patch)
treeb8c71233ba009a68f6ab8fff6d9c9a2b584357fa /include
parent009cc8e884a84aeebed612ab64c30f77eab38392 (diff)
Add define to enable autotrim to default to on
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. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10719
Diffstat (limited to 'include')
-rw-r--r--include/sys/spa.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h
index f0f77cd85..67de57980 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -733,10 +733,16 @@ 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.
*/
typedef enum {
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;
/*