aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r--fs/nfs/callback.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index fe0a6b8ac149..d6c4bae14bb9 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -36,6 +36,21 @@ static struct svc_program nfs4_callback_program;
36 36
37unsigned int nfs_callback_set_tcpport; 37unsigned int nfs_callback_set_tcpport;
38unsigned short nfs_callback_tcpport; 38unsigned short nfs_callback_tcpport;
39static const int nfs_set_port_min = 0;
40static const int nfs_set_port_max = 65535;
41
42static int param_set_port(const char *val, struct kernel_param *kp)
43{
44 char *endp;
45 int num = simple_strtol(val, &endp, 0);
46 if (endp == val || *endp || num < nfs_set_port_min || num > nfs_set_port_max)
47 return -EINVAL;
48 *((int *)kp->arg) = num;
49 return 0;
50}
51
52module_param_call(callback_tcpport, param_set_port, param_get_int,
53 &nfs_callback_set_tcpport, 0644);
39 54
40/* 55/*
41 * This is the callback kernel thread. 56 * This is the callback kernel thread.