Whamcloud - gitweb
land 0.5.20.3 b_devel onto HEAD (b_devel will remain)
[fs/lustre-release.git] / lustre / llite / sysctl.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2001  Cluster File Systems, Inc.
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  */
9 #include <linux/sched.h>
10 #include <linux/mm.h>
11 #include <linux/sysctl.h>
12 #include <linux/version.h>
13 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
14 #include <linux/swapctl.h>
15 #endif
16 #include <linux/proc_fs.h>
17 #include <linux/slab.h>
18 #include <linux/stat.h>
19 #include <linux/ctype.h>
20 #include <asm/bitops.h>
21 #include <asm/segment.h>
22 #include <asm/uaccess.h>
23 #include <linux/utsname.h>
24
25 struct ctl_table_header *ll_table_header = NULL;
26
27 int ll_debug_level = 0;
28 int ll_print_entry = 1;
29
30
31 #define LL_SYSCTL 1
32
33 #define LL_DEBUG            1       /* control debugging */
34 #define LL_ENTRY            2       /* control enter/leave pattern */
35 #define LL_TIMEOUT         3       /* timeout on upcalls to become intrble */
36 #define LL_HARD            4       /* mount type "hard" or "soft" */
37 #define LL_VARS            5       
38 #define LL_INDEX           6
39 #define LL_RESET           7
40
41 #define LL_VARS_SLOT       2
42
43 static ctl_table ll_table[] = {
44         {LL_DEBUG, "debug", &ll_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
45         {LL_ENTRY, "trace", &ll_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
46         { 0 }
47 };
48
49 static ctl_table top_table[] = {
50        {LL_SYSCTL, "lustre_light",    NULL, 0, 0555, ll_table},
51        {0}
52 };
53
54 void ll_sysctl_init (void)
55 {
56
57 #ifdef CONFIG_SYSCTL
58         if ( !ll_table_header )
59                 ll_table_header = register_sysctl_table(top_table, 0); 
60 #endif
61 }
62
63 void ll_sysctl_clean (void)
64 {
65 #ifdef CONFIG_SYSCTL
66         if ( ll_table_header )
67                 unregister_sysctl_table(ll_table_header);
68         ll_table_header = NULL;
69 #endif
70 }