Whamcloud - gitweb
LU-5275 lprocfs: remove last of non seq data structs and functions.
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
19  *
20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21  * CA 95054 USA or visit www.sun.com if you need additional information or
22  * have any questions.
23  *
24  * GPL HEADER END
25  */
26 /*
27  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28  * Use is subject to license terms.
29  *
30  * Copyright (c) 2011, 2013, Intel Corporation.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  *
36  * lustre/include/lprocfs_status.h
37  *
38  * Top level header file for LProc SNMP
39  *
40  * Author: Hariharan Thantry thantry@users.sourceforge.net
41  */
42 #ifndef _LPROCFS_SNMP_H
43 #define _LPROCFS_SNMP_H
44
45 #include <lustre/lustre_idl.h>
46 #include <libcfs/params_tree.h>
47
48 struct lprocfs_vars {
49         const char                      *name;
50         const struct file_operations    *fops;
51         void                            *data;
52         /**
53          * /proc file mode.
54          */
55         mode_t                           proc_mode;
56 };
57
58 /* if we find more consumers this could be generalized */
59 #define OBD_HIST_MAX 32
60 struct obd_histogram {
61         spinlock_t      oh_lock;
62         unsigned long   oh_buckets[OBD_HIST_MAX];
63 };
64
65 enum {
66         BRW_R_PAGES = 0,
67         BRW_W_PAGES,
68         BRW_R_RPC_HIST,
69         BRW_W_RPC_HIST,
70         BRW_R_IO_TIME,
71         BRW_W_IO_TIME,
72         BRW_R_DISCONT_PAGES,
73         BRW_W_DISCONT_PAGES,
74         BRW_R_DISCONT_BLOCKS,
75         BRW_W_DISCONT_BLOCKS,
76         BRW_R_DISK_IOSIZE,
77         BRW_W_DISK_IOSIZE,
78         BRW_R_DIO_FRAGS,
79         BRW_W_DIO_FRAGS,
80         BRW_LAST,
81 };
82
83 struct brw_stats {
84         struct obd_histogram hist[BRW_LAST];
85 };
86
87 enum {
88         RENAME_SAMEDIR_SIZE = 0,
89         RENAME_CROSSDIR_SRC_SIZE,
90         RENAME_CROSSDIR_TGT_SIZE,
91         RENAME_LAST,
92 };
93
94 struct rename_stats {
95         struct obd_histogram hist[RENAME_LAST];
96 };
97
98 /* An lprocfs counter can be configured using the enum bit masks below.
99  *
100  * LPROCFS_CNTR_EXTERNALLOCK indicates that an external lock already
101  * protects this counter from concurrent updates. If not specified,
102  * lprocfs an internal per-counter lock variable. External locks are
103  * not used to protect counter increments, but are used to protect
104  * counter readout and resets.
105  *
106  * LPROCFS_CNTR_AVGMINMAX indicates a multi-valued counter samples,
107  * (i.e. counter can be incremented by more than "1"). When specified,
108  * the counter maintains min, max and sum in addition to a simple
109  * invocation count. This allows averages to be be computed.
110  * If not specified, the counter is an increment-by-1 counter.
111  * min, max, sum, etc. are not maintained.
112  *
113  * LPROCFS_CNTR_STDDEV indicates that the counter should track sum of
114  * squares (for multi-valued counter samples only). This allows
115  * external computation of standard deviation, but involves a 64-bit
116  * multiply per counter increment.
117  */
118
119 enum {
120         LPROCFS_CNTR_EXTERNALLOCK = 0x0001,
121         LPROCFS_CNTR_AVGMINMAX    = 0x0002,
122         LPROCFS_CNTR_STDDEV       = 0x0004,
123
124         /* counter data type */
125         LPROCFS_TYPE_REGS         = 0x0100,
126         LPROCFS_TYPE_BYTES        = 0x0200,
127         LPROCFS_TYPE_PAGES        = 0x0400,
128         LPROCFS_TYPE_CYCLE        = 0x0800,
129 };
130
131 #define LC_MIN_INIT ((~(__u64)0) >> 1)
132
133 struct lprocfs_counter_header {
134         unsigned int            lc_config;
135         const char              *lc_name;   /* must be static */
136         const char              *lc_units;  /* must be static */
137 };
138
139 struct lprocfs_counter {
140         __s64   lc_count;
141         __s64   lc_min;
142         __s64   lc_max;
143         __s64   lc_sumsquare;
144         /*
145          * Every counter has lc_array_sum[0], while lc_array_sum[1] is only
146          * for irq context counter, i.e. stats with
147          * LPROCFS_STATS_FLAG_IRQ_SAFE flag, its counter need
148          * lc_array_sum[1]
149          */
150         __s64   lc_array_sum[1];
151 };
152 #define lc_sum          lc_array_sum[0]
153 #define lc_sum_irq      lc_array_sum[1]
154
155 struct lprocfs_percpu {
156         struct lprocfs_counter lp_cntr[0];
157 };
158
159 #define LPROCFS_GET_NUM_CPU 0x0001
160 #define LPROCFS_GET_SMP_ID  0x0002
161
162 enum lprocfs_stats_flags {
163         LPROCFS_STATS_FLAG_NONE     = 0x0000, /* per cpu counter */
164         LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* stats have no percpu
165                                                * area and need locking */
166         LPROCFS_STATS_FLAG_IRQ_SAFE = 0x0002, /* alloc need irq safe */
167 };
168
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,
177 };
178
179 struct lprocfs_stats {
180         /* # of counters */
181         unsigned short                  ls_num;
182         /* 1 + the biggest cpu # whose ls_percpu slot has been allocated */
183         unsigned short                  ls_biggest_alloc_num;
184         enum lprocfs_stats_flags        ls_flags;
185         /* Lock used when there are no percpu stats areas; For percpu stats,
186          * it is used to protect ls_biggest_alloc_num change */
187         spinlock_t                      ls_lock;
188
189         /* has ls_num of counter headers */
190         struct lprocfs_counter_header   *ls_cnt_header;
191         struct lprocfs_percpu           *ls_percpu[0];
192 };
193
194 #define OPC_RANGE(seg) (seg ## _LAST_OPC - seg ## _FIRST_OPC)
195
196 /* Pack all opcodes down into a single monotonically increasing index */
197 static inline int opcode_offset(__u32 opc) {
198         if (opc < OST_LAST_OPC) {
199                  /* OST opcode */
200                 return (opc - OST_FIRST_OPC);
201         } else if (opc < MDS_LAST_OPC) {
202                 /* MDS opcode */
203                 return (opc - MDS_FIRST_OPC +
204                         OPC_RANGE(OST));
205         } else if (opc < LDLM_LAST_OPC) {
206                 /* LDLM Opcode */
207                 return (opc - LDLM_FIRST_OPC +
208                         OPC_RANGE(MDS) +
209                         OPC_RANGE(OST));
210         } else if (opc < MGS_LAST_OPC) {
211                 /* MGS Opcode */
212                 return (opc - MGS_FIRST_OPC +
213                         OPC_RANGE(LDLM) +
214                         OPC_RANGE(MDS) +
215                         OPC_RANGE(OST));
216         } else if (opc < OBD_LAST_OPC) {
217                 /* OBD Ping */
218                 return (opc - OBD_FIRST_OPC +
219                         OPC_RANGE(MGS) +
220                         OPC_RANGE(LDLM) +
221                         OPC_RANGE(MDS) +
222                         OPC_RANGE(OST));
223         } else if (opc < LLOG_LAST_OPC) {
224                 /* LLOG Opcode */
225                 return (opc - LLOG_FIRST_OPC +
226                         OPC_RANGE(OBD) +
227                         OPC_RANGE(MGS) +
228                         OPC_RANGE(LDLM) +
229                         OPC_RANGE(MDS) +
230                         OPC_RANGE(OST));
231         } else if (opc < QUOTA_LAST_OPC) {
232                 /* LQUOTA Opcode */
233                 return (opc - QUOTA_FIRST_OPC +
234                         OPC_RANGE(LLOG) +
235                         OPC_RANGE(OBD) +
236                         OPC_RANGE(MGS) +
237                         OPC_RANGE(LDLM) +
238                         OPC_RANGE(MDS) +
239                         OPC_RANGE(OST));
240         } else if (opc < SEQ_LAST_OPC) {
241                 /* SEQ opcode */
242                 return (opc - SEQ_FIRST_OPC +
243                         OPC_RANGE(QUOTA) +
244                         OPC_RANGE(LLOG) +
245                         OPC_RANGE(OBD) +
246                         OPC_RANGE(MGS) +
247                         OPC_RANGE(LDLM) +
248                         OPC_RANGE(MDS) +
249                         OPC_RANGE(OST));
250         } else if (opc < SEC_LAST_OPC) {
251                 /* SEC opcode */
252                 return (opc - SEC_FIRST_OPC +
253                         OPC_RANGE(SEQ) +
254                         OPC_RANGE(QUOTA) +
255                         OPC_RANGE(LLOG) +
256                         OPC_RANGE(OBD) +
257                         OPC_RANGE(MGS) +
258                         OPC_RANGE(LDLM) +
259                         OPC_RANGE(MDS) +
260                         OPC_RANGE(OST));
261         } else if (opc < FLD_LAST_OPC) {
262                 /* FLD opcode */
263                  return (opc - FLD_FIRST_OPC +
264                         OPC_RANGE(SEC) +
265                         OPC_RANGE(SEQ) +
266                         OPC_RANGE(QUOTA) +
267                         OPC_RANGE(LLOG) +
268                         OPC_RANGE(OBD) +
269                         OPC_RANGE(MGS) +
270                         OPC_RANGE(LDLM) +
271                         OPC_RANGE(MDS) +
272                         OPC_RANGE(OST));
273         } else if (opc < OUT_UPDATE_LAST_OPC) {
274                 /* update opcode */
275                 return (opc - OUT_UPDATE_FIRST_OPC +
276                         OPC_RANGE(FLD) +
277                         OPC_RANGE(SEC) +
278                         OPC_RANGE(SEQ) +
279                         OPC_RANGE(QUOTA) +
280                         OPC_RANGE(LLOG) +
281                         OPC_RANGE(OBD) +
282                         OPC_RANGE(MGS) +
283                         OPC_RANGE(LDLM) +
284                         OPC_RANGE(MDS) +
285                         OPC_RANGE(OST));
286         } else if (opc < LFSCK_LAST_OPC) {
287                 /* LFSCK opcode */
288                 return (opc - LFSCK_FIRST_OPC +
289                         OPC_RANGE(OUT_UPDATE) +
290                         OPC_RANGE(FLD) +
291                         OPC_RANGE(SEC) +
292                         OPC_RANGE(SEQ) +
293                         OPC_RANGE(QUOTA) +
294                         OPC_RANGE(LLOG) +
295                         OPC_RANGE(OBD) +
296                         OPC_RANGE(MGS) +
297                         OPC_RANGE(LDLM) +
298                         OPC_RANGE(MDS) +
299                         OPC_RANGE(OST));
300         } else {
301                 /* Unknown Opcode */
302                 return -1;
303         }
304 }
305
306
307 #define LUSTRE_MAX_OPCODES (OPC_RANGE(OST)  + \
308                             OPC_RANGE(MDS)  + \
309                             OPC_RANGE(LDLM) + \
310                             OPC_RANGE(MGS)  + \
311                             OPC_RANGE(OBD)  + \
312                             OPC_RANGE(LLOG) + \
313                             OPC_RANGE(SEC)  + \
314                             OPC_RANGE(SEQ)  + \
315                             OPC_RANGE(SEC)  + \
316                             OPC_RANGE(FLD)  + \
317                             OPC_RANGE(OUT_UPDATE) + \
318                             OPC_RANGE(LFSCK))
319
320 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
321                             OPC_RANGE(EXTRA))
322
323 enum {
324         PTLRPC_REQWAIT_CNTR = 0,
325         PTLRPC_REQQDEPTH_CNTR,
326         PTLRPC_REQACTIVE_CNTR,
327         PTLRPC_TIMEOUT,
328         PTLRPC_REQBUF_AVAIL_CNTR,
329         PTLRPC_LAST_CNTR
330 };
331
332 #define PTLRPC_FIRST_CNTR PTLRPC_REQWAIT_CNTR
333
334 enum lprocfs_extra_opc {
335         LDLM_GLIMPSE_ENQUEUE = 0,
336         LDLM_PLAIN_ENQUEUE,
337         LDLM_EXTENT_ENQUEUE,
338         LDLM_FLOCK_ENQUEUE,
339         LDLM_IBITS_ENQUEUE,
340         MDS_REINT_SETATTR,
341         MDS_REINT_CREATE,
342         MDS_REINT_LINK,
343         MDS_REINT_UNLINK,
344         MDS_REINT_RENAME,
345         MDS_REINT_OPEN,
346         MDS_REINT_SETXATTR,
347         BRW_READ_BYTES,
348         BRW_WRITE_BYTES,
349         EXTRA_LAST_OPC
350 };
351
352 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
353 /* class_obd.c */
354 extern struct proc_dir_entry *proc_lustre_root;
355
356 struct obd_device;
357 struct obd_histogram;
358
359 /* Days / hours / mins / seconds format */
360 struct dhms {
361         int d,h,m,s;
362 };
363 static inline void s2dhms(struct dhms *ts, time_t secs)
364 {
365         ts->d = secs / 86400;
366         secs = secs % 86400;
367         ts->h = secs / 3600;
368         secs = secs % 3600;
369         ts->m = secs / 60;
370         ts->s = secs % 60;
371 }
372 #define DHMS_FMT "%dd%dh%02dm%02ds"
373 #define DHMS_VARS(x) (x)->d, (x)->h, (x)->m, (x)->s
374
375 #define JOBSTATS_JOBID_VAR_MAX_LEN      20
376 #define JOBSTATS_DISABLE                "disable"
377 #define JOBSTATS_PROCNAME_UID           "procname_uid"
378
379 typedef void (*cntr_init_callback)(struct lprocfs_stats *stats);
380
381 struct obd_job_stats {
382         cfs_hash_t             *ojs_hash;
383         struct list_head        ojs_list;
384         rwlock_t                ojs_lock; /* protect the obj_list */
385         cntr_init_callback      ojs_cntr_init_fn;
386         int                     ojs_cntr_num;
387         int                     ojs_cleanup_interval;
388         time_t                  ojs_last_cleanup;
389 };
390
391 #ifdef LPROCFS
392
393 extern int lprocfs_stats_alloc_one(struct lprocfs_stats *stats,
394                                    unsigned int cpuid);
395 /*
396  * \return value
397  *      < 0     : on error (only possible for opc as LPROCFS_GET_SMP_ID)
398  */
399 static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int opc,
400                                      unsigned long *flags)
401 {
402         int             rc = 0;
403
404         switch (opc) {
405         default:
406                 LBUG();
407
408         case LPROCFS_GET_SMP_ID:
409                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
410                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE)
411                                 spin_lock_irqsave(&stats->ls_lock, *flags);
412                         else
413                                 spin_lock(&stats->ls_lock);
414                         return 0;
415                 } else {
416                         unsigned int cpuid = get_cpu();
417
418                         if (unlikely(stats->ls_percpu[cpuid] == NULL)) {
419                                 rc = lprocfs_stats_alloc_one(stats, cpuid);
420                                 if (rc < 0) {
421                                         put_cpu();
422                                         return rc;
423                                 }
424                         }
425                         return cpuid;
426                 }
427
428         case LPROCFS_GET_NUM_CPU:
429                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
430                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE)
431                                 spin_lock_irqsave(&stats->ls_lock, *flags);
432                         else
433                                 spin_lock(&stats->ls_lock);
434                         return 1;
435                 } else {
436                         return stats->ls_biggest_alloc_num;
437                 }
438         }
439 }
440
441 static inline void lprocfs_stats_unlock(struct lprocfs_stats *stats, int opc,
442                                         unsigned long *flags)
443 {
444         switch (opc) {
445         default:
446                 LBUG();
447
448         case LPROCFS_GET_SMP_ID:
449                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
450                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) {
451                                 spin_unlock_irqrestore(&stats->ls_lock,
452                                                            *flags);
453                         } else {
454                                 spin_unlock(&stats->ls_lock);
455                         }
456                 } else {
457                         put_cpu();
458                 }
459                 return;
460
461         case LPROCFS_GET_NUM_CPU:
462                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
463                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) {
464                                 spin_unlock_irqrestore(&stats->ls_lock,
465                                                            *flags);
466                         } else {
467                                 spin_unlock(&stats->ls_lock);
468                         }
469                 }
470                 return;
471         }
472 }
473
474 static inline unsigned int
475 lprocfs_stats_counter_size(struct lprocfs_stats *stats)
476 {
477         unsigned int percpusize;
478
479         percpusize = offsetof(struct lprocfs_percpu, lp_cntr[stats->ls_num]);
480
481         /* irq safe stats need lc_array_sum[1] */
482         if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
483                 percpusize += stats->ls_num * sizeof(__s64);
484
485         if ((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0)
486                 percpusize = L1_CACHE_ALIGN(percpusize);
487
488         return percpusize;
489 }
490
491 static inline struct lprocfs_counter *
492 lprocfs_stats_counter_get(struct lprocfs_stats *stats, unsigned int cpuid,
493                           int index)
494 {
495         struct lprocfs_counter *cntr;
496
497         cntr = &stats->ls_percpu[cpuid]->lp_cntr[index];
498
499         if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
500                 cntr = (void *)cntr + index * sizeof(__s64);
501
502         return cntr;
503 }
504
505 /* Two optimized LPROCFS counter increment functions are provided:
506  *     lprocfs_counter_incr(cntr, value) - optimized for by-one counters
507  *     lprocfs_counter_add(cntr) - use for multi-valued counters
508  * Counter data layout allows config flag, counter lock and the
509  * count itself to reside within a single cache line.
510  */
511
512 extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
513                                 long amount);
514 extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
515                                 long amount);
516
517 #define lprocfs_counter_incr(stats, idx) \
518         lprocfs_counter_add(stats, idx, 1)
519 #define lprocfs_counter_decr(stats, idx) \
520         lprocfs_counter_sub(stats, idx, 1)
521
522 extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
523                                  struct lprocfs_counter_header *header,
524                                  enum lprocfs_stats_flags flags,
525                                  enum lprocfs_fields_flags field);
526 static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
527                                             int idx,
528                                             enum lprocfs_fields_flags field)
529 {
530         unsigned int  i;
531         unsigned int  num_cpu;
532         unsigned long flags     = 0;
533         __u64         ret       = 0;
534
535         LASSERT(stats != NULL);
536
537         num_cpu = lprocfs_stats_lock(stats, LPROCFS_GET_NUM_CPU, &flags);
538         for (i = 0; i < num_cpu; i++) {
539                 if (stats->ls_percpu[i] == NULL)
540                         continue;
541                 ret += lprocfs_read_helper(
542                                 lprocfs_stats_counter_get(stats, i, idx),
543                                 &stats->ls_cnt_header[idx], stats->ls_flags,
544                                 field);
545         }
546         lprocfs_stats_unlock(stats, LPROCFS_GET_NUM_CPU, &flags);
547         return ret;
548 }
549
550 extern struct lprocfs_stats *
551 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
552 extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
553 extern void lprocfs_free_stats(struct lprocfs_stats **stats);
554 extern void lprocfs_init_ops_stats(int num_private_stats,
555                                    struct lprocfs_stats *stats);
556 extern void lprocfs_init_mps_stats(int num_private_stats,
557                                    struct lprocfs_stats *stats);
558 extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
559 extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
560                                    unsigned int num_private_stats);
561 extern int lprocfs_alloc_md_stats(struct obd_device *obddev,
562                                   unsigned int num_private_stats);
563 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
564                                  unsigned conf, const char *name,
565                                  const char *units);
566 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
567 extern void lprocfs_free_md_stats(struct obd_device *obddev);
568 struct obd_export;
569 struct nid_stat;
570 extern int lprocfs_add_clear_entry(struct obd_device * obd,
571                                    struct proc_dir_entry *entry);
572 #ifdef HAVE_SERVER_SUPPORT
573 extern int lprocfs_exp_setup(struct obd_export *exp,
574                              lnet_nid_t *peer_nid, int *newnid);
575 extern int lprocfs_exp_cleanup(struct obd_export *exp);
576 #else
577 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
578 { return 0; }
579 #endif
580 extern struct proc_dir_entry *
581 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
582                    void *data, const struct file_operations *fops);
583 extern struct proc_dir_entry *
584 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
585                     const char *format, ...);
586 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
587 #ifdef HAVE_SERVER_SUPPORT
588 extern ssize_t
589 lprocfs_nid_stats_clear_seq_write(struct file *file, const char *buffer,
590                                         size_t count, loff_t *off);
591 extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data);
592 #endif
593 extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
594                                   struct lprocfs_stats *stats);
595
596 /* lprocfs_status.c */
597 extern int lprocfs_add_vars(struct proc_dir_entry *root,
598                             struct lprocfs_vars *var, void *data);
599 extern struct proc_dir_entry *
600 lprocfs_register(const char *name, struct proc_dir_entry *parent,
601                  struct lprocfs_vars *list, void *data);
602 extern void lprocfs_remove(struct proc_dir_entry **root);
603 extern void lprocfs_remove_proc_entry(const char *name,
604                                       struct proc_dir_entry *parent);
605 #ifndef HAVE_ONLY_PROCFS_SEQ
606 extern void remove_proc_subtree(const char *name,
607                                 struct proc_dir_entry *parent);
608 #endif
609 extern int lprocfs_obd_setup(struct obd_device *dev);
610 extern int lprocfs_obd_cleanup(struct obd_device *obd);
611 #ifdef HAVE_SERVER_SUPPORT
612 extern const struct file_operations lprocfs_evict_client_fops;
613 #endif
614 extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name,
615                               mode_t mode,
616                               const struct file_operations *seq_fops,
617                               void *data);
618 extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name,
619                                   mode_t mode,
620                                   const struct file_operations *seq_fops,
621                                   void *data);
622
623 /* Generic callbacks */
624 extern int lprocfs_u64_seq_show(struct seq_file *m, void *data);
625 extern int lprocfs_atomic_seq_show(struct seq_file *m, void *data);
626 extern ssize_t lprocfs_atomic_seq_write(struct file *file,
627                                         const char __user *buffer,
628                                         size_t count, loff_t *off);
629 extern int lprocfs_uint_seq_show(struct seq_file *m, void *data);
630 extern ssize_t lprocfs_uint_seq_write(struct file *file,
631                                       const char __user *buffer,
632                                       size_t count, loff_t *off);
633 extern int lprocfs_wr_uint(struct file *file, const char __user *buffer,
634                            unsigned long count, void *data);
635 extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data);
636 extern int lprocfs_name_seq_show(struct seq_file *m, void *data);
637 extern int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data);
638 extern int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data);
639 extern int lprocfs_import_seq_show(struct seq_file *m, void *data);
640 extern int lprocfs_state_seq_show(struct seq_file *m, void *data);
641 extern int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data);
642 #ifdef HAVE_SERVER_SUPPORT
643 extern int lprocfs_num_exports_seq_show(struct seq_file *m, void *data);
644 #endif
645 struct adaptive_timeout;
646 extern int lprocfs_at_hist_helper(struct seq_file *m,
647                                       struct adaptive_timeout *at);
648 extern int lprocfs_timeouts_seq_show(struct seq_file *m, void *data);
649 extern ssize_t
650 lprocfs_timeouts_seq_write(struct file *file, const char *buffer,
651                            size_t count, loff_t *off);
652 #ifdef HAVE_SERVER_SUPPORT
653 extern ssize_t
654 lprocfs_evict_client_seq_write(struct file *file, const char *buffer,
655                                 size_t count, loff_t *off);
656 #endif
657 extern ssize_t
658 lprocfs_ping_seq_write(struct file *file, const char *buffer,
659                        size_t count, loff_t *off);
660 extern ssize_t
661 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
662                          size_t count, loff_t *off);
663 extern int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data);
664 extern ssize_t
665 lprocfs_pinger_recov_seq_write(struct file *file, const char *buffer,
666                                size_t count, loff_t *off);
667
668 /* Statfs helpers */
669 extern int lprocfs_blksize_seq_show(struct seq_file *m, void *data);
670 extern int lprocfs_kbytestotal_seq_show(struct seq_file *m, void *data);
671 extern int lprocfs_kbytesfree_seq_show(struct seq_file *m, void *data);
672 extern int lprocfs_kbytesavail_seq_show(struct seq_file *m, void *data);
673 extern int lprocfs_filestotal_seq_show(struct seq_file *m, void *data);
674 extern int lprocfs_filesfree_seq_show(struct seq_file *m, void *data);
675
676 extern int lprocfs_write_helper(const char __user *buffer, unsigned long count,
677                                 int *val);
678 extern int lprocfs_write_frac_helper(const char __user *buffer,
679                                      unsigned long count,
680                                      int *val, int mult);
681 extern int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int mult);
682 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
683                                     long val, int mult);
684 extern int lprocfs_write_u64_helper(const char __user *buffer,
685                                     unsigned long count, __u64 *val);
686 extern int lprocfs_write_frac_u64_helper(const char __user *buffer,
687                                          unsigned long count,
688                                          __u64 *val, int mult);
689 char *lprocfs_find_named_value(const char *buffer, const char *name,
690                                 size_t *count);
691 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
692 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
693 void lprocfs_oh_clear(struct obd_histogram *oh);
694 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
695
696 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
697                            struct lprocfs_counter *cnt);
698
699 #ifdef HAVE_SERVER_SUPPORT
700 /* lprocfs_status.c: recovery status */
701 int lprocfs_recovery_status_seq_show(struct seq_file *m, void *data);
702
703 /* lprocfs_status.c: hash statistics */
704 int lprocfs_hash_seq_show(struct seq_file *m, void *data);
705
706 /* lprocfs_status.c: IR factor */
707 int lprocfs_ir_factor_seq_show(struct seq_file *m, void *data);
708 ssize_t
709 lprocfs_ir_factor_seq_write(struct file *file, const char *buffer,
710                                 size_t count, loff_t *off);
711 #endif
712 extern int lprocfs_single_release(struct inode *, struct file *);
713 extern int lprocfs_seq_release(struct inode *, struct file *);
714
715 /* You must use these macros when you want to refer to
716  * the import in a client obd_device for a lprocfs entry */
717 #define LPROCFS_CLIMP_CHECK(obd) do {           \
718         typecheck(struct obd_device *, obd);    \
719         down_read(&(obd)->u.cli.cl_sem);    \
720         if ((obd)->u.cli.cl_import == NULL) {   \
721              up_read(&(obd)->u.cli.cl_sem); \
722              return -ENODEV;                    \
723         }                                       \
724 } while(0)
725 #define LPROCFS_CLIMP_EXIT(obd)                 \
726         up_read(&(obd)->u.cli.cl_sem);
727
728 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
729   proc entries; otherwise, you will define name##_seq_write function also for
730   a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
731   call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
732 #define __LPROC_SEQ_FOPS(name, custom_seq_write)                        \
733 static int name##_single_open(struct inode *inode, struct file *file)   \
734 {                                                                       \
735         LPROCFS_ENTRY_CHECK(PDE(inode));                                \
736         return single_open(file, name##_seq_show, PDE_DATA(inode));     \
737 }                                                                       \
738 struct file_operations name##_fops = {                                  \
739         .owner   = THIS_MODULE,                                         \
740         .open    = name##_single_open,                                  \
741         .read    = seq_read,                                            \
742         .write   = custom_seq_write,                                    \
743         .llseek  = seq_lseek,                                           \
744         .release = lprocfs_single_release,                              \
745 }
746
747 #define LPROC_SEQ_FOPS_RO(name)         __LPROC_SEQ_FOPS(name, NULL)
748 #define LPROC_SEQ_FOPS(name)            __LPROC_SEQ_FOPS(name, name##_seq_write)
749
750 #define LPROC_SEQ_FOPS_RO_TYPE(name, type)                              \
751         static int name##_##type##_seq_show(struct seq_file *m, void *v)\
752         {                                                               \
753                 return lprocfs_##type##_seq_show(m, m->private);        \
754         }                                                               \
755         LPROC_SEQ_FOPS_RO(name##_##type)
756
757 #define LPROC_SEQ_FOPS_RW_TYPE(name, type)                              \
758         static int name##_##type##_seq_show(struct seq_file *m, void *v)\
759         {                                                               \
760                 return lprocfs_##type##_seq_show(m, m->private);        \
761         }                                                               \
762         static ssize_t name##_##type##_seq_write(struct file *file,     \
763                         const char __user *buffer, size_t count,        \
764                         loff_t *off)                                    \
765         {                                                               \
766                 struct seq_file *seq = file->private_data;              \
767                 return lprocfs_##type##_seq_write(file, buffer,         \
768                                                 count, seq->private);   \
769         }                                                               \
770         LPROC_SEQ_FOPS(name##_##type);
771
772 #define LPROC_SEQ_FOPS_WO_TYPE(name, type)                              \
773         static ssize_t name##_##type##_write(struct file *file,         \
774                         const char __user *buffer, size_t count,        \
775                         loff_t *off)                                    \
776         {                                                               \
777                 return lprocfs_##type##_seq_write(file, buffer, count, off);\
778         }                                                               \
779         static int name##_##type##_open(struct inode *inode, struct file *file)\
780         {                                                               \
781                 return single_open(file, NULL, PDE_DATA(inode));        \
782         }                                                               \
783         struct file_operations name##_##type##_fops = {                 \
784                 .open    = name##_##type##_open,                        \
785                 .write   = name##_##type##_write,                       \
786                 .release = lprocfs_single_release,                      \
787         };
788
789 /* lproc_ptlrpc.c */
790 struct ptlrpc_request;
791 extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
792
793 #ifdef HAVE_SERVER_SUPPORT
794 /* lprocfs_jobstats.c */
795 int lprocfs_job_stats_log(struct obd_device *obd, char *jobid,
796                           int event, long amount);
797 void lprocfs_job_stats_fini(struct obd_device *obd);
798 int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num,
799                            cntr_init_callback fn);
800 int lprocfs_job_interval_seq_show(struct seq_file *m, void *data);
801 ssize_t
802 lprocfs_job_interval_seq_write(struct file *file, const char *buffer,
803                                 size_t count, loff_t *off);
804 /* lproc_status.c */
805 int lprocfs_recovery_time_soft_seq_show(struct seq_file *m, void *data);
806 ssize_t lprocfs_recovery_time_soft_seq_write(struct file *file,
807                                                 const char *buffer,
808                                                 size_t count, loff_t *off);
809 int lprocfs_recovery_time_hard_seq_show(struct seq_file *m, void *data);
810 ssize_t
811 lprocfs_recovery_time_hard_seq_write(struct file *file, const char *buffer,
812                                         size_t count, loff_t *off);
813 int lprocfs_target_instance_seq_show(struct seq_file *m, void *data);
814 #endif
815 int lprocfs_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *data);
816 ssize_t
817 lprocfs_obd_max_pages_per_rpc_seq_write(struct file *file, const char *buffer,
818                                        size_t count, loff_t *off);
819
820 struct root_squash_info;
821 int lprocfs_wr_root_squash(const char __user *buffer, unsigned long count,
822                            struct root_squash_info *squash, char *name);
823 int lprocfs_wr_nosquash_nids(const char __user *buffer, unsigned long count,
824                              struct root_squash_info *squash, char *name);
825
826 /* all quota proc functions */
827 extern int lprocfs_quota_rd_bunit(char *page, char **start,
828                                   off_t off, int count,
829                                   int *eof, void *data);
830 extern int lprocfs_quota_wr_bunit(struct file *file, const char *buffer,
831                                   unsigned long count, void *data);
832 extern int lprocfs_quota_rd_btune(char *page, char **start,
833                                   off_t off, int count,
834                                   int *eof, void *data);
835 extern int lprocfs_quota_wr_btune(struct file *file, const char *buffer,
836                                   unsigned long count, void *data);
837 extern int lprocfs_quota_rd_iunit(char *page, char **start,
838                                   off_t off, int count,
839                                   int *eof, void *data);
840 extern int lprocfs_quota_wr_iunit(struct file *file, const char *buffer,
841                                   unsigned long count, void *data);
842 extern int lprocfs_quota_rd_itune(char *page, char **start,
843                                   off_t off, int count,
844                                   int *eof, void *data);
845 extern int lprocfs_quota_wr_itune(struct file *file, const char *buffer,
846                                   unsigned long count, void *data);
847 extern int lprocfs_quota_rd_type(char *page, char **start, off_t off, int count,
848                                  int *eof, void *data);
849 extern int lprocfs_quota_wr_type(struct file *file, const char *buffer,
850                                  unsigned long count, void *data);
851 extern int lprocfs_quota_rd_switch_seconds(char *page, char **start, off_t off,
852                                            int count, int *eof, void *data);
853 extern int lprocfs_quota_wr_switch_seconds(struct file *file,
854                                            const char *buffer,
855                                            unsigned long count, void *data);
856 extern int lprocfs_quota_rd_sync_blk(char *page, char **start, off_t off,
857                                      int count, int *eof, void *data);
858 extern int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
859                                      unsigned long count, void *data);
860 extern int lprocfs_quota_rd_switch_qs(char *page, char **start, off_t off,
861                                       int count, int *eof, void *data);
862 extern int lprocfs_quota_wr_switch_qs(struct file *file,
863                                       const char *buffer,
864                                       unsigned long count, void *data);
865 extern int lprocfs_quota_rd_boundary_factor(char *page, char **start, off_t off,
866                                             int count, int *eof, void *data);
867 extern int lprocfs_quota_wr_boundary_factor(struct file *file,
868                                             const char *buffer,
869                                             unsigned long count, void *data);
870 extern int lprocfs_quota_rd_least_bunit(char *page, char **start, off_t off,
871                                         int count, int *eof, void *data);
872 extern int lprocfs_quota_wr_least_bunit(struct file *file,
873                                         const char *buffer,
874                                         unsigned long count, void *data);
875 extern int lprocfs_quota_rd_least_iunit(char *page, char **start, off_t off,
876                                         int count, int *eof, void *data);
877 extern int lprocfs_quota_wr_least_iunit(struct file *file,
878                                         const char *buffer,
879                                         unsigned long count, void *data);
880 extern int lprocfs_quota_rd_qs_factor(char *page, char **start, off_t off,
881                                       int count, int *eof, void *data);
882 extern int lprocfs_quota_wr_qs_factor(struct file *file,
883                                       const char *buffer,
884                                       unsigned long count, void *data);
885 #else
886 /* LPROCFS is not defined */
887
888 #define proc_lustre_root NULL
889
890 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
891                                        int index, long amount)
892 { return; }
893 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
894                                         int index)
895 { return; }
896 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
897                                        int index, long amount)
898 { return; }
899 static inline void lprocfs_counter_decr(struct lprocfs_stats *stats,
900                                         int index)
901 { return; }
902 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
903                                         int index, unsigned conf,
904                                         const char *name, const char *units)
905 { return; }
906
907 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
908                                    enum lprocfs_fields_flags field)
909 { return 0; }
910
911 /* NB: we return !NULL to satisfy error checker */
912 static inline struct lprocfs_stats *
913 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags)
914 { return (struct lprocfs_stats *)1; }
915 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
916 { return; }
917 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
918 { return; }
919 static inline int lprocfs_register_stats(struct proc_dir_entry *root,
920                                          const char *name,
921                                          struct lprocfs_stats *stats)
922 { return 0; }
923 static inline void lprocfs_init_ops_stats(int num_private_stats,
924                                           struct lprocfs_stats *stats)
925 { return; }
926 static inline void lprocfs_init_mps_stats(int num_private_stats,
927                                           struct lprocfs_stats *stats)
928 { return; }
929 static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
930 { return; }
931 static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
932                                           unsigned int num_private_stats)
933 { return 0; }
934 static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
935                                          unsigned int num_private_stats)
936 { return 0; }
937 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
938 { return; }
939 static inline void lprocfs_free_md_stats(struct obd_device *obddev)
940 { return; }
941
942 struct obd_export;
943 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
944 { return 0; }
945 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
946 { return; }
947 #ifdef HAVE_SERVER_SUPPORT
948 static inline
949 ssize_t lprocfs_nid_stats_seq_write(struct file *file, const char *buffer,
950                                         size_t count, loff_t *off)
951 {return 0;}
952 static inline
953 int lprocfs_nid_stats_clear_seq_show(struct seq_file *m, void *data)
954 {return 0;}
955 static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid,
956                                     int *newnid)
957 { return 0; }
958 #endif
959 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
960 { return 0; }
961 static inline struct proc_dir_entry *
962 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
963                    void *data, const struct file_operations *fops)
964 {return 0; }
965 static inline struct proc_dir_entry *
966 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
967                     const char *format, ...)
968 {return NULL; }
969 static inline int lprocfs_add_vars(struct proc_dir_entry *root,
970                                    struct lprocfs_vars *var,
971                                    void *data)
972 { return 0; }
973 static inline struct proc_dir_entry *
974 lprocfs_register(const char *name, struct proc_dir_entry *parent,
975                  struct lprocfs_vars *list, void *data)
976 { return NULL; }
977 static inline void lprocfs_remove(struct proc_dir_entry **root)
978 { return; }
979 static inline void lprocfs_remove_proc_entry(const char *name,
980                                              struct proc_dir_entry *parent)
981 { return; }
982 #ifndef HAVE_ONLY_PROCFS_SEQ
983 static inline void remove_proc_subtree(const char *name,
984                                        struct proc_dir_entry *parent)
985 { return; }
986 #endif
987 static inline int lprocfs_obd_setup(struct obd_device *dev)
988 { return 0; }
989 static inline int lprocfs_obd_cleanup(struct obd_device *dev)
990 { return 0; }
991 static inline int lprocfs_uuid_seq_show(struct seq_file *m, void *data)
992 { return 0; }
993 static inline int lprocfs_name_seq_show(struct seq_file *m, void *data)
994 { return 0; }
995 static inline int lprocfs_server_seq_show(struct seq_file *m, void *data)
996 { return 0; }
997 static inline int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
998 { return 0; }
999 static inline int lprocfs_import_seq_show(struct seq_file *m, void *data)
1000 { return 0; }
1001 static inline int lprocfs_state_seq_show(struct seq_file *m, void *data)
1002 { return 0; }
1003 static inline int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data)
1004 { return 0; }
1005 #ifdef HAVE_SERVER_SUPPORT
1006 static inline int lprocfs_num_exports_seq_show(struct seq_file *m, void *data)
1007 { return 0; }
1008 #endif
1009 struct adaptive_timeout;
1010 static inline int lprocfs_at_hist_helper(struct seq_file *m,
1011                                          struct adaptive_timeout *at)
1012 { return 0; }
1013 static inline int lprocfs_timeouts_seq_show(struct seq_file *m, void *data)
1014 { return 0; }
1015 static inline ssize_t
1016 lprocfs_timeouts_seq_write(struct file *file, const char *buffer,
1017                            size_t count, loff_t *off)
1018 { return 0; }
1019 #ifdef HAVE_SERVER_SUPPORT
1020 static inline ssize_t
1021 lprocfs_evict_client_seq_write(struct file *file, const char *buffer,
1022                                size_t count, loff_t *off)
1023 { return 0; }
1024 #endif
1025 static inline ssize_t
1026 lprocfs_ping_seq_write(struct file *file, const char __user *buffer,
1027                        size_t count, loff_t *off)
1028 { return 0; }
1029 static inline ssize_t
1030 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
1031                          size_t count, loff_t *off)
1032 { return 0; }
1033 static inline int
1034 lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data)
1035 { return 0; }
1036 static inline ssize_t
1037 lprocfs_pinger_recov_seq_write(struct file *file, const char __user *buffer,
1038                                size_t count, loff_t *off)
1039 { return 0; }
1040
1041 /* Statfs helpers */
1042 static inline
1043 int lprocfs_blksize_seq_show(struct seq_file *m, void *data)
1044 { return 0; }
1045 static inline
1046 int lprocfs_kbytestotal_seq_show(struct seq_file *m, void *data)
1047 { return 0; }
1048 static inline
1049 int lprocfs_kbytesfree_seq_show(struct seq_file *m, void *data)
1050 { return 0; }
1051 static inline
1052 int lprocfs_kbytesavail_seq_show(struct seq_file *m, void *data)
1053 { return 0; }
1054 static inline
1055 int lprocfs_filestotal_seq_show(struct seq_file *m, void *data)
1056 { return 0; }
1057 static inline
1058 int lprocfs_filesfree_seq_show(struct seq_file *m, void *data)
1059 { return 0; }
1060 static inline
1061 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value)
1062 { return; }
1063 static inline
1064 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value)
1065 { return; }
1066 static inline
1067 void lprocfs_oh_clear(struct obd_histogram *oh)
1068 { return; }
1069 static inline
1070 unsigned long lprocfs_oh_sum(struct obd_histogram *oh)
1071 { return 0; }
1072 static inline
1073 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
1074                            struct lprocfs_counter *cnt)
1075 { return; }
1076 static inline
1077 __u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
1078                                enum lprocfs_fields_flags field)
1079 { return (__u64)0; }
1080
1081 #define LPROC_SEQ_FOPS_RO(name)
1082 #define LPROC_SEQ_FOPS(name)
1083 #define LPROC_SEQ_FOPS_RO_TYPE(name, type)
1084 #define LPROC_SEQ_FOPS_RW_TYPE(name, type)
1085 #define LPROC_SEQ_FOPS_WO_TYPE(name, type)
1086
1087 /* lprocfs_jobstats.c */
1088 static inline
1089 int lprocfs_job_stats_log(struct obd_device *obd, char *jobid, int event,
1090                           long amount)
1091 { return 0; }
1092 static inline
1093 void lprocfs_job_stats_fini(struct obd_device *obd)
1094 { return; }
1095 static inline
1096 int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num,
1097                            cntr_init_callback fn)
1098 { return 0; }
1099
1100
1101 /* lproc_ptlrpc.c */
1102 #define target_print_req NULL
1103
1104 #endif /* LPROCFS */
1105
1106 #endif /* LPROCFS_SNMP_H */