Whamcloud - gitweb
Fixed a spelling mistake: "symulated" --> "simulated" (sym_obd etc).
[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 #include <linux/sim_obd.h>
15 #include <linux/presto.h>
16 #include <linux/obd_psdev.h>
17 #include <linux/presto_upcall.h>
18
19 struct ctl_table_header *obdfs_table_header = NULL;
20
21 int obdfs_debug_level = 4095;
22 int obdfs_print_entry = 1;
23
24
25 #define OBDFS_SYSCTL 1
26
27 #define OBDFS_DEBUG         1       /* control debugging */
28 #define OBDFS_ENTRY         2       /* control enter/leave pattern */
29 #define OBDFS_TIMEOUT         3       /* timeout on upcalls to become intrble */
30 #define OBDFS_HARD            4       /* mount type "hard" or "soft" */
31 #define OBDFS_VARS            5       
32 #define OBDFS_INDEX           6
33 #define OBDFS_RESET           7
34
35 #define OBDFS_VARS_SLOT       2
36
37 static ctl_table obdfs_table[] = {
38         {OBDFS_DEBUG, "debug", &obdfs_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
39         {OBDFS_ENTRY, "trace", &obdfs_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
40         { 0 }
41 };
42
43 static ctl_table jukebox_table[] = {
44        {OBDFS_SYSCTL, "obdfs",    NULL, 0, 0555, obdfs_table},
45        {0}
46 };
47
48 void obdfs_sysctl_init (void)
49 {
50 #ifdef CONFIG_SYSCTL
51         if ( !obdfs_table_header )
52                 obdfs_table_header = register_sysctl_table(jukebox_table, 0); 
53 #endif
54 }
55
56 void obdfs_sysctl_clean (void)
57 {
58 #ifdef CONFIG_SYSCTL
59         if ( obdfs_table_header )
60                 unregister_sysctl_table(obdfs_table_header);
61         obdfs_table_header = NULL;
62 #endif
63 }