From 589d99171f52f8374caf3652c7338db03b4775ce Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 24 May 2025 16:51:59 +1000 Subject: [PATCH] tunables: use Linux ullong param ops for u64 Since 3.17 Linux has provided param ops for 64-bit ints, so we don't need to use our own anymore. 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 --- include/os/linux/kernel/linux/mod_compat.h | 10 +++++----- module/os/linux/spl/spl-generic.c | 22 ---------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/include/os/linux/kernel/linux/mod_compat.h b/include/os/linux/kernel/linux/mod_compat.h index 8ed664981..10fb8b840 100644 --- a/include/os/linux/kernel/linux/mod_compat.h +++ b/include/os/linux/kernel/linux/mod_compat.h @@ -107,16 +107,16 @@ enum scope_prefix_types { #define spl_param_ops_ulong param_ops_ulong #define spl_param_ops_ULONG param_ops_ulong +#define spl_param_set_u64 param_set_ullong +#define spl_param_get_u64 param_get_ullong +#define spl_param_ops_u64 param_ops_ullong +#define spl_param_ops_U64 param_ops_ullong + #define spl_param_set_charp param_set_charp #define spl_param_get_charp param_get_charp #define spl_param_ops_charp param_ops_charp #define spl_param_ops_STRING param_ops_charp -extern int spl_param_set_u64(const char *val, zfs_kernel_param_t *kp); -extern int spl_param_get_u64(char *buffer, zfs_kernel_param_t *kp); -extern const struct kernel_param_ops spl_param_ops_u64; -#define spl_param_ops_U64 spl_param_ops_u64 - /* * Declare a module parameter / sysctl node * diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c index bba0cf3ac..f37699b43 100644 --- a/module/os/linux/spl/spl-generic.c +++ b/module/os/linux/spl/spl-generic.c @@ -555,28 +555,6 @@ ddi_copyin(const void *from, void *to, size_t len, int flags) } EXPORT_SYMBOL(ddi_copyin); -#define define_spl_param(type, fmt) \ -int \ -spl_param_get_##type(char *buf, zfs_kernel_param_t *kp) \ -{ \ - return (scnprintf(buf, PAGE_SIZE, fmt "\n", \ - *(type *)kp->arg)); \ -} \ -int \ -spl_param_set_##type(const char *buf, zfs_kernel_param_t *kp) \ -{ \ - return (kstrto##type(buf, 0, (type *)kp->arg)); \ -} \ -const struct kernel_param_ops spl_param_ops_##type = { \ - .set = spl_param_set_##type, \ - .get = spl_param_get_##type, \ -}; \ -EXPORT_SYMBOL(spl_param_get_##type); \ -EXPORT_SYMBOL(spl_param_set_##type); \ -EXPORT_SYMBOL(spl_param_ops_##type); - -define_spl_param(u64, "%llu") - /* * Post a uevent to userspace whenever a new vdev adds to the pool. It is * necessary to sync blkid information with udev, which zed daemon uses