]>
Commit | Line | Data |
---|---|---|
a72b4422 TM |
1 | /* |
2 | * linux/fs/nfs/sysctl.c | |
3 | * | |
4 | * Sysctl interface to NFS parameters | |
5 | */ | |
a72b4422 TM |
6 | #include <linux/types.h> |
7 | #include <linux/linkage.h> | |
8 | #include <linux/ctype.h> | |
9 | #include <linux/fs.h> | |
10 | #include <linux/sysctl.h> | |
11 | #include <linux/module.h> | |
51d8fa6a | 12 | #include <linux/nfs_fs.h> |
a72b4422 | 13 | |
a72b4422 | 14 | static struct ctl_table_header *nfs_callback_sysctl_table; |
a72b4422 TM |
15 | |
16 | static ctl_table nfs_cb_sysctls[] = { | |
51d8fa6a | 17 | { |
51d8fa6a TM |
18 | .procname = "nfs_mountpoint_timeout", |
19 | .data = &nfs_mountpoint_expiry_timeout, | |
20 | .maxlen = sizeof(nfs_mountpoint_expiry_timeout), | |
21 | .mode = 0644, | |
6d456111 | 22 | .proc_handler = proc_dointvec_jiffies, |
51d8fa6a | 23 | }, |
89a09141 | 24 | { |
89a09141 PZ |
25 | .procname = "nfs_congestion_kb", |
26 | .data = &nfs_congestion_kb, | |
27 | .maxlen = sizeof(nfs_congestion_kb), | |
28 | .mode = 0644, | |
6d456111 | 29 | .proc_handler = proc_dointvec, |
89a09141 | 30 | }, |
ab09203e | 31 | { } |
a72b4422 TM |
32 | }; |
33 | ||
34 | static ctl_table nfs_cb_sysctl_dir[] = { | |
35 | { | |
a72b4422 TM |
36 | .procname = "nfs", |
37 | .mode = 0555, | |
38 | .child = nfs_cb_sysctls, | |
39 | }, | |
ab09203e | 40 | { } |
a72b4422 TM |
41 | }; |
42 | ||
43 | static ctl_table nfs_cb_sysctl_root[] = { | |
44 | { | |
a72b4422 TM |
45 | .procname = "fs", |
46 | .mode = 0555, | |
47 | .child = nfs_cb_sysctl_dir, | |
48 | }, | |
ab09203e | 49 | { } |
a72b4422 TM |
50 | }; |
51 | ||
52 | int nfs_register_sysctl(void) | |
53 | { | |
0b4d4147 | 54 | nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root); |
a72b4422 TM |
55 | if (nfs_callback_sysctl_table == NULL) |
56 | return -ENOMEM; | |
57 | return 0; | |
58 | } | |
59 | ||
60 | void nfs_unregister_sysctl(void) | |
61 | { | |
62 | unregister_sysctl_table(nfs_callback_sysctl_table); | |
63 | nfs_callback_sysctl_table = NULL; | |
64 | } |