From 58235f52af1be60a2d9d894ebe64819ebe743275 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 24 May 2025 16:36:29 +1000 Subject: [PATCH] tunables: remove direct use of module_param_cb The use for spl_taskq_kick was the only use, and the comment that module_param_call is obsolete is no longer true - it's still very much used even in recent kernels. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Reviewed-by: Pavel Snajdr Signed-off-by: Rob Norris Closes #17377 --- module/os/linux/spl/spl-taskq.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/module/os/linux/spl/spl-taskq.c b/module/os/linux/spl/spl-taskq.c index 700ec1c7f..092f090d9 100644 --- a/module/os/linux/spl/spl-taskq.c +++ b/module/os/linux/spl/spl-taskq.c @@ -37,6 +37,7 @@ #include #include #include +#include /* Linux 6.2 renamed timer_delete_sync(); point it at its old name for those. */ #ifndef HAVE_TIMER_DELETE_SYNC @@ -1651,18 +1652,8 @@ spl_taskq_kstat_fini(void) static unsigned int spl_taskq_kick = 0; -/* - * 2.6.36 API Change - * module_param_cb is introduced to take kernel_param_ops and - * module_param_call is marked as obsolete. Also set and get operations - * were changed to take a 'const struct kernel_param *'. - */ static int -#ifdef module_param_cb -param_set_taskq_kick(const char *val, const struct kernel_param *kp) -#else -param_set_taskq_kick(const char *val, struct kernel_param *kp) -#endif +param_set_taskq_kick(const char *val, zfs_kernel_param_t *kp) { int ret; taskq_t *tq = NULL; @@ -1692,16 +1683,8 @@ param_set_taskq_kick(const char *val, struct kernel_param *kp) return (ret); } -#ifdef module_param_cb -static const struct kernel_param_ops param_ops_taskq_kick = { - .set = param_set_taskq_kick, - .get = param_get_uint, -}; -module_param_cb(spl_taskq_kick, ¶m_ops_taskq_kick, &spl_taskq_kick, 0644); -#else module_param_call(spl_taskq_kick, param_set_taskq_kick, param_get_uint, &spl_taskq_kick, 0644); -#endif MODULE_PARM_DESC(spl_taskq_kick, "Write nonzero to kick stuck taskqs to spawn more threads");