diff options
author | Ryan Moeller <[email protected]> | 2020-07-19 13:15:34 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-19 10:15:34 -0700 |
commit | 0421f257b20f41e33fb69e067b47beed2c5bd3bd (patch) | |
tree | f27fec7d19bc690edcb3940922b907be5498db70 /module/os | |
parent | ceadc0dbbd5594db153a61c3d82a6d98e1adca7d (diff) |
FreeBSD: Add legacy arc_min and arc_max
These tunables were renamed from vfs.zfs.arc_min and
vfs.zfs.arc_max to vfs.zfs.arc.min and vfs.zfs.arc.max.
Add legacy compat tunables for the old names.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10579
Diffstat (limited to 'module/os')
-rw-r--r-- | module/os/freebsd/zfs/sysctl_os.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/module/os/freebsd/zfs/sysctl_os.c b/module/os/freebsd/zfs/sysctl_os.c index 54b62f248..64f39f9fc 100644 --- a/module/os/freebsd/zfs/sysctl_os.c +++ b/module/os/freebsd/zfs/sysctl_os.c @@ -264,6 +264,42 @@ sysctl_vfs_zfs_arc_no_grow_shift(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_no_grow_shift, CTLTYPE_U32 | CTLFLAG_RWTUN, 0, sizeof (uint32_t), sysctl_vfs_zfs_arc_no_grow_shift, "U", "log2(fraction of ARC which must be free to allow growing)"); + +int +param_set_arc_long(SYSCTL_HANDLER_ARGS) +{ + int err; + + err = sysctl_handle_long(oidp, arg1, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + arc_tuning_update(B_TRUE); + + return (0); +} + +int +param_set_arc_int(SYSCTL_HANDLER_ARGS) +{ + int err; + + err = sysctl_handle_int(oidp, arg1, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + arc_tuning_update(B_TRUE); + + return (0); +} + +SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_min, CTLTYPE_ULONG | CTLFLAG_RWTUN, + &zfs_arc_min, sizeof (zfs_arc_min), param_set_arc_long, "LU", + "min arc size (LEGACY)"); +SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_max, CTLTYPE_ULONG | CTLFLAG_RWTUN, + &zfs_arc_max, sizeof (zfs_arc_max), param_set_arc_long, "LU", + "max arc size (LEGACY)"); + /* dbuf.c */ @@ -643,35 +679,6 @@ SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, use_uma, CTLFLAG_RDTUN, &zio_use_uma, 0, SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata, CTLFLAG_RDTUN, &zio_exclude_metadata, 0, "Exclude metadata buffers from dumps as well"); - -int -param_set_arc_long(SYSCTL_HANDLER_ARGS) -{ - int err; - - err = sysctl_handle_long(oidp, arg1, 0, req); - if (err != 0 || req->newptr == NULL) - return (err); - - arc_tuning_update(B_TRUE); - - return (0); -} - -int -param_set_arc_int(SYSCTL_HANDLER_ARGS) -{ - int err; - - err = sysctl_handle_int(oidp, arg1, 0, req); - if (err != 0 || req->newptr == NULL) - return (err); - - arc_tuning_update(B_TRUE); - - return (0); -} - int param_set_slop_shift(SYSCTL_HANDLER_ARGS) { |