Whamcloud - gitweb
1. Fixed cleanup issue where I was *indeed* accesing a zapped pointer.
[fs/lustre-release.git] / lustre / include / linux / lprocfs_status.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2002 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *   
21  *   Top level header file for LProc SNMP
22  */
23 #ifndef _LPROCFS_SNMP_H
24 #define _LPROCFS_SNMP_H
25
26
27 #ifndef LPROC_SNMP
28 #define LPROC_SNMP
29 #endif
30
31
32 #include <linux/proc_fs.h>
33
34
35 struct lprocfs_vars{
36         char* name;
37         read_proc_t* read_fptr;
38         write_proc_t* write_fptr;
39 };
40
41 #ifdef LPROC_SNMP
42
43 struct proc_dir_entry* lprocfs_mkdir(const char* dname,
44                                      struct proc_dir_entry *parent);
45 struct proc_dir_entry* lprocfs_srch(struct proc_dir_entry* head,
46                                     const char* name);
47 void lprocfs_remove_all(struct proc_dir_entry* root);
48 struct proc_dir_entry* lprocfs_new_dir(struct proc_dir_entry* root,
49                                        const char* string, 
50                                        const char* tok);
51 int lprocfs_new_vars(struct proc_dir_entry* root,
52                      struct lprocfs_vars* list, const char* tok, void* data);
53
54 int lprocfs_add_vars(struct proc_dir_entry* root,
55                      struct lprocfs_vars* var, 
56                      void* data);
57 int lprocfs_reg_obd(struct obd_device* device, 
58                     struct lprocfs_vars* list, 
59                     void* data);
60 int lprocfs_dereg_obd(struct obd_device* device);
61 struct proc_dir_entry* lprocfs_reg_mnt(char *mnt_name);
62 int lprocfs_dereg_mnt(struct proc_dir_entry* root);
63
64 int lprocfs_reg_class(struct obd_type* type, struct lprocfs_vars* list, 
65                       void* data);
66 int lprocfs_dereg_class(struct obd_type* class);
67 int lprocfs_reg_main(void);
68 int lprocfs_dereg_main(void);
69 int lprocfs_ll_rd(char *page, char **start, off_t off, int count, int *eof,
70                   void *data);
71 #else
72
73
74 static inline int lprocfs_add_vars(struct proc_dir_entry* root,
75                                    struct lprocfs_vars* var, 
76                                    void* data)
77
78 {
79         return 0;
80 }
81
82
83 static inline int lprocfs_reg_obd(struct obd_device* device, 
84                                   struct lprocfs_vars* list, 
85                                   void* data)
86 {
87         return 0;
88 }
89
90 static inline int lprocfs_dereg_obd(struct obd_device* device)
91 {
92         return 0;
93 }
94
95 static inline struct proc_dir_entry* lprocfs_reg_mnt(char *name)
96 {
97         return 0;
98 }
99
100 static inline int lprocfs_dereg_mnt(struct proc_dir_entry* root)
101 {
102         return 0;
103 }
104
105 static inline int lprocfs_reg_class(struct obd_type* type,
106                                     struct lprocfs_vars* list, 
107                                     void* data)
108
109 {
110         return 0;
111 }
112
113 static inline int lprocfs_dereg_class(struct obd_type* class)
114 {
115         return 0;
116 }
117
118 static inline int lprocfs_reg_main(void)
119 {
120         return 0;
121 }
122
123 static inline int lprocfs_dereg_main(void)
124 {
125         return 0;
126 }
127
128 static inline int lprocfs_ll_rd(char *page, char **start, off_t off,
129                                 int count, int *eof, void *data)
130 {
131         return 0;
132 }
133 #endif /* LPROC_SNMP */
134
135 #endif /* LPROCFS_SNMP_H */