Skip to content

Commit

Permalink
param_set_arc_int used u64 and did nothing
Browse files Browse the repository at this point in the history
Change param_set_arc_int to use U32 as expected, and
actually set the tunable destination when changed.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Dec 6, 2024
1 parent 568161d commit 9947ebd
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions module/os/windows/zfs/sysctl_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,19 @@ sysctl_vfs_zfs_arc_no_grow_shift(ZFS_MODULE_PARAM_ARGS)
int
param_set_arc_u64(ZFS_MODULE_PARAM_ARGS)
{
*ptr = zt->zt_ptr;
uint64_t val;

*len = sizeof (uint64_t);
*type = ZT_TYPE_U64;

if (set == B_FALSE) {
*ptr = zt->zt_ptr;
return (0);
}

val = *(uint64_t *)(*ptr);
*((uint64_t *)zt->zt_ptr) = val;

arc_tuning_update(B_TRUE);

return (0);
Expand All @@ -559,9 +568,18 @@ param_set_arc_u64(ZFS_MODULE_PARAM_ARGS)
int
param_set_arc_int(ZFS_MODULE_PARAM_ARGS)
{
*ptr = zt->zt_ptr;
*len = sizeof (uint64_t);
*type = ZT_TYPE_U64;
int val;

*len = sizeof (uint32_t);
*type = ZT_TYPE_UINT;

if (set == B_FALSE) {
*ptr = zt->zt_ptr;
return (0);
}

val = *(uint32_t *)(*ptr);
*((uint32_t *)zt->zt_ptr) = val;

arc_tuning_update(B_TRUE);

Expand Down

0 comments on commit 9947ebd

Please sign in to comment.