2 * linux/fs/nfs/sysctl.c
4 * Sysctl interface to NFS parameters
6 #include <linux/config.h>
7 #include <linux/types.h>
8 #include <linux/linkage.h>
9 #include <linux/ctype.h>
11 #include <linux/sysctl.h>
12 #include <linux/module.h>
13 #include <linux/nfs4.h>
17 static const int nfs_set_port_min = 0;
18 static const int nfs_set_port_max = 65535;
19 static struct ctl_table_header *nfs_callback_sysctl_table;
21 * Something that isn't CTL_ANY, CTL_NONE or a value that may clash.
22 * Use the same values as fs/lockd/svc.c
24 #define CTL_UNNUMBERED -2
26 static ctl_table nfs_cb_sysctls[] = {
29 .ctl_name = CTL_UNNUMBERED,
30 .procname = "nfs_callback_tcpport",
31 .data = &nfs_callback_set_tcpport,
32 .maxlen = sizeof(int),
34 .proc_handler = &proc_dointvec_minmax,
35 .extra1 = (int *)&nfs_set_port_min,
36 .extra2 = (int *)&nfs_set_port_max,
42 static ctl_table nfs_cb_sysctl_dir[] = {
44 .ctl_name = CTL_UNNUMBERED,
47 .child = nfs_cb_sysctls,
52 static ctl_table nfs_cb_sysctl_root[] = {
57 .child = nfs_cb_sysctl_dir,
62 int nfs_register_sysctl(void)
64 nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root, 0);
65 if (nfs_callback_sysctl_table == NULL)
70 void nfs_unregister_sysctl(void)
72 unregister_sysctl_table(nfs_callback_sysctl_table);
73 nfs_callback_sysctl_table = NULL;