1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see [sun.com URL with a
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/include/lprocfs_status.h
38 * Top level header file for LProc SNMP
40 * Author: Hariharan Thantry thantry@users.sourceforge.net
42 #ifndef _LPROCFS_SNMP_H
43 #define _LPROCFS_SNMP_H
45 #include <lustre/lustre_idl.h>
46 #if defined(__linux__)
47 #include <linux/lprocfs_status.h>
48 #elif defined(__APPLE__)
49 #include <darwin/lprocfs_status.h>
50 #elif defined(__WINNT__)
51 #include <winnt/lprocfs_status.h>
53 #error Unsupported operating system.
57 #if (defined(__KERNEL__) && defined(CONFIG_PROC_FS))
63 cfs_read_proc_t *read_fptr;
64 cfs_write_proc_t *write_fptr;
66 struct file_operations *fops;
69 struct lprocfs_static_vars {
70 struct lprocfs_vars *module_vars;
71 struct lprocfs_vars *obd_vars;
74 /* if we find more consumers this could be generalized */
75 #define OBD_HIST_MAX 32
76 struct obd_histogram {
78 unsigned long oh_buckets[OBD_HIST_MAX];
100 struct obd_histogram hist[BRW_LAST];
104 /* An lprocfs counter can be configured using the enum bit masks below.
106 * LPROCFS_CNTR_EXTERNALLOCK indicates that an external lock already
107 * protects this counter from concurrent updates. If not specified,
108 * lprocfs an internal per-counter lock variable. External locks are
109 * not used to protect counter increments, but are used to protect
110 * counter readout and resets.
112 * LPROCFS_CNTR_AVGMINMAX indicates a multi-valued counter samples,
113 * (i.e. counter can be incremented by more than "1"). When specified,
114 * the counter maintains min, max and sum in addition to a simple
115 * invocation count. This allows averages to be be computed.
116 * If not specified, the counter is an increment-by-1 counter.
117 * min, max, sum, etc. are not maintained.
119 * LPROCFS_CNTR_STDDEV indicates that the counter should track sum of
120 * squares (for multi-valued counter samples only). This allows
121 * external computation of standard deviation, but involves a 64-bit
122 * multiply per counter increment.
126 LPROCFS_CNTR_EXTERNALLOCK = 0x0001,
127 LPROCFS_CNTR_AVGMINMAX = 0x0002,
128 LPROCFS_CNTR_STDDEV = 0x0004,
130 /* counter data type */
131 LPROCFS_TYPE_REGS = 0x0100,
132 LPROCFS_TYPE_BYTES = 0x0200,
133 LPROCFS_TYPE_PAGES = 0x0400,
134 LPROCFS_TYPE_CYCLE = 0x0800,
137 struct lprocfs_atomic {
142 #define LC_MIN_INIT ((~(__u64)0) >> 1)
144 struct lprocfs_counter {
145 struct lprocfs_atomic lc_cntl; /* may need to move to per set */
146 unsigned int lc_config;
152 const char *lc_name; /* must be static */
153 const char *lc_units; /* must be static */
156 struct lprocfs_percpu {
157 struct lprocfs_counter lp_cntr[0];
160 #define LPROCFS_GET_NUM_CPU 0x0001
161 #define LPROCFS_GET_SMP_ID 0x0002
163 enum lprocfs_stats_flags {
164 LPROCFS_STATS_FLAG_PERCPU = 0x0000, /* per cpu counter */
165 LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* stats have no percpu
166 * area and need locking */
169 enum lprocfs_fields_flags {
170 LPROCFS_FIELDS_FLAGS_CONFIG = 0x0001,
171 LPROCFS_FIELDS_FLAGS_SUM = 0x0002,
172 LPROCFS_FIELDS_FLAGS_MIN = 0x0003,
173 LPROCFS_FIELDS_FLAGS_MAX = 0x0004,
174 LPROCFS_FIELDS_FLAGS_AVG = 0x0005,
175 LPROCFS_FIELDS_FLAGS_SUMSQUARE = 0x0006,
176 LPROCFS_FIELDS_FLAGS_COUNT = 0x0007,
179 struct lprocfs_stats {
180 unsigned int ls_num; /* # of counters */
181 int ls_flags; /* See LPROCFS_STATS_FLAG_* */
182 spinlock_t ls_lock; /* Lock used only when there are
183 * no percpu stats areas */
184 struct lprocfs_percpu *ls_percpu[0];
187 static inline int opcode_offset(__u32 opc) {
188 if (opc < OST_LAST_OPC) {
190 return (opc - OST_FIRST_OPC);
191 } else if (opc < MDS_LAST_OPC) {
193 return (opc - MDS_FIRST_OPC +
194 (OST_LAST_OPC - OST_FIRST_OPC));
195 } else if (opc < LDLM_LAST_OPC) {
197 return (opc - LDLM_FIRST_OPC +
198 (MDS_LAST_OPC - MDS_FIRST_OPC) +
199 (OST_LAST_OPC - OST_FIRST_OPC));
200 } else if (opc < MGS_LAST_OPC) {
202 return (opc - MGS_FIRST_OPC +
203 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
204 (MDS_LAST_OPC - MDS_FIRST_OPC) +
205 (OST_LAST_OPC - OST_FIRST_OPC));
206 } else if (opc < OBD_LAST_OPC) {
208 return (opc - OBD_FIRST_OPC +
209 (MGS_LAST_OPC - MGS_FIRST_OPC) +
210 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
211 (MDS_LAST_OPC - MDS_FIRST_OPC) +
212 (OST_LAST_OPC - OST_FIRST_OPC));
213 } else if (opc < LLOG_LAST_OPC) {
215 return (opc - LLOG_FIRST_OPC +
216 (OBD_LAST_OPC - OBD_FIRST_OPC) +
217 (MGS_LAST_OPC - MGS_FIRST_OPC) +
218 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
219 (MDS_LAST_OPC - MDS_FIRST_OPC) +
220 (OST_LAST_OPC - OST_FIRST_OPC));
221 } else if (opc < FLD_LAST_OPC) {
223 return (opc - FLD_FIRST_OPC +
224 (LLOG_LAST_OPC - LLOG_FIRST_OPC) +
225 (OBD_LAST_OPC - OBD_FIRST_OPC) +
226 (MGS_LAST_OPC - MGS_FIRST_OPC) +
227 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
228 (MDS_LAST_OPC - MDS_FIRST_OPC) +
229 (OST_LAST_OPC - OST_FIRST_OPC));
230 } else if (opc < SEQ_LAST_OPC) {
232 return (opc - SEQ_FIRST_OPC +
233 (FLD_LAST_OPC - FLD_FIRST_OPC) +
234 (LLOG_LAST_OPC - LLOG_FIRST_OPC) +
235 (OBD_LAST_OPC - OBD_FIRST_OPC) +
236 (MGS_LAST_OPC - MGS_FIRST_OPC) +
237 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
238 (MDS_LAST_OPC - MDS_FIRST_OPC) +
239 (OST_LAST_OPC - OST_FIRST_OPC));
240 } else if (opc < SEC_LAST_OPC) {
242 return (opc - SEC_FIRST_OPC +
243 (SEQ_LAST_OPC - SEQ_FIRST_OPC) +
244 (FLD_LAST_OPC - FLD_FIRST_OPC) +
245 (LLOG_LAST_OPC - LLOG_FIRST_OPC) +
246 (OBD_LAST_OPC - OBD_FIRST_OPC) +
247 (MGS_LAST_OPC - MGS_FIRST_OPC) +
248 (LDLM_LAST_OPC - LDLM_FIRST_OPC) +
249 (MDS_LAST_OPC - MDS_FIRST_OPC) +
250 (OST_LAST_OPC - OST_FIRST_OPC));
257 #define LUSTRE_MAX_OPCODES ((LDLM_LAST_OPC - LDLM_FIRST_OPC) + \
258 (MDS_LAST_OPC - MDS_FIRST_OPC) + \
259 (OST_LAST_OPC - OST_FIRST_OPC) + \
260 (OBD_LAST_OPC - OBD_FIRST_OPC) + \
261 (FLD_LAST_OPC - FLD_FIRST_OPC) + \
262 (SEQ_LAST_OPC - SEQ_FIRST_OPC) + \
263 (MGS_LAST_OPC - MGS_FIRST_OPC) + \
264 (LLOG_LAST_OPC - LLOG_FIRST_OPC) + \
265 (SEC_LAST_OPC - SEC_FIRST_OPC))
267 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR) + \
268 (EXTRA_LAST_OPC - EXTRA_FIRST_OPC))
271 PTLRPC_REQWAIT_CNTR = 0,
272 PTLRPC_REQQDEPTH_CNTR,
273 PTLRPC_REQACTIVE_CNTR,
275 PTLRPC_REQBUF_AVAIL_CNTR,
279 #define PTLRPC_FIRST_CNTR PTLRPC_REQWAIT_CNTR
282 LDLM_GLIMPSE_ENQUEUE = 0,
296 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
298 extern cfs_proc_dir_entry_t *proc_lustre_root;
302 struct obd_histogram;
304 /* Days / hours / mins / seconds format */
308 static inline void s2dhms(struct dhms *ts, time_t secs)
310 ts->d = secs / 86400;
317 #define DHMS_FMT "%dd%dh%02dm%02ds"
318 #define DHMS_VARS(x) (x)->d, (x)->h, (x)->m, (x)->s
323 static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int type)
327 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
328 if (type & LPROCFS_GET_NUM_CPU)
330 if (type & LPROCFS_GET_SMP_ID)
332 spin_lock(&stats->ls_lock);
334 if (type & LPROCFS_GET_NUM_CPU)
335 rc = num_possible_cpus();
336 if (type & LPROCFS_GET_SMP_ID)
337 rc = smp_processor_id();
342 static inline void lprocfs_stats_unlock(struct lprocfs_stats *stats)
344 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU)
345 spin_unlock(&stats->ls_lock);
348 /* Two optimized LPROCFS counter increment functions are provided:
349 * lprocfs_counter_incr(cntr, value) - optimized for by-one counters
350 * lprocfs_counter_add(cntr) - use for multi-valued counters
351 * Counter data layout allows config flag, counter lock and the
352 * count itself to reside within a single cache line.
355 extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
357 extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
360 #define lprocfs_counter_incr(stats, idx) \
361 lprocfs_counter_add(stats, idx, 1)
362 #define lprocfs_counter_decr(stats, idx) \
363 lprocfs_counter_sub(stats, idx, 1)
365 extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
366 enum lprocfs_fields_flags field);
367 static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
369 enum lprocfs_fields_flags field)
374 LASSERT(stats != NULL);
375 for (i = 0; i < num_possible_cpus(); i++)
376 ret += lprocfs_read_helper(&(stats->ls_percpu[i]->lp_cntr[idx]),
381 extern struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
382 enum lprocfs_stats_flags flags);
383 extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
384 extern void lprocfs_free_stats(struct lprocfs_stats **stats);
385 extern void lprocfs_init_ops_stats(int num_private_stats,
386 struct lprocfs_stats *stats);
387 extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
388 unsigned int num_private_stats);
389 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
390 unsigned conf, const char *name,
392 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
395 extern int lprocfs_add_clear_entry(struct obd_device * obd,
396 cfs_proc_dir_entry_t *entry);
397 extern int lprocfs_exp_setup(struct obd_export *exp,
398 lnet_nid_t *peer_nid, int *newnid);
399 extern int lprocfs_exp_cleanup(struct obd_export *exp);
400 extern int lprocfs_add_simple(struct proc_dir_entry *root,
401 char *name, cfs_read_proc_t *read_proc,
402 cfs_write_proc_t *write_proc, void *data);
403 extern struct proc_dir_entry *lprocfs_add_symlink(const char *name,
404 struct proc_dir_entry *parent, const char *dest);
405 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
406 extern int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
407 unsigned long count, void *data);
408 extern int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
409 int count, int *eof, void *data);
411 extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
412 struct lprocfs_stats *stats);
414 /* lprocfs_status.c */
415 extern int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
416 struct lprocfs_vars *var,
419 extern cfs_proc_dir_entry_t *lprocfs_register(const char *name,
420 cfs_proc_dir_entry_t *parent,
421 struct lprocfs_vars *list,
424 extern void lprocfs_remove(cfs_proc_dir_entry_t **root);
425 extern void lprocfs_remove_proc_entry(const char *name,
426 struct proc_dir_entry *parent);
428 extern cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *root,
431 extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
432 extern int lprocfs_obd_cleanup(struct obd_device *obd);
433 extern int lprocfs_add_simple(struct proc_dir_entry *root, char *name,
434 cfs_read_proc_t *read_proc,
435 cfs_write_proc_t *write_proc,
437 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
438 extern struct file_operations lprocfs_evict_client_fops;
440 extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, char *name,
441 mode_t mode, struct file_operations *seq_fops,
443 extern int lprocfs_obd_seq_create(struct obd_device *dev, char *name,
444 mode_t mode, struct file_operations *seq_fops,
447 /* Generic callbacks */
449 extern int lprocfs_rd_u64(char *page, char **start, off_t off,
450 int count, int *eof, void *data);
451 extern int lprocfs_rd_atomic(char *page, char **start, off_t off,
452 int count, int *eof, void *data);
453 extern int lprocfs_wr_atomic(struct file *file, const char *buffer,
454 unsigned long count, void *data);
455 extern int lprocfs_rd_uint(char *page, char **start, off_t off,
456 int count, int *eof, void *data);
457 extern int lprocfs_wr_uint(struct file *file, const char *buffer,
458 unsigned long count, void *data);
459 extern int lprocfs_rd_uuid(char *page, char **start, off_t off,
460 int count, int *eof, void *data);
461 extern int lprocfs_rd_name(char *page, char **start, off_t off,
462 int count, int *eof, void *data);
463 extern int lprocfs_rd_fstype(char *page, char **start, off_t off,
464 int count, int *eof, void *data);
465 extern int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
466 int count, int *eof, void *data);
467 extern int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
468 int count, int *eof, void *data);
469 extern int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
470 int count, int *eof, void *data);
471 extern int lprocfs_rd_num_exports(char *page, char **start, off_t off,
472 int count, int *eof, void *data);
473 extern int lprocfs_rd_numrefs(char *page, char **start, off_t off,
474 int count, int *eof, void *data);
475 struct adaptive_timeout;
476 extern int lprocfs_at_hist_helper(char *page, int count, int rc,
477 struct adaptive_timeout *at);
478 extern int lprocfs_rd_timeouts(char *page, char **start, off_t off,
479 int count, int *eof, void *data);
480 extern int lprocfs_wr_timeouts(struct file *file, const char *buffer,
481 unsigned long count, void *data);
482 extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
483 unsigned long count, void *data);
484 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
485 unsigned long count, void *data);
488 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
489 int count, int *eof, void *data);
490 extern int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
491 int count, int *eof, void *data);
492 extern int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
493 int count, int *eof, void *data);
494 extern int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
495 int count, int *eof, void *data);
496 extern int lprocfs_rd_filestotal(char *page, char **start, off_t off,
497 int count, int *eof, void *data);
498 extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
499 int count, int *eof, void *data);
500 extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
501 int count, int *eof, void *data);
503 extern int lprocfs_write_helper(const char *buffer, unsigned long count,
505 extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count,
507 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
509 extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
511 extern int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
512 __u64 *val, int mult);
513 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
514 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
515 void lprocfs_oh_clear(struct obd_histogram *oh);
516 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
518 /* lprocfs_status.c: counter read/write functions */
519 extern int lprocfs_counter_read(char *page, char **start, off_t off,
520 int count, int *eof, void *data);
521 extern int lprocfs_counter_write(struct file *file, const char *buffer,
522 unsigned long count, void *data);
524 /* lprocfs_status.c: recovery status */
525 int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
526 int count, int *eof, void *data);
528 extern int lprocfs_seq_release(struct inode *, struct file *);
530 /* in lprocfs_stat.c, to protect the private data for proc entries */
531 extern struct rw_semaphore _lprocfs_lock;
532 #define LPROCFS_ENTRY() do { \
533 down_read(&_lprocfs_lock); \
535 #define LPROCFS_EXIT() do { \
536 up_read(&_lprocfs_lock); \
538 #define LPROCFS_ENTRY_AND_CHECK(dp) do { \
539 typecheck(struct proc_dir_entry *, dp); \
541 if ((dp)->deleted) { \
546 #define LPROCFS_WRITE_ENTRY() do { \
547 down_write(&_lprocfs_lock); \
549 #define LPROCFS_WRITE_EXIT() do { \
550 up_write(&_lprocfs_lock); \
553 /* You must use these macros when you want to refer to
554 * the import in a client obd_device for a lprocfs entry */
555 #define LPROCFS_CLIMP_CHECK(obd) do { \
556 typecheck(struct obd_device *, obd); \
557 down_read(&(obd)->u.cli.cl_sem); \
558 if ((obd)->u.cli.cl_import == NULL) { \
559 up_read(&(obd)->u.cli.cl_sem); \
563 #define LPROCFS_CLIMP_EXIT(obd) \
564 up_read(&(obd)->u.cli.cl_sem);
567 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
568 proc entries; otherwise, you will define name##_seq_write function also for
569 a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
570 call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
571 #define __LPROC_SEQ_FOPS(name, custom_seq_write) \
572 static int name##_seq_open(struct inode *inode, struct file *file) { \
573 struct proc_dir_entry *dp = PDE(inode); \
575 LPROCFS_ENTRY_AND_CHECK(dp); \
576 rc = single_open(file, name##_seq_show, dp->data); \
583 struct file_operations name##_fops = { \
584 .owner = THIS_MODULE, \
585 .open = name##_seq_open, \
587 .write = custom_seq_write, \
588 .llseek = seq_lseek, \
589 .release = lprocfs_seq_release, \
592 #define LPROC_SEQ_FOPS_RO(name) __LPROC_SEQ_FOPS(name, NULL)
593 #define LPROC_SEQ_FOPS(name) __LPROC_SEQ_FOPS(name, name##_seq_write)
596 struct ptlrpc_request;
597 extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
599 /* lprocfs_status.c: read recovery max time bz13079 */
600 int lprocfs_obd_rd_recovery_maxtime(char *page, char **start, off_t off,
601 int count, int *eof, void *data);
603 /* lprocfs_status.c: write recovery max time bz13079 */
604 int lprocfs_obd_wr_recovery_maxtime(struct file *file, const char *buffer,
605 unsigned long count, void *data);
607 /* LPROCFS is not defined */
608 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
609 int index, long amount) { return; }
610 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
611 int index) { return; }
612 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
613 int index, long amount) { return; }
614 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
615 int index, unsigned conf,
616 const char *name, const char *units)
619 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
620 enum lprocfs_fields_flags field)
623 static inline struct lprocfs_stats* lprocfs_alloc_stats(unsigned int num,
624 enum lprocfs_stats_flags flags)
626 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
628 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
630 static inline int lprocfs_register_stats(cfs_proc_dir_entry_t *root,
632 struct lprocfs_stats *stats)
634 static inline void lprocfs_init_ops_stats(int num_private_stats,
635 struct lprocfs_stats *stats)
637 static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
638 unsigned int num_private_stats)
640 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
644 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
646 static inline int lprocfs_exp_setup(struct obd_export *exp,
647 lnet_nid_t *peer_nid, int *newnid)
649 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
651 static inline int lprocfs_add_simple(struct proc_dir_entry *root,
653 cfs_read_proc_t *read_proc,
654 cfs_write_proc_t *write_proc,
657 static inline struct proc_dir_entry *lprocfs_add_symlink(const char *name,
658 struct proc_dir_entry *parent, const char *dest)
660 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
663 int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
664 unsigned long count, void *data)
667 int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
668 int count, int *eof, void *data)
671 static inline cfs_proc_dir_entry_t *
672 lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
673 struct lprocfs_vars *list, void *data) { return NULL; }
674 static inline int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
675 struct lprocfs_vars *var,
676 void *data) { return 0; }
677 static inline void lprocfs_remove(cfs_proc_dir_entry_t **root) {};
678 static inline void lprocfs_remove_proc_entry(const char *name,
679 struct proc_dir_entry *parent) {};
680 static inline cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *head,
681 const char *name) {return 0;}
682 static inline int lprocfs_obd_setup(struct obd_device *dev,
683 struct lprocfs_vars *list) { return 0; }
684 static inline int lprocfs_obd_cleanup(struct obd_device *dev) { return 0; }
685 static inline int lprocfs_rd_u64(char *page, char **start, off_t off,
686 int count, int *eof, void *data) { return 0; }
687 static inline int lprocfs_rd_uuid(char *page, char **start, off_t off,
688 int count, int *eof, void *data) { return 0; }
689 static inline int lprocfs_rd_name(char *page, char **start, off_t off,
690 int count, int *eof, void *data) { return 0; }
691 static inline int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
692 int count, int *eof, void *data)
694 static inline int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
695 int count, int *eof, void *data)
697 static inline int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
698 int count, int *eof, void *data)
700 static inline int lprocfs_rd_num_exports(char *page, char **start, off_t off,
701 int count, int *eof, void *data)
703 static inline int lprocfs_rd_numrefs(char *page, char **start, off_t off,
704 int count, int *eof, void *data)
706 struct adaptive_timeout;
707 static inline int lprocfs_at_hist_helper(char *page, int count, int rc,
708 struct adaptive_timeout *at)
710 static inline int lprocfs_rd_timeouts(char *page, char **start, off_t off,
711 int count, int *eof, void *data)
713 static inline int lprocfs_wr_timeouts(struct file *file, const char *buffer,
714 unsigned long count, void *data)
716 static inline int lprocfs_wr_evict_client(struct file *file, const char *buffer,
717 unsigned long count, void *data)
719 static inline int lprocfs_wr_ping(struct file *file, const char *buffer,
720 unsigned long count, void *data)
726 int lprocfs_rd_blksize(char *page, char **start, off_t off,
727 int count, int *eof, void *data) { return 0; }
729 int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
730 int count, int *eof, void *data) { return 0; }
732 int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
733 int count, int *eof, void *data) { return 0; }
735 int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
736 int count, int *eof, void *data) { return 0; }
738 int lprocfs_rd_filestotal(char *page, char **start, off_t off,
739 int count, int *eof, void *data) { return 0; }
741 int lprocfs_rd_filesfree(char *page, char **start, off_t off,
742 int count, int *eof, void *data) { return 0; }
744 int lprocfs_rd_filegroups(char *page, char **start, off_t off,
745 int count, int *eof, void *data) { return 0; }
747 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value) {}
749 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value) {}
751 void lprocfs_oh_clear(struct obd_histogram *oh) {}
753 unsigned long lprocfs_oh_sum(struct obd_histogram *oh) { return 0; }
755 int lprocfs_counter_read(char *page, char **start, off_t off,
756 int count, int *eof, void *data) { return 0; }
758 int lprocfs_counter_write(struct file *file, const char *buffer,
759 unsigned long count, void *data) { return 0; }
762 __u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
763 enum lprocfs_fields_flags field)
766 #define LPROCFS_ENTRY()
767 #define LPROCFS_EXIT()
768 #define LPROCFS_ENTRY_AND_CHECK(dp)
769 #define LPROC_SEQ_FOPS_RO(name)
770 #define LPROC_SEQ_FOPS(name)
773 #define target_print_req NULL
777 #endif /* LPROCFS_SNMP_H */