diff --git a/UPDATING b/UPDATING index 8c404c465669..9c660ab08c97 100644 --- a/UPDATING +++ b/UPDATING @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130426: + The sysctl which controls TRIM support under ZFS has been renamed + from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been + enabled by default. + 20130425: The mergemaster command now uses the default MAKEOBJDIRPREFIX rather than creating it's own in the temporary directory in diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h index d8785eafc0c5..920b1b0b3564 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h @@ -46,7 +46,7 @@ typedef enum vdev_dtl_type { } vdev_dtl_type_t; extern boolean_t zfs_nocacheflush; -extern boolean_t zfs_notrim; +extern boolean_t zfs_trim_enabled; extern int vdev_open(vdev_t *); extern void vdev_open_children(vdev_t *); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c index 250db357bb9b..fd7394a931a2 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c @@ -72,7 +72,7 @@ typedef struct trim_seg { hrtime_t ts_time; /* Segment creation time. */ } trim_seg_t; -extern boolean_t zfs_notrim; +extern boolean_t zfs_trim_enabled; static u_int trim_txg_delay = 32; static u_int trim_timeout = 30; @@ -157,7 +157,7 @@ trim_map_create(vdev_t *vd) ASSERT(vd->vdev_ops->vdev_op_leaf); - if (zfs_notrim) + if (!zfs_trim_enabled) return; tm = kmem_zalloc(sizeof (*tm), KM_SLEEP); @@ -183,7 +183,7 @@ trim_map_destroy(vdev_t *vd) ASSERT(vd->vdev_ops->vdev_op_leaf); - if (zfs_notrim) + if (!zfs_trim_enabled) return; tm = vd->vdev_trimmap; @@ -340,7 +340,7 @@ trim_map_free(vdev_t *vd, uint64_t offset, uint64_t size, uint64_t txg) { trim_map_t *tm = vd->vdev_trimmap; - if (zfs_notrim || vd->vdev_notrim || tm == NULL) + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) return; mutex_enter(&tm->tm_lock); @@ -357,7 +357,7 @@ trim_map_write_start(zio_t *zio) boolean_t left_over, right_over; uint64_t start, end; - if (zfs_notrim || vd->vdev_notrim || tm == NULL) + if (!zfs_trim_enabled || vd->vdev_notrim || tm == NULL) return (B_TRUE); start = zio->io_offset; @@ -404,7 +404,7 @@ trim_map_write_done(zio_t *zio) * Don't check for vdev_notrim, since the write could have * started before vdev_notrim was set. */ - if (zfs_notrim || tm == NULL) + if (!zfs_trim_enabled || tm == NULL) return; mutex_enter(&tm->tm_lock); @@ -589,7 +589,7 @@ void trim_thread_create(spa_t *spa) { - if (zfs_notrim) + if (!zfs_trim_enabled) return; mutex_init(&spa->spa_trim_lock, NULL, MUTEX_DEFAULT, NULL); @@ -604,7 +604,7 @@ void trim_thread_destroy(spa_t *spa) { - if (zfs_notrim) + if (!zfs_trim_enabled) return; if (spa->spa_trim_thread == NULL) return; @@ -627,7 +627,7 @@ void trim_thread_wakeup(spa_t *spa) { - if (zfs_notrim) + if (!zfs_trim_enabled) return; if (spa->spa_trim_thread == NULL) return; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c index c47f793bc294..92ae0ed7f713 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c @@ -729,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason) * Don't TRIM if removing so that we don't interfere with zpool * disaster recovery. */ - if (!zfs_notrim && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || + if (zfs_trim_enabled && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c index 796ad1a4d0f9..7bc0e9bee8ad 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c @@ -83,10 +83,11 @@ boolean_t zfs_nocacheflush = B_FALSE; TUNABLE_INT("vfs.zfs.cache_flush_disable", &zfs_nocacheflush); SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, &zfs_nocacheflush, 0, "Disable cache flush"); -boolean_t zfs_notrim = B_TRUE; -TUNABLE_INT("vfs.zfs.trim_disable", &zfs_notrim); -SYSCTL_INT(_vfs_zfs, OID_AUTO, trim_disable, CTLFLAG_RDTUN, &zfs_notrim, 0, - "Disable trim"); +boolean_t zfs_trim_enabled = B_TRUE; +SYSCTL_DECL(_vfs_zfs_trim); +TUNABLE_INT("vfs.zfs.trim.enabled", &zfs_trim_enabled); +SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 0, + "Enable ZFS TRIM"); static kmem_cache_t *zil_lwb_cache;