1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
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.
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.
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.
21 * Top level header file for LProc SNMP
22 * Author: Hariharan Thantry thantry@users.sourceforge.net
24 #ifndef _LPROCFS_SNMP_H
25 #define _LPROCFS_SNMP_H
27 #include <lustre/lustre_idl.h>
28 #if defined(__linux__)
29 #include <linux/lprocfs_status.h>
30 #elif defined(__APPLE__)
31 #include <darwin/lprocfs_status.h>
32 #elif defined(__WINNT__)
33 #include <winnt/lprocfs_status.h>
35 #error Unsupported operating system.
39 #if (defined(__KERNEL__) && defined(CONFIG_PROC_FS))
45 cfs_read_proc_t *read_fptr;
46 cfs_write_proc_t *write_fptr;
48 struct file_operations *fops;
51 struct lprocfs_static_vars {
52 struct lprocfs_vars *module_vars;
53 struct lprocfs_vars *obd_vars;
56 /* if we find more consumers this could be generalized */
57 #define OBD_HIST_MAX 32
58 struct obd_histogram {
60 unsigned long oh_buckets[OBD_HIST_MAX];
82 struct obd_histogram hist[BRW_LAST];
86 /* An lprocfs counter can be configured using the enum bit masks below.
88 * LPROCFS_CNTR_EXTERNALLOCK indicates that an external lock already
89 * protects this counter from concurrent updates. If not specified,
90 * lprocfs an internal per-counter lock variable. External locks are
91 * not used to protect counter increments, but are used to protect
92 * counter readout and resets.
94 * LPROCFS_CNTR_AVGMINMAX indicates a multi-valued counter samples,
95 * (i.e. counter can be incremented by more than "1"). When specified,
96 * the counter maintains min, max and sum in addition to a simple
97 * invocation count. This allows averages to be be computed.
98 * If not specified, the counter is an increment-by-1 counter.
99 * min, max, sum, etc. are not maintained.
101 * LPROCFS_CNTR_STDDEV indicates that the counter should track sum of
102 * squares (for multi-valued counter samples only). This allows
103 * external computation of standard deviation, but involves a 64-bit
104 * multiply per counter increment.
108 LPROCFS_CNTR_EXTERNALLOCK = 0x0001,
109 LPROCFS_CNTR_AVGMINMAX = 0x0002,
110 LPROCFS_CNTR_STDDEV = 0x0004,
112 /* counter data type */
113 LPROCFS_TYPE_REGS = 0x0100,
114 LPROCFS_TYPE_BYTES = 0x0200,
115 LPROCFS_TYPE_PAGES = 0x0400,
116 LPROCFS_TYPE_CYCLE = 0x0800,
119 struct lprocfs_atomic {
124 #define LC_MIN_INIT ((~(__u64)0) >> 1)
126 struct lprocfs_counter {
127 struct lprocfs_atomic lc_cntl; /* may need to move to per set */
128 unsigned int lc_config;
134 const char *lc_name; /* must be static */
135 const char *lc_units; /* must be static */
138 struct lprocfs_percpu {
139 struct lprocfs_counter lp_cntr[0];
142 #define LPROCFS_GET_NUM_CPU 0x0001
143 #define LPROCFS_GET_SMP_ID 0x0002
145 enum lprocfs_stats_flags {
146 LPROCFS_STATS_FLAG_PERCPU = 0x0000, /* per cpu counter */
147 LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* stats have no percpu
148 * area and need locking */
151 enum lprocfs_fields_flags {
152 LPROCFS_FIELDS_FLAGS_CONFIG = 0x0001,
153 LPROCFS_FIELDS_FLAGS_SUM = 0x0002,
154 LPROCFS_FIELDS_FLAGS_MIN = 0x0003,
155 LPROCFS_FIELDS_FLAGS_MAX = 0x0004,
156 LPROCFS_FIELDS_FLAGS_AVG = 0x0005,
157 LPROCFS_FIELDS_FLAGS_SUMSQUARE = 0x0006,
158 LPROCFS_FIELDS_FLAGS_COUNT = 0x0007,
161 struct lprocfs_stats {
162 unsigned int ls_num; /* # of counters */
163 int ls_flags; /* See LPROCFS_STATS_FLAG_* */
164 spinlock_t ls_lock; /* Lock used only when there are
165 * no percpu stats areas */
166 struct lprocfs_percpu *ls_percpu[0];
169 static inline int opcode_offset(__u32 opc) {
170 if (opc < OST_LAST_OPC) {
172 return (opc - OST_FIRST_OPC);
173 } else if (opc < MDS_LAST_OPC) {
175 return (opc - MDS_FIRST_OPC +
176 (OST_LAST_OPC - OST_FIRST_OPC));
177 } else if (opc < LDLM_LAST_OPC) {
179 return (opc - LDLM_FIRST_OPC +
180 (MDS_LAST_OPC - MDS_FIRST_OPC) +
181 (OST_LAST_OPC - OST_FIRST_OPC));
182 } else if (opc < MGS_LAST_OPC) {
184 return (opc - MGS_FIRST_OPC +
185 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
186 (MDS_LAST_OPC - MDS_FIRST_OPC) +
187 (OST_LAST_OPC - OST_FIRST_OPC));
188 } else if (opc < OBD_LAST_OPC) {
190 return (opc - OBD_FIRST_OPC +
191 (MGS_LAST_OPC - MGS_FIRST_OPC) +
192 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
193 (MDS_LAST_OPC - MDS_FIRST_OPC) +
194 (OST_LAST_OPC - OST_FIRST_OPC));
195 } else if (opc < LLOG_LAST_OPC) {
197 return (opc - LLOG_FIRST_OPC +
198 (OBD_LAST_OPC - OBD_FIRST_OPC) +
199 (MGS_LAST_OPC - MGS_FIRST_OPC) +
200 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
201 (MDS_LAST_OPC - MDS_FIRST_OPC) +
202 (OST_LAST_OPC - OST_FIRST_OPC));
203 } else if (opc < FLD_LAST_OPC) {
205 return (opc - FLD_FIRST_OPC +
206 (LLOG_LAST_OPC - LLOG_FIRST_OPC) +
207 (OBD_LAST_OPC - OBD_FIRST_OPC) +
208 (MGS_LAST_OPC - MGS_FIRST_OPC) +
209 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
210 (MDS_LAST_OPC - MDS_FIRST_OPC) +
211 (OST_LAST_OPC - OST_FIRST_OPC));
212 } else if (opc < SEQ_LAST_OPC) {
214 return (opc - SEQ_FIRST_OPC +
215 (FLD_LAST_OPC - FLD_FIRST_OPC) +
216 (LLOG_LAST_OPC - LLOG_FIRST_OPC) +
217 (OBD_LAST_OPC - OBD_FIRST_OPC) +
218 (MGS_LAST_OPC - MGS_FIRST_OPC) +
219 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
220 (MDS_LAST_OPC - MDS_FIRST_OPC) +
221 (OST_LAST_OPC - OST_FIRST_OPC));
222 } else if (opc < SEC_LAST_OPC) {
224 return (opc - SEC_FIRST_OPC +
225 (SEQ_LAST_OPC - SEQ_FIRST_OPC) +
226 (FLD_LAST_OPC - FLD_FIRST_OPC) +
227 (LLOG_LAST_OPC - LLOG_FIRST_OPC) +
228 (OBD_LAST_OPC - OBD_FIRST_OPC) +
229 (MGS_LAST_OPC - MGS_FIRST_OPC) +
230 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
231 (MDS_LAST_OPC - MDS_FIRST_OPC) +
232 (OST_LAST_OPC - OST_FIRST_OPC));
239 #define LUSTRE_MAX_OPCODES ((LDLM_LAST_OPC - LDLM_FIRST_OPC) + \
240 (MDS_LAST_OPC - MDS_FIRST_OPC) + \
241 (OST_LAST_OPC - OST_FIRST_OPC) + \
242 (OBD_LAST_OPC - OBD_FIRST_OPC) + \
243 (FLD_LAST_OPC - FLD_FIRST_OPC) + \
244 (SEQ_LAST_OPC - SEQ_FIRST_OPC) + \
245 (MGS_LAST_OPC - MGS_FIRST_OPC) + \
246 (LLOG_LAST_OPC - LLOG_FIRST_OPC) + \
247 (SEC_LAST_OPC - SEC_FIRST_OPC))
249 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR) + \
250 (EXTRA_LAST_OPC - EXTRA_FIRST_OPC))
253 PTLRPC_REQWAIT_CNTR = 0,
254 PTLRPC_REQQDEPTH_CNTR,
255 PTLRPC_REQACTIVE_CNTR,
257 PTLRPC_REQBUF_AVAIL_CNTR,
261 #define PTLRPC_FIRST_CNTR PTLRPC_REQWAIT_CNTR
264 LDLM_GLIMPSE_ENQUEUE = 0,
278 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
280 extern cfs_proc_dir_entry_t *proc_lustre_root;
284 struct obd_histogram;
288 static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int type)
292 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
293 if (type & LPROCFS_GET_NUM_CPU)
295 if (type & LPROCFS_GET_SMP_ID)
297 spin_lock(&stats->ls_lock);
299 if (type & LPROCFS_GET_NUM_CPU)
300 rc = num_possible_cpus();
301 if (type & LPROCFS_GET_SMP_ID)
302 rc = smp_processor_id();
307 static inline void lprocfs_stats_unlock(struct lprocfs_stats *stats)
309 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU)
310 spin_unlock(&stats->ls_lock);
313 /* Two optimized LPROCFS counter increment functions are provided:
314 * lprocfs_counter_incr(cntr, value) - optimized for by-one counters
315 * lprocfs_counter_add(cntr) - use for multi-valued counters
316 * Counter data layout allows config flag, counter lock and the
317 * count itself to reside within a single cache line.
320 extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
322 extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
325 #define lprocfs_counter_incr(stats, idx) \
326 lprocfs_counter_add(stats, idx, 1)
327 #define lprocfs_counter_decr(stats, idx) \
328 lprocfs_counter_sub(stats, idx, 1)
330 extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
331 enum lprocfs_fields_flags field);
332 static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
334 enum lprocfs_fields_flags field)
339 LASSERT(stats != NULL);
340 for (i = 0; i < num_possible_cpus(); i++)
341 ret += lprocfs_read_helper(&(stats->ls_percpu[i]->lp_cntr[idx]),
346 extern struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
347 enum lprocfs_stats_flags flags);
348 extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
349 extern void lprocfs_free_stats(struct lprocfs_stats **stats);
350 extern void lprocfs_init_ops_stats(int num_private_stats,
351 struct lprocfs_stats *stats);
352 extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
353 unsigned int num_private_stats);
354 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
355 unsigned conf, const char *name,
357 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
360 extern int lprocfs_add_clear_entry(struct obd_device * obd,
361 cfs_proc_dir_entry_t *entry);
362 extern int lprocfs_exp_setup(struct obd_export *exp,
363 lnet_nid_t *peer_nid, int *newnid);
364 extern int lprocfs_exp_cleanup(struct obd_export *exp);
365 extern int lprocfs_add_simple(struct proc_dir_entry *root,
366 char *name, read_proc_t *read_proc,
367 write_proc_t *write_proc, void *data);
368 extern struct proc_dir_entry *lprocfs_add_symlink(const char *name,
369 struct proc_dir_entry *parent, const char *dest);
370 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
371 extern int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
372 unsigned long count, void *data);
373 extern int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
374 int count, int *eof, void *data);
376 extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
377 struct lprocfs_stats *stats);
379 /* lprocfs_status.c */
380 extern int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
381 struct lprocfs_vars *var,
384 extern cfs_proc_dir_entry_t *lprocfs_register(const char *name,
385 cfs_proc_dir_entry_t *parent,
386 struct lprocfs_vars *list,
389 extern void lprocfs_remove(cfs_proc_dir_entry_t **root);
390 extern void lprocfs_remove_proc_entry(const char *name,
391 struct proc_dir_entry *parent);
393 extern cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *root,
396 extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
397 extern int lprocfs_obd_cleanup(struct obd_device *obd);
398 extern int lprocfs_add_simple(struct proc_dir_entry *root, char *name,
399 read_proc_t *read_proc, write_proc_t *write_proc,
401 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
402 extern struct file_operations lprocfs_evict_client_fops;
404 extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, char *name,
405 mode_t mode, struct file_operations *seq_fops,
407 extern int lprocfs_obd_seq_create(struct obd_device *dev, char *name,
408 mode_t mode, struct file_operations *seq_fops,
411 /* Generic callbacks */
413 extern int lprocfs_rd_u64(char *page, char **start, off_t off,
414 int count, int *eof, void *data);
415 extern int lprocfs_rd_atomic(char *page, char **start, off_t off,
416 int count, int *eof, void *data);
417 extern int lprocfs_wr_atomic(struct file *file, const char *buffer,
418 unsigned long count, void *data);
419 extern int lprocfs_rd_uint(char *page, char **start, off_t off,
420 int count, int *eof, void *data);
421 extern int lprocfs_wr_uint(struct file *file, const char *buffer,
422 unsigned long count, void *data);
423 extern int lprocfs_rd_uuid(char *page, char **start, off_t off,
424 int count, int *eof, void *data);
425 extern int lprocfs_rd_name(char *page, char **start, off_t off,
426 int count, int *eof, void *data);
427 extern int lprocfs_rd_fstype(char *page, char **start, off_t off,
428 int count, int *eof, void *data);
429 extern int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
430 int count, int *eof, void *data);
431 extern int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
432 int count, int *eof, void *data);
433 extern int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
434 int count, int *eof, void *data);
435 extern int lprocfs_rd_num_exports(char *page, char **start, off_t off,
436 int count, int *eof, void *data);
437 extern int lprocfs_rd_numrefs(char *page, char **start, off_t off,
438 int count, int *eof, void *data);
439 extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
440 unsigned long count, void *data);
441 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
442 unsigned long count, void *data);
445 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
446 int count, int *eof, void *data);
447 extern int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
448 int count, int *eof, void *data);
449 extern int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
450 int count, int *eof, void *data);
451 extern int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
452 int count, int *eof, void *data);
453 extern int lprocfs_rd_filestotal(char *page, char **start, off_t off,
454 int count, int *eof, void *data);
455 extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
456 int count, int *eof, void *data);
457 extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
458 int count, int *eof, void *data);
460 extern int lprocfs_write_helper(const char *buffer, unsigned long count,
462 extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count,
464 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
466 extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
468 extern int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
469 __u64 *val, int mult);
470 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
471 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
472 void lprocfs_oh_clear(struct obd_histogram *oh);
473 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
475 /* lprocfs_status.c: counter read/write functions */
476 extern int lprocfs_counter_read(char *page, char **start, off_t off,
477 int count, int *eof, void *data);
478 extern int lprocfs_counter_write(struct file *file, const char *buffer,
479 unsigned long count, void *data);
481 /* lprocfs_status.c: recovery status */
482 int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
483 int count, int *eof, void *data);
485 extern int lprocfs_seq_release(struct inode *, struct file *);
487 /* in lprocfs_stat.c, to protect the private data for proc entries */
488 extern struct rw_semaphore _lprocfs_lock;
489 #define LPROCFS_ENTRY() do { \
490 down_read(&_lprocfs_lock); \
492 #define LPROCFS_EXIT() do { \
493 up_read(&_lprocfs_lock); \
495 #define LPROCFS_ENTRY_AND_CHECK(dp) do { \
496 typecheck(struct proc_dir_entry *, dp); \
498 if ((dp)->deleted) { \
504 /* You must use these macros when you want to refer to
505 * the import in a client obd_device for a lprocfs entry */
506 #define LPROCFS_CLIMP_CHECK(obd) do { \
507 typecheck(struct obd_device *, obd); \
508 mutex_down(&(obd)->u.cli.cl_sem); \
509 if ((obd)->u.cli.cl_import == NULL) { \
510 mutex_up(&(obd)->u.cli.cl_sem); \
514 #define LPROCFS_CLIMP_EXIT(obd) \
515 mutex_up(&(obd)->u.cli.cl_sem);
518 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
519 proc entries; otherwise, you will define name##_seq_write function also for
520 a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
521 call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
522 #define __LPROC_SEQ_FOPS(name, custom_seq_write) \
523 static int name##_seq_open(struct inode *inode, struct file *file) { \
524 struct proc_dir_entry *dp = PDE(inode); \
526 LPROCFS_ENTRY_AND_CHECK(dp); \
527 rc = single_open(file, name##_seq_show, dp->data); \
534 struct file_operations name##_fops = { \
535 .owner = THIS_MODULE, \
536 .open = name##_seq_open, \
538 .write = custom_seq_write, \
539 .llseek = seq_lseek, \
540 .release = lprocfs_seq_release, \
543 #define LPROC_SEQ_FOPS_RO(name) __LPROC_SEQ_FOPS(name, NULL)
544 #define LPROC_SEQ_FOPS(name) __LPROC_SEQ_FOPS(name, name##_seq_write)
546 /* lprocfs_status.c: read recovery max time bz13079 */
547 int lprocfs_obd_rd_recovery_maxtime(char *page, char **start, off_t off,
548 int count, int *eof, void *data);
550 /* lprocfs_status.c: write recovery max time bz13079 */
551 int lprocfs_obd_wr_recovery_maxtime(struct file *file, const char *buffer,
552 unsigned long count, void *data);
554 /* LPROCFS is not defined */
555 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
556 int index, long amount) { return; }
557 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
558 int index) { return; }
559 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
560 int index, long amount) { return; }
561 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
562 int index, unsigned conf,
563 const char *name, const char *units)
566 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
567 enum lprocfs_fields_flags field)
570 static inline struct lprocfs_stats* lprocfs_alloc_stats(unsigned int num,
571 enum lprocfs_stats_flags flags)
573 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
575 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
577 static inline int lprocfs_register_stats(cfs_proc_dir_entry_t *root,
579 struct lprocfs_stats *stats)
581 static inline void lprocfs_init_ops_stats(int num_private_stats,
582 struct lprocfs_stats *stats)
584 static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
585 unsigned int num_private_stats)
587 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
591 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
593 static inline int lprocfs_exp_setup(struct obd_export *exp,
594 lnet_nid_t *peer_nid, int *newnid)
596 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
598 static inline int lprocfs_add_simple(struct proc_dir_entry *root,
600 read_proc_t *read_proc,
601 write_proc_t *write_proc,
604 static inline struct proc_dir_entry *lprocfs_add_symlink(const char *name,
605 struct proc_dir_entry *parent, const char *dest)
607 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
610 int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
611 unsigned long count, void *data)
614 int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
615 int count, int *eof, void *data)
618 static inline cfs_proc_dir_entry_t *
619 lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
620 struct lprocfs_vars *list, void *data) { return NULL; }
621 static inline int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
622 struct lprocfs_vars *var,
623 void *data) { return 0; }
624 static inline void lprocfs_remove(cfs_proc_dir_entry_t **root) {};
625 static inline void lprocfs_remove_proc_entry(const char *name,
626 struct proc_dir_entry *parent) {};
627 static inline cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *head,
628 const char *name) {return 0;}
629 static inline int lprocfs_obd_setup(struct obd_device *dev,
630 struct lprocfs_vars *list) { return 0; }
631 static inline int lprocfs_obd_cleanup(struct obd_device *dev) { return 0; }
632 static inline int lprocfs_rd_u64(char *page, char **start, off_t off,
633 int count, int *eof, void *data) { return 0; }
634 static inline int lprocfs_rd_uuid(char *page, char **start, off_t off,
635 int count, int *eof, void *data) { return 0; }
636 static inline int lprocfs_rd_name(char *page, char **start, off_t off,
637 int count, int *eof, void *data) { return 0; }
638 static inline int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
639 int count, int *eof, void *data)
641 static inline int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
642 int count, int *eof, void *data)
644 static inline int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
645 int count, int *eof, void *data)
647 static inline int lprocfs_rd_num_exports(char *page, char **start, off_t off,
648 int count, int *eof, void *data)
650 static inline int lprocfs_rd_numrefs(char *page, char **start, off_t off,
651 int count, int *eof, void *data)
653 static inline int lprocfs_wr_evict_client(struct file *file, const char *buffer,
654 unsigned long count, void *data)
656 static inline int lprocfs_wr_ping(struct file *file, const char *buffer,
657 unsigned long count, void *data)
663 int lprocfs_rd_blksize(char *page, char **start, off_t off,
664 int count, int *eof, void *data) { return 0; }
666 int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
667 int count, int *eof, void *data) { return 0; }
669 int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
670 int count, int *eof, void *data) { return 0; }
672 int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
673 int count, int *eof, void *data) { return 0; }
675 int lprocfs_rd_filestotal(char *page, char **start, off_t off,
676 int count, int *eof, void *data) { return 0; }
678 int lprocfs_rd_filesfree(char *page, char **start, off_t off,
679 int count, int *eof, void *data) { return 0; }
681 int lprocfs_rd_filegroups(char *page, char **start, off_t off,
682 int count, int *eof, void *data) { return 0; }
684 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value) {}
686 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value) {}
688 void lprocfs_oh_clear(struct obd_histogram *oh) {}
690 unsigned long lprocfs_oh_sum(struct obd_histogram *oh) { return 0; }
692 int lprocfs_counter_read(char *page, char **start, off_t off,
693 int count, int *eof, void *data) { return 0; }
695 int lprocfs_counter_write(struct file *file, const char *buffer,
696 unsigned long count, void *data) { return 0; }
699 __u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
700 enum lprocfs_fields_flags field)
703 #define LPROCFS_ENTRY()
704 #define LPROCFS_EXIT()
705 #define LPROCFS_ENTRY_AND_CHECK(dp)
706 #define LPROC_SEQ_FOPS_RO(name)
707 #define LPROC_SEQ_FOPS(name)
711 #endif /* LPROCFS_SNMP_H */