Whamcloud - gitweb
Update copyright and license information.
[fs/lustre-release.git] / lustre / obdfs / sysctl.c
1 /*
2  * Copyright (C) 2001  Cluster File Systems, Inc.
3  *
4  * This code is issued under the GNU General Public License.
5  * See the file COPYING in this distribution
6  */
7 #include <linux/sched.h>
8 #include <linux/mm.h>
9 #include <linux/sysctl.h>
10 #include <linux/swapctl.h>
11 #include <linux/proc_fs.h>
12 #include <linux/slab.h>
13 #include <linux/stat.h>
14 #include <linux/ctype.h>
15 #include <asm/bitops.h>
16 #include <asm/segment.h>
17 #include <asm/uaccess.h>
18 #include <linux/utsname.h>
19
20
21 struct ctl_table_header *obdfs_table_header = NULL;
22
23 int obdfs_debug_level = 0;
24 int obdfs_print_entry = 1;
25
26
27 #define OBDFS_SYSCTL 1
28
29 #define OBDFS_DEBUG         1       /* control debugging */
30 #define OBDFS_ENTRY         2       /* control enter/leave pattern */
31 #define OBDFS_TIMEOUT         3       /* timeout on upcalls to become intrble */
32 #define OBDFS_HARD            4       /* mount type "hard" or "soft" */
33 #define OBDFS_VARS            5       
34 #define OBDFS_INDEX           6
35 #define OBDFS_RESET           7
36
37 #define OBDFS_VARS_SLOT       2
38
39 static ctl_table obdfs_table[] = {
40         {OBDFS_DEBUG, "debug", &obdfs_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
41         {OBDFS_ENTRY, "trace", &obdfs_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
42         { 0 }
43 };
44
45 static ctl_table top_table[] = {
46        {OBDFS_SYSCTL, "obdfs",    NULL, 0, 0555, obdfs_table},
47        {0}
48 };
49
50 void obdfs_sysctl_init (void)
51 {
52
53 #ifdef CONFIG_SYSCTL
54         if ( !obdfs_table_header )
55                 obdfs_table_header = register_sysctl_table(top_table, 0); 
56 #endif
57 }
58
59 void obdfs_sysctl_clean (void)
60 {
61 #ifdef CONFIG_SYSCTL
62         if ( obdfs_table_header )
63                 unregister_sysctl_table(obdfs_table_header);
64         obdfs_table_header = NULL;
65 #endif
66 }