Whamcloud - gitweb
Landing the mds_lock_devel branch on the trunk. Notables:
[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/swapctl.h>
13 #include <linux/proc_fs.h>
14 #include <linux/slab.h>
15 #include <linux/stat.h>
16 #include <linux/ctype.h>
17 #include <asm/bitops.h>
18 #include <asm/segment.h>
19 #include <asm/uaccess.h>
20 #include <linux/utsname.h>
21
22 struct ctl_table_header *ll_table_header = NULL;
23
24 int ll_debug_level = 0;
25 int ll_print_entry = 1;
26
27
28 #define LL_SYSCTL 1
29
30 #define LL_DEBUG            1       /* control debugging */
31 #define LL_ENTRY            2       /* control enter/leave pattern */
32 #define LL_TIMEOUT         3       /* timeout on upcalls to become intrble */
33 #define LL_HARD            4       /* mount type "hard" or "soft" */
34 #define LL_VARS            5       
35 #define LL_INDEX           6
36 #define LL_RESET           7
37
38 #define LL_VARS_SLOT       2
39
40 static ctl_table ll_table[] = {
41         {LL_DEBUG, "debug", &ll_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
42         {LL_ENTRY, "trace", &ll_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
43         { 0 }
44 };
45
46 static ctl_table top_table[] = {
47        {LL_SYSCTL, "lustre_light",    NULL, 0, 0555, ll_table},
48        {0}
49 };
50
51 void ll_sysctl_init (void)
52 {
53
54 #ifdef CONFIG_SYSCTL
55         if ( !ll_table_header )
56                 ll_table_header = register_sysctl_table(top_table, 0); 
57 #endif
58 }
59
60 void ll_sysctl_clean (void)
61 {
62 #ifdef CONFIG_SYSCTL
63         if ( ll_table_header )
64                 unregister_sysctl_table(ll_table_header);
65         ll_table_header = NULL;
66 #endif
67 }