Make the vfs.zfs.vdev.raidz_impl sysctl cross-platform

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by:	Alan Somers <asomers@gmail.com>
Sponsored by:	ConnectWise
Closes #16980
This commit is contained in:
Alan Somers
2025-01-29 07:18:09 -07:00
committed by Ameer Hamza
parent 42bad93414
commit 6e9911212e
8 changed files with 84 additions and 15 deletions
+21
View File
@@ -679,6 +679,27 @@ param_set_deadman_failmode(SYSCTL_HANDLER_ARGS)
return (-param_set_deadman_failmode_common(buf));
}
int
param_set_raidz_impl(SYSCTL_HANDLER_ARGS)
{
const size_t bufsize = 128;
char *buf;
int rc;
buf = malloc(bufsize, M_SOLARIS, M_WAITOK | M_ZERO);
if (req->newptr == NULL)
vdev_raidz_impl_get(buf, bufsize);
rc = sysctl_handle_string(oidp, buf, bufsize, req);
if (rc || req->newptr == NULL) {
free(buf, M_SOLARIS);
return (rc);
}
rc = vdev_raidz_impl_set(buf);
free(buf, M_SOLARIS);
return (rc);
}
int
param_set_slop_shift(SYSCTL_HANDLER_ARGS)
{