diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 59b17132f..977ba02c1 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -101,7 +101,7 @@ zdb_ot_name(dmu_object_type_t type) extern int reference_tracking_enable; extern int zfs_recover; -extern uint64_t zfs_arc_min, zfs_arc_max, zfs_arc_meta_min, zfs_arc_meta_limit; +extern unsigned long zfs_arc_meta_min, zfs_arc_meta_limit; extern int zfs_vdev_async_read_max_active; extern boolean_t spa_load_verify_dryrun; extern int zfs_reconstruct_indirect_combinations_max; diff --git a/include/sys/arc_impl.h b/include/sys/arc_impl.h index 096a9d85c..e43cf57d8 100644 --- a/include/sys/arc_impl.h +++ b/include/sys/arc_impl.h @@ -889,6 +889,8 @@ extern arc_state_t *arc_mfu; extern arc_state_t *arc_mru; extern uint_t zfs_arc_pc_percent; extern int arc_lotsfree_percent; +extern unsigned long zfs_arc_min; +extern unsigned long zfs_arc_max; extern void arc_reduce_target_size(int64_t to_free); extern boolean_t arc_reclaim_needed(void); 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) {