FreeBSD Bugzilla – Attachment 129158 Details for
Bug 173116
Add sysctl to enable / disable ZFS device full trim on init (patch included)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
file.txt
file.txt (text/plain), 1.20 KB, created by
Steven Hartland
on 2012-10-26 09:50:02 UTC
(
hide
)
Description:
file.txt
Filename:
MIME Type:
Creator:
Steven Hartland
Created:
2012-10-26 09:50:02 UTC
Size:
1.20 KB
patch
obsolete
>Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on >initialisation to be enabled (1) / disabled (0) defaults to enabled. > >This is useful for devices which have a slow trim speed and are either >new or have otherwise already been wiped e.g. secure erase. >--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c.orig 2012-10-25 19:30:49.281472955 +0000 >+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c 2012-10-25 19:45:31.538099840 +0000 >@@ -144,6 +144,11 @@ > #include <sys/trim_map.h> > #include <sys/fs/zfs.h> > >+boolean_t vdev_trim_on_init = B_TRUE; >+SYSCTL_DECL(_vfs_zfs_vdev); >+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, >+ &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisation"); >+ > /* > * Basic routines to read and write from a vdev label. > * Used throughout the rest of this file. >@@ -699,7 +704,7 @@ > * Don't TRIM if removing so that we don't interfere with zpool > * disaster recovery. > */ >- if (!zfs_notrim && (reason == VDEV_LABEL_CREATE || >+ if (!zfs_notrim && 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));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 173116
: 129158