[PATCH] pcmcia: convert pcmcia_cs to kthread
[linux-2.6/kmemtrace.git] / fs / nfs / sysctl.c
blobdb61e51bb154747a949e63788c7bdd3e9765ffd2
1 /*
2 * linux/fs/nfs/sysctl.c
4 * Sysctl interface to NFS parameters
5 */
6 #include <linux/config.h>
7 #include <linux/types.h>
8 #include <linux/linkage.h>
9 #include <linux/ctype.h>
10 #include <linux/fs.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>
17 #include "callback.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[] = {
29 #ifdef CONFIG_NFS_V4
31 .ctl_name = CTL_UNNUMBERED,
32 .procname = "nfs_callback_tcpport",
33 .data = &nfs_callback_set_tcpport,
34 .maxlen = sizeof(int),
35 .mode = 0644,
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),
45 .mode = 0644,
46 .proc_handler = &proc_dointvec_jiffies,
47 .strategy = &sysctl_jiffies,
49 #endif
51 .ctl_name = CTL_UNNUMBERED,
52 .procname = "nfs_mountpoint_timeout",
53 .data = &nfs_mountpoint_expiry_timeout,
54 .maxlen = sizeof(nfs_mountpoint_expiry_timeout),
55 .mode = 0644,
56 .proc_handler = &proc_dointvec_jiffies,
57 .strategy = &sysctl_jiffies,
59 { .ctl_name = 0 }
62 static ctl_table nfs_cb_sysctl_dir[] = {
64 .ctl_name = CTL_UNNUMBERED,
65 .procname = "nfs",
66 .mode = 0555,
67 .child = nfs_cb_sysctls,
69 { .ctl_name = 0 }
72 static ctl_table nfs_cb_sysctl_root[] = {
74 .ctl_name = CTL_FS,
75 .procname = "fs",
76 .mode = 0555,
77 .child = nfs_cb_sysctl_dir,
79 { .ctl_name = 0 }
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)
86 return -ENOMEM;
87 return 0;
90 void nfs_unregister_sysctl(void)
92 unregister_sysctl_table(nfs_callback_sysctl_table);
93 nfs_callback_sysctl_table = NULL;