1 #include <linux/sched.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>
14 #include <linux/obd_support.h>
16 struct ctl_table_header *obd_table_header = NULL;
21 static int obd_sctl_vars( ctl_table * table, int write, struct file *
22 filp, void * buffer, size_t * lenp );
23 static int obd_sctl_reset( ctl_table * table, int write, struct file
24 * filp, void * buffer, size_t * lenp );
30 #define OBD_DEBUG 1 /* control debugging */
31 #define OBD_ENTRY 2 /* control enter/leave pattern */
32 #define OBD_TIMEOUT 3 /* timeout on upcalls to become intrble */
33 #define OBD_HARD 4 /* mount type "hard" or "soft" */
38 #define OBD_VARS_SLOT 2
40 static ctl_table obd_table[] = {
41 {OBD_DEBUG, "debug", &obd_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
42 {OBD_ENTRY, "trace", &obd_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
43 {OBD_VARS, "vars", &vars[0], sizeof(int), 0644, NULL, &proc_dointvec},
44 {OBD_INDEX, "index", &index, sizeof(int), 0644, NULL, &obd_sctl_vars},
45 {OBD_RESET, "reset", NULL, 0, 0644, NULL, &obd_sctl_reset},
50 static ctl_table jukebox_table[] = {
51 {OBD_SYSCTL, "obd", NULL, 0, 0555, obd_table},
56 void obd_sysctl_init (void)
59 if ( !obd_table_header )
60 obd_table_header = register_sysctl_table(jukebox_table, 0);
64 void obd_sysctl_clean (void)
67 if ( obd_table_header )
68 unregister_sysctl_table(obd_table_header);
69 obd_table_header = NULL;
73 int obd_sctl_reset (ctl_table * table, int write,
74 struct file * filp, void * buffer,
78 /* do something here */
87 int obd_sctl_vars (ctl_table * table, int write,
88 struct file * filp, void * buffer,
93 rc = proc_dointvec(table, write, filp, buffer, lenp);
98 if ( index < 0 || index > 1 ) {
99 printk("Index illegal!\n");
102 obd_table[OBD_VARS_SLOT].data = &vars[index];