aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorYuri Pankov <yuripv@FreeBSD.org>2023-07-17 09:12:53 +0000
committerYuri Pankov <yuripv@FreeBSD.org>2023-07-18 09:20:11 +0000
commitb36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d (patch)
treeec822ff72b1ca878c04b87155c253ed0298d5ee4 /sys
parent239597e0309d4d8e84c35929513aa4a2470735ad (diff)
zfs: set autotrim default to 'off'
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'). PR: 264234 Reviewed by: mav (zfs) Differential Revision: https://reviews.freebsd.org/D41056
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/kern.pre.mk3
-rw-r--r--sys/contrib/openzfs/include/sys/spa.h6
-rw-r--r--sys/contrib/openzfs/module/zcommon/zpool_prop.c2
-rw-r--r--sys/modules/zfs/Makefile2
4 files changed, 3 insertions, 10 deletions
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index e401a652bf97..8314f4489ca8 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -252,8 +252,7 @@ CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC}
# Special flags for managing the compat compiles for ZFS
ZFS_CFLAGS+= -I$S/contrib/openzfs/module/icp/include \
${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \
- -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \
- -DIN_FREEBSD_BASE
+ -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP
.if ${MACHINE_ARCH} == "amd64"
ZFS_CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \
diff --git a/sys/contrib/openzfs/include/sys/spa.h b/sys/contrib/openzfs/include/sys/spa.h
index 1fa2044008dc..b90855687411 100644
--- a/sys/contrib/openzfs/include/sys/spa.h
+++ b/sys/contrib/openzfs/include/sys/spa.h
@@ -723,16 +723,10 @@ 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,
-#ifdef IN_FREEBSD_BASE
- SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_ON,
-#else
- SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_OFF,
-#endif
} spa_autotrim_t;
/*
diff --git a/sys/contrib/openzfs/module/zcommon/zpool_prop.c b/sys/contrib/openzfs/module/zcommon/zpool_prop.c
index 459ff62fc996..c4aca04a96bd 100644
--- a/sys/contrib/openzfs/module/zcommon/zpool_prop.c
+++ b/sys/contrib/openzfs/module/zcommon/zpool_prop.c
@@ -160,7 +160,7 @@ zpool_prop_init(void)
"wait | continue | panic", "FAILMODE", failuremode_table,
sfeatures);
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);
/* hidden properties */
diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
index 2cfdf06f8f01..8964e461cdd2 100644
--- a/sys/modules/zfs/Makefile
+++ b/sys/modules/zfs/Makefile
@@ -38,7 +38,7 @@ CFLAGS+= -I${.CURDIR}
CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \
-DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \
- -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE
+ -D_SYS_VMEM_H_
.if ${MACHINE_ARCH} == "amd64"
CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \