Skip to content

Commit f2b6e59

Browse files
robnbehlendorf
authored andcommitted
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 <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Pavel Snajdr <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes openzfs#17377
1 parent ed7ef7f commit f2b6e59

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

include/os/linux/kernel/linux/mod_compat.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,16 @@ enum scope_prefix_types {
107107
#define spl_param_ops_ulong param_ops_ulong
108108
#define spl_param_ops_ULONG param_ops_ulong
109109

110+
#define spl_param_set_u64 param_set_ullong
111+
#define spl_param_get_u64 param_get_ullong
112+
#define spl_param_ops_u64 param_ops_ullong
113+
#define spl_param_ops_U64 param_ops_ullong
114+
110115
#define spl_param_set_charp param_set_charp
111116
#define spl_param_get_charp param_get_charp
112117
#define spl_param_ops_charp param_ops_charp
113118
#define spl_param_ops_STRING param_ops_charp
114119

115-
extern int spl_param_set_u64(const char *val, zfs_kernel_param_t *kp);
116-
extern int spl_param_get_u64(char *buffer, zfs_kernel_param_t *kp);
117-
extern const struct kernel_param_ops spl_param_ops_u64;
118-
#define spl_param_ops_U64 spl_param_ops_u64
119-
120120
/*
121121
* Declare a module parameter / sysctl node
122122
*

module/os/linux/spl/spl-generic.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -555,28 +555,6 @@ ddi_copyin(const void *from, void *to, size_t len, int flags)
555555
}
556556
EXPORT_SYMBOL(ddi_copyin);
557557

558-
#define define_spl_param(type, fmt) \
559-
int \
560-
spl_param_get_##type(char *buf, zfs_kernel_param_t *kp) \
561-
{ \
562-
return (scnprintf(buf, PAGE_SIZE, fmt "\n", \
563-
*(type *)kp->arg)); \
564-
} \
565-
int \
566-
spl_param_set_##type(const char *buf, zfs_kernel_param_t *kp) \
567-
{ \
568-
return (kstrto##type(buf, 0, (type *)kp->arg)); \
569-
} \
570-
const struct kernel_param_ops spl_param_ops_##type = { \
571-
.set = spl_param_set_##type, \
572-
.get = spl_param_get_##type, \
573-
}; \
574-
EXPORT_SYMBOL(spl_param_get_##type); \
575-
EXPORT_SYMBOL(spl_param_set_##type); \
576-
EXPORT_SYMBOL(spl_param_ops_##type);
577-
578-
define_spl_param(u64, "%llu")
579-
580558
/*
581559
* Post a uevent to userspace whenever a new vdev adds to the pool. It is
582560
* necessary to sync blkid information with udev, which zed daemon uses

0 commit comments

Comments
 (0)