d47868fd454954d3988ecedb474bc7d8fd49f373
[openafs.git] / src / afs / LINUX / osi_sysctl.c
1 /*
2  * osi_sysctl.c: Linux sysctl interface to OpenAFS
3  *
4  * $Id$
5  *
6  * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
7  */
8
9 #include <afsconfig.h>
10 #include "afs/param.h"
11
12 #include "afs/sysincludes.h"    /* Standard vendor system headers */
13 #include "afsincludes.h"        /* Afs-based standard headers */
14 #include "afs/afs_stats.h"      /* afs statistics */
15
16 #include <linux/sysctl.h>
17 #include <linux/config.h>
18
19 /* From afs_analyze.c */
20 extern afs_int32 hm_retry_RO;
21 extern afs_int32 hm_retry_RW;
22 extern afs_int32 hm_retry_int;
23
24 #ifdef CONFIG_SYSCTL
25 static struct ctl_table_header *afs_sysctl = NULL;
26
27 static ctl_table afs_sysctl_table[] = {
28     {1, "hm_retry_RO",
29      &hm_retry_RO, sizeof(afs_int32), 0644, NULL,
30      &proc_dointvec}
31     ,
32     {2, "hm_retry_RW",
33      &hm_retry_RW, sizeof(afs_int32), 0644, NULL,
34      &proc_dointvec}
35     ,
36     {3, "hm_retry_int",
37      &hm_retry_int, sizeof(afs_int32), 0644, NULL,
38      &proc_dointvec}
39     ,
40     {4, "GCPAGs",
41      &afs_gcpags, sizeof(afs_int32), 0644, NULL,
42      &proc_dointvec}
43     ,
44     {5, "rx_deadtime",
45      &afs_rx_deadtime, sizeof(afs_int32), 0644, NULL,
46      &proc_dointvec}
47     ,
48     {0}
49 };
50
51 static ctl_table fs_sysctl_table[] = {
52     {1, "afs", NULL, 0, 0555, afs_sysctl_table},
53     {0}
54 };
55
56 int
57 osi_sysctl_init()
58 {
59     afs_sysctl = register_sysctl_table(fs_sysctl_table, 0);
60     if (!afs_sysctl)
61         return -1;
62
63     return 0;
64 }
65
66 void
67 osi_sysctl_clean()
68 {
69     if (afs_sysctl) {
70         unregister_sysctl_table(afs_sysctl);
71         afs_sysctl = NULL;
72     }
73 }
74
75 #endif /* CONFIG_SYSCTL */