Skip to content
Snippets Groups Projects
Commit 71cd88f5 authored by Li Dongyang's avatar Li Dongyang Committed by Oleg Drokin
Browse files

LU-10805 lnet: switch to module_param


From Linux 4.15 kernel the set/get function prototypes
for module_param_call has changed. This triggers compile
error:
  CC [M]  lustre-release/lnet/lnet/api-ni.o
In file included from lustre-release/lnet/lnet/api-ni.c:38:0:
include/linux/moduleparam.h:232:22: error:
initialization from incompatible pointer type [-Werror]
  static const struct kernel_param_ops __param_ops_##name =
We can switch to module_param and cfs_kernel_param_arg_t since
they are already available in libcfs.

Linux-commit: b2f270e8747387335d80428c576118e7d87f69cc

Signed-off-by: default avatarLi Dongyang <dongyangli@ddn.com>
Change-Id: Ie6f0f3a31fd22904e03e8300f45f0a8684265abd
Reviewed-on: https://review.whamcloud.com/31788


Tested-by: Jenkins
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
Reviewed-by: default avatarSonia Sharma <sonia.sharma@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
parent d6e9ece6
No related branches found
No related tags found
No related merge requests found
...@@ -79,16 +79,41 @@ MODULE_PARM_DESC(lnet_numa_range, ...@@ -79,16 +79,41 @@ MODULE_PARM_DESC(lnet_numa_range,
"NUMA range to consider during Multi-Rail selection"); "NUMA range to consider during Multi-Rail selection");
static int lnet_interfaces_max = LNET_INTERFACES_MAX_DEFAULT; static int lnet_interfaces_max = LNET_INTERFACES_MAX_DEFAULT;
static int intf_max_set(const char *val, struct kernel_param *kp); static int intf_max_set(const char *val, cfs_kernel_param_arg_t *kp);
static struct kernel_param_ops param_ops_interfaces_max = {
.set = intf_max_set,
.get = param_get_int,
};
#define param_check_interfaces_max(name, p) \
__param_check(name, p, int)
#ifdef HAVE_KERNEL_PARAM_OPS
module_param(lnet_interfaces_max, interfaces_max, 0644);
#else
module_param_call(lnet_interfaces_max, intf_max_set, param_get_int, module_param_call(lnet_interfaces_max, intf_max_set, param_get_int,
&lnet_interfaces_max, S_IRUGO|S_IWUSR); &param_ops_interfaces_max, 0644);
#endif
MODULE_PARM_DESC(lnet_interfaces_max, MODULE_PARM_DESC(lnet_interfaces_max,
"Maximum number of interfaces in a node."); "Maximum number of interfaces in a node.");
unsigned lnet_peer_discovery_disabled = 0; unsigned lnet_peer_discovery_disabled = 0;
static int discovery_set(const char *val, struct kernel_param *kp); static int discovery_set(const char *val, cfs_kernel_param_arg_t *kp);
static struct kernel_param_ops param_ops_discovery_disabled = {
.set = discovery_set,
.get = param_get_int,
};
#define param_check_discovery_disabled(name, p) \
__param_check(name, p, int)
#ifdef HAVE_KERNEL_PARAM_OPS
module_param(lnet_peer_discovery_disabled, discovery_disabled, 0644);
#else
module_param_call(lnet_peer_discovery_disabled, discovery_set, param_get_int, module_param_call(lnet_peer_discovery_disabled, discovery_set, param_get_int,
&lnet_peer_discovery_disabled, S_IRUGO|S_IWUSR); &param_ops_discovery_disabled, 0644);
#endif
MODULE_PARM_DESC(lnet_peer_discovery_disabled, MODULE_PARM_DESC(lnet_peer_discovery_disabled,
"Set to 1 to disable peer discovery on this node."); "Set to 1 to disable peer discovery on this node.");
...@@ -113,7 +138,7 @@ static int lnet_discover(struct lnet_process_id id, __u32 force, ...@@ -113,7 +138,7 @@ static int lnet_discover(struct lnet_process_id id, __u32 force,
struct lnet_process_id __user *ids, int n_ids); struct lnet_process_id __user *ids, int n_ids);
static int static int
discovery_set(const char *val, struct kernel_param *kp) discovery_set(const char *val, cfs_kernel_param_arg_t *kp)
{ {
int rc; int rc;
unsigned *discovery = (unsigned *)kp->arg; unsigned *discovery = (unsigned *)kp->arg;
...@@ -163,7 +188,7 @@ discovery_set(const char *val, struct kernel_param *kp) ...@@ -163,7 +188,7 @@ discovery_set(const char *val, struct kernel_param *kp)
} }
static int static int
intf_max_set(const char *val, struct kernel_param *kp) intf_max_set(const char *val, cfs_kernel_param_arg_t *kp)
{ {
int value, rc; int value, rc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment