diff options
author | smh <smh@FreeBSD.org> | 2014-10-10 00:51:23 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2014-10-10 00:51:23 +0000 |
commit | 303356caa9a2204687c43e218ab0b0b090dfd1fe (patch) | |
tree | d1a4ee4f46f0e25437b2a5cbccf61cfb7459ac02 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c | |
parent | b231fd93a03f657a6d040dba44bd29ab6d5fc224 (diff) | |
download | FreeBSD-src-303356caa9a2204687c43e218ab0b0b090dfd1fe.zip FreeBSD-src-303356caa9a2204687c43e218ab0b0b090dfd1fe.tar.gz |
MFC r271589:
Added missing ZFS sysctls
This also includes small additional direct changes as it still uses the old
way of handling tunables.
Sponsored by: Multiplay
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c index a06518e..6c07fe3 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c @@ -148,8 +148,10 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN, "The absolute cap on dirty_data_max when auto calculating"); TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent); -SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN, - &zfs_dirty_data_max_percent, 0, +static int sysctl_zfs_dirty_data_max_percent(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vfs_zfs, OID_AUTO, dirty_data_max_percent, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), + sysctl_zfs_dirty_data_max_percent, "I", "The percent of physical memory used to auto calculate dirty_data_max"); TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync); @@ -172,6 +174,24 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, delay_scale, "Controls how quickly the delay approaches infinity"); static int +sysctl_zfs_dirty_data_max_percent(SYSCTL_HANDLER_ARGS) +{ + int val, err; + + val = zfs_dirty_data_max_percent; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < 0 || val > 100) + return (EINVAL); + + zfs_dirty_data_max_percent = val; + + return (0); +} + +static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS) { int val, err; |