Whamcloud - gitweb
e5c263a56c9a005705067ae334e9a920f9e46d2e
[fs/lustre-release.git] / lustre / obdfs / sysctl.c
1 #include <linux/sched.h>
2 #include <linux/mm.h>
3 #include <linux/sysctl.h>
4 #include <linux/swapctl.h>
5 #include <linux/proc_fs.h>
6 #include <linux/malloc.h>
7 #include <linux/stat.h>
8 #include <linux/ctype.h>
9 #include <asm/bitops.h>
10 #include <asm/segment.h>
11 #include <asm/uaccess.h>
12 #include <linux/utsname.h>
13
14
15 struct ctl_table_header *obdfs_table_header = NULL;
16
17 int obdfs_debug_level = 4095;
18 int obdfs_print_entry = 1;
19
20
21 #define OBDFS_SYSCTL 1
22
23 #define OBDFS_DEBUG         1       /* control debugging */
24 #define OBDFS_ENTRY         2       /* control enter/leave pattern */
25 #define OBDFS_TIMEOUT         3       /* timeout on upcalls to become intrble */
26 #define OBDFS_HARD            4       /* mount type "hard" or "soft" */
27 #define OBDFS_VARS            5       
28 #define OBDFS_INDEX           6
29 #define OBDFS_RESET           7
30
31 #define OBDFS_VARS_SLOT       2
32
33 static ctl_table obdfs_table[] = {
34         {OBDFS_DEBUG, "debug", &obdfs_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
35         {OBDFS_ENTRY, "trace", &obdfs_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
36         { 0 }
37 };
38
39 static ctl_table jukebox_table[] = {
40        {OBDFS_SYSCTL, "obdfs",    NULL, 0, 0555, obdfs_table},
41        {0}
42 };
43
44 void obdfs_sysctl_init (void)
45 {
46 #ifdef CONFIG_SYSCTL
47         if ( !obdfs_table_header )
48                 obdfs_table_header = register_sysctl_table(jukebox_table, 0); 
49 #endif
50 }
51
52 void obdfs_sysctl_clean (void)
53 {
54 #ifdef CONFIG_SYSCTL
55         if ( obdfs_table_header )
56                 unregister_sysctl_table(obdfs_table_header);
57         obdfs_table_header = NULL;
58 #endif
59 }