Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * Sysctl operations for Coda filesystem | |
3 | * Original version: (C) 1996 P. Braam and M. Callahan | |
4 | * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University | |
5 | * | |
6 | * Carnegie Mellon encourages users to contribute improvements to | |
7 | * the Coda project. Contact Peter Braam (coda@cs.cmu.edu). | |
1da177e4 LT |
8 | */ |
9 | ||
1da177e4 | 10 | #include <linux/sysctl.h> |
1da177e4 | 11 | |
3cf01f28 | 12 | #include "coda_int.h" |
1da177e4 | 13 | |
87d1fda5 | 14 | #ifdef CONFIG_SYSCTL |
1da177e4 | 15 | static struct ctl_table_header *fs_table_header; |
87d1fda5 | 16 | #endif |
1da177e4 | 17 | |
1da177e4 | 18 | static ctl_table coda_table[] = { |
fd6065b4 EB |
19 | { |
20 | .ctl_name = CTL_UNNUMBERED, | |
21 | .procname = "timeout", | |
22 | .data = &coda_timeout, | |
23 | .maxlen = sizeof(int), | |
24 | .mode = 0644, | |
25 | .proc_handler = &proc_dointvec | |
26 | }, | |
27 | { | |
28 | .ctl_name = CTL_UNNUMBERED, | |
29 | .procname = "hard", | |
30 | .data = &coda_hard, | |
31 | .maxlen = sizeof(int), | |
32 | .mode = 0644, | |
33 | .proc_handler = &proc_dointvec | |
34 | }, | |
fd6065b4 EB |
35 | { |
36 | .ctl_name = CTL_UNNUMBERED, | |
37 | .procname = "fake_statfs", | |
38 | .data = &coda_fake_statfs, | |
39 | .maxlen = sizeof(int), | |
40 | .mode = 0600, | |
41 | .proc_handler = &proc_dointvec | |
42 | }, | |
43 | {} | |
1da177e4 LT |
44 | }; |
45 | ||
87d1fda5 | 46 | #ifdef CONFIG_SYSCTL |
1da177e4 | 47 | static ctl_table fs_table[] = { |
fd6065b4 EB |
48 | { |
49 | .ctl_name = CTL_UNNUMBERED, | |
50 | .procname = "coda", | |
51 | .mode = 0555, | |
52 | .child = coda_table | |
53 | }, | |
54 | {} | |
1da177e4 | 55 | }; |
87d1fda5 | 56 | #endif |
1da177e4 | 57 | |
1da177e4 LT |
58 | void coda_sysctl_init(void) |
59 | { | |
1da177e4 LT |
60 | #ifdef CONFIG_SYSCTL |
61 | if ( !fs_table_header ) | |
0b4d4147 | 62 | fs_table_header = register_sysctl_table(fs_table); |
3cf01f28 | 63 | #endif |
1da177e4 LT |
64 | } |
65 | ||
3cf01f28 | 66 | void coda_sysctl_clean(void) |
1da177e4 | 67 | { |
1da177e4 LT |
68 | #ifdef CONFIG_SYSCTL |
69 | if ( fs_table_header ) { | |
70 | unregister_sysctl_table(fs_table_header); | |
71 | fs_table_header = NULL; | |
72 | } | |
73 | #endif | |
1da177e4 | 74 | } |