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>
14 #include <linux/nfs_idmap.h>
15 #include <linux/nfs_fs.h>
19 static const int nfs_set_port_min
= 0;
20 static const int nfs_set_port_max
= 65535;
21 static struct ctl_table_header
*nfs_callback_sysctl_table
;
23 * Something that isn't CTL_ANY, CTL_NONE or a value that may clash.
24 * Use the same values as fs/lockd/svc.c
26 #define CTL_UNNUMBERED -2
28 static ctl_table nfs_cb_sysctls
[] = {
31 .ctl_name
= CTL_UNNUMBERED
,
32 .procname
= "nfs_callback_tcpport",
33 .data
= &nfs_callback_set_tcpport
,
34 .maxlen
= sizeof(int),
36 .proc_handler
= &proc_dointvec_minmax
,
37 .extra1
= (int *)&nfs_set_port_min
,
38 .extra2
= (int *)&nfs_set_port_max
,
41 .ctl_name
= CTL_UNNUMBERED
,
42 .procname
= "idmap_cache_timeout",
43 .data
= &nfs_idmap_cache_timeout
,
44 .maxlen
= sizeof(int),
46 .proc_handler
= &proc_dointvec_jiffies
,
47 .strategy
= &sysctl_jiffies
,
51 .ctl_name
= CTL_UNNUMBERED
,
52 .procname
= "nfs_mountpoint_timeout",
53 .data
= &nfs_mountpoint_expiry_timeout
,
54 .maxlen
= sizeof(nfs_mountpoint_expiry_timeout
),
56 .proc_handler
= &proc_dointvec_jiffies
,
57 .strategy
= &sysctl_jiffies
,
62 static ctl_table nfs_cb_sysctl_dir
[] = {
64 .ctl_name
= CTL_UNNUMBERED
,
67 .child
= nfs_cb_sysctls
,
72 static ctl_table nfs_cb_sysctl_root
[] = {
77 .child
= nfs_cb_sysctl_dir
,
82 int nfs_register_sysctl(void)
84 nfs_callback_sysctl_table
= register_sysctl_table(nfs_cb_sysctl_root
, 0);
85 if (nfs_callback_sysctl_table
== NULL
)
90 void nfs_unregister_sysctl(void)
92 unregister_sysctl_table(nfs_callback_sysctl_table
);
93 nfs_callback_sysctl_table
= NULL
;