2 * linux/fs/nfs/sysctl.c
4 * Sysctl interface to NFS parameters
6 #include <linux/types.h>
7 #include <linux/linkage.h>
8 #include <linux/ctype.h>
10 #include <linux/sysctl.h>
11 #include <linux/module.h>
12 #include <linux/nfs4.h>
13 #include <linux/nfs_idmap.h>
14 #include <linux/nfs_fs.h>
18 static const int nfs_set_port_min = 0;
19 static const int nfs_set_port_max = 65535;
20 static struct ctl_table_header *nfs_callback_sysctl_table;
22 * Something that isn't CTL_ANY, CTL_NONE or a value that may clash.
23 * Use the same values as fs/lockd/svc.c
25 #define CTL_UNNUMBERED -2
27 static ctl_table nfs_cb_sysctls[] = {
30 .ctl_name = CTL_UNNUMBERED,
31 .procname = "nfs_callback_tcpport",
32 .data = &nfs_callback_set_tcpport,
33 .maxlen = sizeof(int),
35 .proc_handler = &proc_dointvec_minmax,
36 .extra1 = (int *)&nfs_set_port_min,
37 .extra2 = (int *)&nfs_set_port_max,
40 .ctl_name = CTL_UNNUMBERED,
41 .procname = "idmap_cache_timeout",
42 .data = &nfs_idmap_cache_timeout,
43 .maxlen = sizeof(int),
45 .proc_handler = &proc_dointvec_jiffies,
46 .strategy = &sysctl_jiffies,
50 .ctl_name = CTL_UNNUMBERED,
51 .procname = "nfs_mountpoint_timeout",
52 .data = &nfs_mountpoint_expiry_timeout,
53 .maxlen = sizeof(nfs_mountpoint_expiry_timeout),
55 .proc_handler = &proc_dointvec_jiffies,
56 .strategy = &sysctl_jiffies,
61 static ctl_table nfs_cb_sysctl_dir[] = {
63 .ctl_name = CTL_UNNUMBERED,
66 .child = nfs_cb_sysctls,
71 static ctl_table nfs_cb_sysctl_root[] = {
76 .child = nfs_cb_sysctl_dir,
81 int nfs_register_sysctl(void)
83 nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root, 0);
84 if (nfs_callback_sysctl_table == NULL)
89 void nfs_unregister_sysctl(void)
91 unregister_sysctl_table(nfs_callback_sysctl_table);
92 nfs_callback_sysctl_table = NULL;