Whamcloud - gitweb
1. Bug fix for Bug #320, also needs repair of lconf, since it tries
[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  *   Author: Hariharan Thantry thantry@users.sourceforge.net
23  */
24 #ifndef _LPROCFS_SNMP_H
25 #define _LPROCFS_SNMP_H
26
27
28 #ifndef LPROC_SNMP
29 #define LPROC_SNMP
30 #endif
31
32 #include <linux/proc_fs.h>
33
34 typedef enum {
35         E_LPROC_OK = 0
36 } lproc_error_t;
37
38 struct lprocfs_vars{
39
40         char* name;
41         read_proc_t* read_fptr;
42         write_proc_t* write_fptr;
43         void* data;
44 };
45
46 #ifdef LPROC_SNMP
47
48 struct proc_dir_entry* lprocfs_mkdir(const char *dname,
49                                      struct proc_dir_entry *parent);
50 struct proc_dir_entry* lprocfs_srch(struct proc_dir_entry *head,
51                                     const char *name);
52 void lprocfs_remove_all(struct proc_dir_entry *root);
53 struct proc_dir_entry* lprocfs_new_dir(struct proc_dir_entry *root,
54                                        const char *string,
55                                        const char *tok);
56 int lprocfs_new_vars(struct proc_dir_entry *root, struct lprocfs_vars *list,
57                      const char *tok, void *data);
58
59 int lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *var,
60                      void *data);
61 int lprocfs_reg_obd(struct obd_device *device, struct lprocfs_vars *list,
62                     void *data);
63 int lprocfs_dereg_obd(struct obd_device *device);
64 struct proc_dir_entry* lprocfs_reg_mnt(char *mnt_name);
65 int lprocfs_dereg_mnt(struct proc_dir_entry *root);
66
67 int lprocfs_reg_class(struct obd_type *type, struct lprocfs_vars *list,
68                       void *data);
69 int lprocfs_dereg_class(struct obd_type *class);
70 int lprocfs_reg_main(void);
71 int lprocfs_dereg_main(void);
72 int lprocfs_ll_rd(char *page, char **start, off_t off, int count, int *eof,
73                   void *data);
74 #else
75
76
77 static inline int lprocfs_add_vars(struct proc_dir_entry *root,
78                                    struct lprocfs_vars *var, void *data)
79 {
80         return 0;
81 }
82
83 static inline int lprocfs_reg_obd(struct obd_device* device,
84                                   struct lprocfs_vars* list, void* data)
85 {
86         return 0;
87 }
88
89 static inline int lprocfs_dereg_obd(struct obd_device* device)
90 {
91         return 0;
92 }
93
94 static inline struct proc_dir_entry* lprocfs_reg_mnt(char *name)
95 {
96         return NULL;
97 }
98
99 static inline int lprocfs_dereg_mnt(struct proc_dir_entry* root)
100 {
101         return 0;
102 }
103
104 static inline int lprocfs_reg_class(struct obd_type* type,
105                                     struct lprocfs_vars* list, void* data)
106 {
107         return 0;
108 }
109
110 static inline int lprocfs_dereg_class(struct obd_type* class)
111 {
112         return 0;
113 }
114
115 static inline int lprocfs_reg_main(void)
116 {
117         return 0;
118 }
119
120 static inline int lprocfs_dereg_main(void)
121 {
122         return 0;
123 }
124
125 static inline int lprocfs_ll_rd(char *page, char **start, off_t off,
126                                 int count, int *eof, void *data)
127 {
128         return 0;
129 }
130 #endif /* LPROC_SNMP */
131
132 #endif /* LPROCFS_SNMP_H */