Whamcloud - gitweb
LU-14542 obd: tunable for sanity grant check
[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.gnu.org/licenses/gpl-2.0.html
19  *
20  * GPL HEADER END
21  */
22 /*
23  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24  * Use is subject to license terms.
25  *
26  * Copyright (c) 2011, 2017, Intel Corporation.
27  */
28 /*
29  * This file is part of Lustre, http://www.lustre.org/
30  *
31  * lustre/include/lprocfs_status.h
32  *
33  * Top level header file for LProc
34  *
35  * Author: Hariharan Thantry thantry@users.sourceforge.net
36  */
37 #ifndef _LPROCFS_STATUS_H
38 #define _LPROCFS_STATUS_H
39
40 #include <linux/fs.h>
41 #include <linux/proc_fs.h>
42 #include <linux/debugfs.h>
43 #include <linux/rwsem.h>
44 #include <linux/spinlock.h>
45 #include <linux/string_helpers.h>
46 #include <linux/seq_file.h>
47
48 #include <libcfs/libcfs.h>
49 #include <libcfs/linux/linux-fs.h>
50 #include <uapi/linux/lustre/lustre_idl.h>
51
52 /*
53  * Liuux 5.6 introduces proc_ops with v5.5-8862-gd56c0d45f0e2
54  * Now that proc and debugfs use separate operation vector types
55  * separate containers are also needed.
56  */
57 struct lprocfs_vars {
58         const char                      *name;
59         const struct proc_ops           *fops;
60         void                            *data;
61         /** /proc file mode. */
62         mode_t                           proc_mode;
63 };
64
65 /** Provide a debugfs container */
66 struct ldebugfs_vars {
67         const char                      *name;
68         const struct file_operations    *fops;
69         void                            *data;
70         /** debugfs file mode. */
71         mode_t                           proc_mode;
72 };
73
74 static inline unsigned int pct(unsigned long a, unsigned long b)
75 {
76         return b ? a * 100 / b : 0;
77 }
78
79 #define PAGES_TO_MiB(pages)     ((pages) >> (20 - PAGE_SHIFT))
80 #define MiB_TO_PAGES(mb)        ((mb) << (20 - PAGE_SHIFT))
81
82 /**
83  * Append a space separated list of current set flags to str.
84  */
85 #define flag2str(port, flag)                                            \
86         do {                                                            \
87                 if ((port)->port##_##flag) {                            \
88                         seq_printf(m, "%s" #flag, first ? "" : ", ");   \
89                         first = false;                                  \
90                 }                                                       \
91         } while (0)
92
93 void obd_connect_seq_flags2str(struct seq_file *m, __u64 flags, __u64 flags2,
94                                const char *sep);
95 void obd_connect_data_seqprint(struct seq_file *m,
96                                struct obd_connect_data *ocd);
97
98 /* if we find more consumers this could be generalized */
99 #define OBD_HIST_MAX 32
100 struct obd_histogram {
101         spinlock_t      oh_lock;
102         unsigned long   oh_buckets[OBD_HIST_MAX];
103 };
104
105 enum {
106         RENAME_SAMEDIR_SIZE = 0,
107         RENAME_CROSSDIR_SRC_SIZE,
108         RENAME_CROSSDIR_TGT_SIZE,
109         RENAME_LAST,
110 };
111
112 struct rename_stats {
113         ktime_t                 rs_init;
114         struct obd_histogram    rs_hist[RENAME_LAST];
115 };
116
117 /* An lprocfs counter can be configured using the enum bit masks below.
118  *
119  * LPROCFS_CNTR_EXTERNALLOCK indicates that an external lock already
120  * protects this counter from concurrent updates. If not specified,
121  * lprocfs an internal per-counter lock variable. External locks are
122  * not used to protect counter increments, but are used to protect
123  * counter readout and resets.
124  *
125  * LPROCFS_CNTR_AVGMINMAX indicates a multi-valued counter samples,
126  * (i.e. counter can be incremented by more than "1"). When specified,
127  * the counter maintains min, max and sum in addition to a simple
128  * invocation count. This allows averages to be be computed.
129  * If not specified, the counter is an increment-by-1 counter.
130  * min, max, sum, etc. are not maintained.
131  *
132  * LPROCFS_CNTR_STDDEV indicates that the counter should track sum of
133  * squares (for multi-valued counter samples only). This allows
134  * external computation of standard deviation, but involves a 64-bit
135  * multiply per counter increment.
136  */
137
138 enum {
139         LPROCFS_CNTR_EXTERNALLOCK       = 0x0001,
140         LPROCFS_CNTR_AVGMINMAX          = 0x0002,
141         LPROCFS_CNTR_STDDEV             = 0x0004,
142
143         /* counter data type */
144         LPROCFS_TYPE_REQS               = 0x0100,
145         LPROCFS_TYPE_BYTES              = 0x0200,
146         LPROCFS_TYPE_PAGES              = 0x0400,
147         LPROCFS_TYPE_USEC               = 0x0800,
148
149         LPROCFS_TYPE_LATENCY            = LPROCFS_TYPE_USEC |
150                                           LPROCFS_CNTR_AVGMINMAX |
151                                           LPROCFS_CNTR_STDDEV,
152         LPROCFS_TYPE_BYTES_FULL         = LPROCFS_TYPE_BYTES |
153                                           LPROCFS_CNTR_AVGMINMAX |
154                                           LPROCFS_CNTR_STDDEV,
155 };
156 #define LC_MIN_INIT ((~(__u64)0) >> 1)
157
158 struct lprocfs_counter_header {
159         unsigned int            lc_config;
160         const char              *lc_name;   /* must be static */
161         const char              *lc_units;  /* must be static */
162 };
163
164 struct lprocfs_counter {
165         __s64   lc_count;
166         __s64   lc_min;
167         __s64   lc_max;
168         __s64   lc_sumsquare;
169         /*
170          * Every counter has lc_array_sum[0], while lc_array_sum[1] is only
171          * for irq context counter, i.e. stats with
172          * LPROCFS_STATS_FLAG_IRQ_SAFE flag, its counter need
173          * lc_array_sum[1]
174          */
175         __s64   lc_array_sum[1];
176 };
177 #define lc_sum          lc_array_sum[0]
178 #define lc_sum_irq      lc_array_sum[1]
179
180 struct lprocfs_percpu {
181         struct lprocfs_counter lp_cntr[0];
182 };
183
184 enum lprocfs_stats_lock_ops {
185         LPROCFS_GET_NUM_CPU     = 0x0001, /* number allocated per-CPU stats */
186         LPROCFS_GET_SMP_ID      = 0x0002, /* current stat to be updated */
187 };
188
189 enum lprocfs_stats_flags {
190         LPROCFS_STATS_FLAG_NONE     = 0x0000, /* per cpu counter */
191         LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* stats have no percpu
192                                                * area and need locking */
193         LPROCFS_STATS_FLAG_IRQ_SAFE = 0x0002, /* alloc need irq safe */
194 };
195
196 enum lprocfs_fields_flags {
197         LPROCFS_FIELDS_FLAGS_CONFIG     = 0x0001,
198         LPROCFS_FIELDS_FLAGS_SUM        = 0x0002,
199         LPROCFS_FIELDS_FLAGS_MIN        = 0x0003,
200         LPROCFS_FIELDS_FLAGS_MAX        = 0x0004,
201         LPROCFS_FIELDS_FLAGS_AVG        = 0x0005,
202         LPROCFS_FIELDS_FLAGS_SUMSQUARE  = 0x0006,
203         LPROCFS_FIELDS_FLAGS_COUNT      = 0x0007,
204 };
205
206 struct lprocfs_stats {
207         /* # of counters */
208         unsigned short                  ls_num;
209         /* 1 + the biggest cpu # whose ls_percpu slot has been allocated */
210         unsigned short                  ls_biggest_alloc_num;
211         enum lprocfs_stats_flags        ls_flags;
212         ktime_t                         ls_init;
213         /* Lock used when there are no percpu stats areas; For percpu stats,
214          * it is used to protect ls_biggest_alloc_num change */
215         spinlock_t                      ls_lock;
216
217         /* has ls_num of counter headers */
218         struct lprocfs_counter_header   *ls_cnt_header;
219         struct lprocfs_percpu           *ls_percpu[0];
220 };
221
222 #define OPC_RANGE(seg) (seg ## _LAST_OPC - seg ## _FIRST_OPC)
223
224 /* Pack all opcodes down into a single monotonically increasing index */
225 static inline int opcode_offset(__u32 opc) {
226         if (opc < OST_LAST_OPC) {
227                  /* OST opcode */
228                 return (opc - OST_FIRST_OPC);
229         } else if (opc < MDS_LAST_OPC) {
230                 /* MDS opcode */
231                 return (opc - MDS_FIRST_OPC +
232                         OPC_RANGE(OST));
233         } else if (opc < LDLM_LAST_OPC) {
234                 /* LDLM Opcode */
235                 return (opc - LDLM_FIRST_OPC +
236                         OPC_RANGE(MDS) +
237                         OPC_RANGE(OST));
238         } else if (opc < MGS_LAST_OPC) {
239                 /* MGS Opcode */
240                 return (opc - MGS_FIRST_OPC +
241                         OPC_RANGE(LDLM) +
242                         OPC_RANGE(MDS) +
243                         OPC_RANGE(OST));
244         } else if (opc < OBD_LAST_OPC) {
245                 /* OBD Ping */
246                 return (opc - OBD_FIRST_OPC +
247                         OPC_RANGE(MGS) +
248                         OPC_RANGE(LDLM) +
249                         OPC_RANGE(MDS) +
250                         OPC_RANGE(OST));
251         } else if (opc < LLOG_LAST_OPC) {
252                 /* LLOG Opcode */
253                 return (opc - LLOG_FIRST_OPC +
254                         OPC_RANGE(OBD) +
255                         OPC_RANGE(MGS) +
256                         OPC_RANGE(LDLM) +
257                         OPC_RANGE(MDS) +
258                         OPC_RANGE(OST));
259         } else if (opc < QUOTA_LAST_OPC) {
260                 /* LQUOTA Opcode */
261                 return (opc - QUOTA_FIRST_OPC +
262                         OPC_RANGE(LLOG) +
263                         OPC_RANGE(OBD) +
264                         OPC_RANGE(MGS) +
265                         OPC_RANGE(LDLM) +
266                         OPC_RANGE(MDS) +
267                         OPC_RANGE(OST));
268         } else if (opc < SEQ_LAST_OPC) {
269                 /* SEQ opcode */
270                 return (opc - SEQ_FIRST_OPC +
271                         OPC_RANGE(QUOTA) +
272                         OPC_RANGE(LLOG) +
273                         OPC_RANGE(OBD) +
274                         OPC_RANGE(MGS) +
275                         OPC_RANGE(LDLM) +
276                         OPC_RANGE(MDS) +
277                         OPC_RANGE(OST));
278         } else if (opc < SEC_LAST_OPC) {
279                 /* SEC opcode */
280                 return (opc - SEC_FIRST_OPC +
281                         OPC_RANGE(SEQ) +
282                         OPC_RANGE(QUOTA) +
283                         OPC_RANGE(LLOG) +
284                         OPC_RANGE(OBD) +
285                         OPC_RANGE(MGS) +
286                         OPC_RANGE(LDLM) +
287                         OPC_RANGE(MDS) +
288                         OPC_RANGE(OST));
289         } else if (opc < FLD_LAST_OPC) {
290                 /* FLD opcode */
291                  return (opc - FLD_FIRST_OPC +
292                         OPC_RANGE(SEC) +
293                         OPC_RANGE(SEQ) +
294                         OPC_RANGE(QUOTA) +
295                         OPC_RANGE(LLOG) +
296                         OPC_RANGE(OBD) +
297                         OPC_RANGE(MGS) +
298                         OPC_RANGE(LDLM) +
299                         OPC_RANGE(MDS) +
300                         OPC_RANGE(OST));
301 #ifdef HAVE_SERVER_SUPPORT
302         } else if (opc < OUT_UPDATE_LAST_OPC) {
303                 /* update opcode */
304                 return (opc - OUT_UPDATE_FIRST_OPC +
305                         OPC_RANGE(FLD) +
306                         OPC_RANGE(SEC) +
307                         OPC_RANGE(SEQ) +
308                         OPC_RANGE(QUOTA) +
309                         OPC_RANGE(LLOG) +
310                         OPC_RANGE(OBD) +
311                         OPC_RANGE(MGS) +
312                         OPC_RANGE(LDLM) +
313                         OPC_RANGE(MDS) +
314                         OPC_RANGE(OST));
315         } else if (opc < LFSCK_LAST_OPC) {
316                 /* LFSCK opcode */
317                 return (opc - LFSCK_FIRST_OPC +
318                         OPC_RANGE(OUT_UPDATE) +
319                         OPC_RANGE(FLD) +
320                         OPC_RANGE(SEC) +
321                         OPC_RANGE(SEQ) +
322                         OPC_RANGE(QUOTA) +
323                         OPC_RANGE(LLOG) +
324                         OPC_RANGE(OBD) +
325                         OPC_RANGE(MGS) +
326                         OPC_RANGE(LDLM) +
327                         OPC_RANGE(MDS) +
328                         OPC_RANGE(OST));
329 #endif /* HAVE_SERVER_SUPPORT */
330         } else {
331                 /* Unknown Opcode */
332                 return -1;
333         }
334 }
335
336 #define LUSTRE_MAX_OPCODES_CLIENT (OPC_RANGE(OST)  + \
337                                    OPC_RANGE(MDS)  + \
338                                    OPC_RANGE(LDLM) + \
339                                    OPC_RANGE(MGS)  + \
340                                    OPC_RANGE(OBD)  + \
341                                    OPC_RANGE(LLOG) + \
342                                    OPC_RANGE(SEC)  + \
343                                    OPC_RANGE(SEQ)  + \
344                                    OPC_RANGE(SEC)  + \
345                                    OPC_RANGE(FLD))
346
347 #ifdef HAVE_SERVER_SUPPORT
348 #define LUSTRE_MAX_OPCODES (LUSTRE_MAX_OPCODES_CLIENT + \
349                             OPC_RANGE(OUT_UPDATE) + \
350                             OPC_RANGE(LFSCK))
351 #else
352 #define LUSTRE_MAX_OPCODES LUSTRE_MAX_OPCODES_CLIENT
353 #endif
354
355 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
356                             OPC_RANGE(EXTRA))
357
358 enum {
359         PTLRPC_REQWAIT_CNTR = 0,
360         PTLRPC_REQQDEPTH_CNTR,
361         PTLRPC_REQACTIVE_CNTR,
362         PTLRPC_TIMEOUT,
363         PTLRPC_REQBUF_AVAIL_CNTR,
364         PTLRPC_LAST_CNTR
365 };
366
367 #define PTLRPC_FIRST_CNTR PTLRPC_REQWAIT_CNTR
368
369 enum lprocfs_extra_opc {
370         LDLM_GLIMPSE_ENQUEUE = 0,
371         LDLM_PLAIN_ENQUEUE,
372         LDLM_EXTENT_ENQUEUE,
373         LDLM_FLOCK_ENQUEUE,
374         LDLM_IBITS_ENQUEUE,
375         MDS_REINT_SETATTR,
376         MDS_REINT_CREATE,
377         MDS_REINT_LINK,
378         MDS_REINT_UNLINK,
379         MDS_REINT_RENAME,
380         MDS_REINT_OPEN,
381         MDS_REINT_SETXATTR,
382         MDS_REINT_RESYNC,
383         BRW_READ_BYTES,
384         BRW_WRITE_BYTES,
385         EXTRA_LAST_OPC
386 };
387
388 #ifdef HAVE_SERVER_SUPPORT
389 enum brw_rw_stats {
390         BRW_R_PAGES = 0,
391         BRW_W_PAGES,
392         BRW_R_DISCONT_PAGES,
393         BRW_W_DISCONT_PAGES,
394         BRW_R_DISCONT_BLOCKS,
395         BRW_W_DISCONT_BLOCKS,
396         BRW_R_DIO_FRAGS,
397         BRW_W_DIO_FRAGS,
398         BRW_R_RPC_HIST,
399         BRW_W_RPC_HIST,
400         BRW_R_IO_TIME,
401         BRW_W_IO_TIME,
402         BRW_R_DISK_IOSIZE,
403         BRW_W_DISK_IOSIZE,
404         BRW_RW_STATS_NUM,
405 };
406
407 struct brw_stats_props {
408         const char      *bsp_name;
409         const char      *bsp_units;
410         bool             bsp_scale;
411 };
412
413 struct brw_stats {
414         ktime_t                 bs_init;
415         struct obd_histogram    bs_hist[BRW_RW_STATS_NUM];
416         struct brw_stats_props  bs_props[BRW_RW_STATS_NUM / 2];
417 };
418
419 void lprocfs_init_brw_stats(struct brw_stats *brw_stats);
420
421 void ldebugfs_register_osd_stats(struct dentry *parent,
422                                  struct brw_stats *brw_stats,
423                                  struct lprocfs_stats *stats);
424 #endif /* HAVE_SERVER_SUPPORT */
425
426 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
427 /* class_obd.c */
428 extern struct proc_dir_entry *proc_lustre_root;
429 extern struct dentry *debugfs_lustre_root;
430 extern struct kset *lustre_kset;
431
432 struct obd_device;
433
434 #define JOBSTATS_JOBID_VAR_MAX_LEN      20
435 #define JOBSTATS_DISABLE                "disable"
436 #define JOBSTATS_PROCNAME_UID           "procname_uid"
437 #define JOBSTATS_NODELOCAL              "nodelocal"
438 #define JOBSTATS_SESSION                "session"
439
440 typedef void (*cntr_init_callback)(struct lprocfs_stats *stats,
441                                    unsigned int offset);
442
443 struct obd_job_stats {
444         struct cfs_hash        *ojs_hash;       /* hash of jobids */
445         struct list_head        ojs_list;       /* list of job_stat structs */
446         rwlock_t                ojs_lock;       /* protect ojs_list/js_list */
447         ktime_t                 ojs_cleanup_interval;/* 1/2 expiry seconds */
448         ktime_t                 ojs_cleanup_last;/* previous cleanup time */
449         cntr_init_callback      ojs_cntr_init_fn;/* lprocfs_stats initializer */
450         unsigned short          ojs_cntr_num;   /* number of stats in struct */
451         bool                    ojs_cleaning;   /* currently expiring stats */
452 };
453
454 #ifdef CONFIG_PROC_FS
455
456 int lprocfs_stats_alloc_one(struct lprocfs_stats *stats,
457                             unsigned int cpuid);
458 int lprocfs_stats_lock(struct lprocfs_stats *stats,
459                        enum lprocfs_stats_lock_ops opc,
460                        unsigned long *flags);
461 void lprocfs_stats_unlock(struct lprocfs_stats *stats,
462                           enum lprocfs_stats_lock_ops opc,
463                           unsigned long *flags);
464
465 static inline unsigned int
466 lprocfs_stats_counter_size(struct lprocfs_stats *stats)
467 {
468         unsigned int percpusize;
469
470         percpusize = offsetof(struct lprocfs_percpu, lp_cntr[stats->ls_num]);
471
472         /* irq safe stats need lc_array_sum[1] */
473         if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
474                 percpusize += stats->ls_num * sizeof(__s64);
475
476         if ((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0)
477                 percpusize = L1_CACHE_ALIGN(percpusize);
478
479         return percpusize;
480 }
481
482 static inline struct lprocfs_counter *
483 lprocfs_stats_counter_get(struct lprocfs_stats *stats, unsigned int cpuid,
484                           int index)
485 {
486         struct lprocfs_counter *cntr;
487
488         cntr = &stats->ls_percpu[cpuid]->lp_cntr[index];
489
490         if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
491                 cntr = (void *)cntr + index * sizeof(__s64);
492
493         return cntr;
494 }
495
496 /* Two optimized LPROCFS counter increment functions are provided:
497  *     lprocfs_counter_incr(cntr, value) - optimized for by-one counters
498  *     lprocfs_counter_add(cntr) - use for multi-valued counters
499  * Counter data layout allows config flag, counter lock and the
500  * count itself to reside within a single cache line.
501  */
502
503 extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
504                                 long amount);
505 extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
506                                 long amount);
507
508 #define lprocfs_counter_incr(stats, idx) \
509         lprocfs_counter_add(stats, idx, 1)
510 #define lprocfs_counter_decr(stats, idx) \
511         lprocfs_counter_sub(stats, idx, 1)
512
513 extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
514                                  struct lprocfs_counter_header *header,
515                                  enum lprocfs_stats_flags flags,
516                                  enum lprocfs_fields_flags field);
517 u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
518                             enum lprocfs_fields_flags field);
519
520 extern struct lprocfs_stats *
521 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
522 extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
523 extern void lprocfs_free_stats(struct lprocfs_stats **stats);
524 extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
525 extern int lprocfs_alloc_obd_stats(struct obd_device *obd,
526                                    unsigned int num_stats);
527 extern int lprocfs_alloc_md_stats(struct obd_device *obd,
528                                   unsigned int num_private_stats);
529 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
530                                  unsigned conf, const char *name,
531                                  const char *units);
532 extern void lprocfs_free_obd_stats(struct obd_device *obd);
533 extern void lprocfs_free_md_stats(struct obd_device *obd);
534 struct obd_export;
535 struct nid_stat;
536 extern int lprocfs_add_clear_entry(struct obd_device *obd,
537                                    struct proc_dir_entry *entry);
538 #ifdef HAVE_SERVER_SUPPORT
539 extern int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *peer_nid);
540 extern int lprocfs_exp_cleanup(struct obd_export *exp);
541 struct dentry *ldebugfs_add_symlink(const char *name, const char *target,
542                                     const char *format, ...);
543 #else
544 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
545 { return 0; }
546 #endif
547 extern struct proc_dir_entry *
548 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
549                    void *data, const struct proc_ops *ops);
550 extern struct proc_dir_entry *
551 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
552                     const char *format, ...);
553 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
554 #ifdef HAVE_SERVER_SUPPORT
555 extern ssize_t
556 lprocfs_nid_stats_clear_seq_write(struct file *file, const char __user *buffer,
557                                         size_t count, loff_t *off);
558 extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data);
559 #endif
560 extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
561                                   struct lprocfs_stats *stats);
562 extern const struct file_operations ldebugfs_stats_seq_fops;
563
564 /* lprocfs_status.c */
565 extern void ldebugfs_add_vars(struct dentry *parent, struct ldebugfs_vars *var,
566                               void *data);
567 extern struct dentry *ldebugfs_register(const char *name,
568                                         struct dentry *parent,
569                                         struct ldebugfs_vars *list,
570                                         void *data);
571 extern int lprocfs_add_vars(struct proc_dir_entry *root,
572                             struct lprocfs_vars *var, void *data);
573
574 extern struct proc_dir_entry *
575 lprocfs_register(const char *name, struct proc_dir_entry *parent,
576                  struct lprocfs_vars *list, void *data);
577
578 extern void lprocfs_remove(struct proc_dir_entry **root);
579 extern void lprocfs_remove_proc_entry(const char *name,
580                                       struct proc_dir_entry *parent);
581 extern int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only);
582 extern int lprocfs_obd_cleanup(struct obd_device *obd);
583
584 extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name,
585                               mode_t mode, const struct proc_ops *seq_fops,
586                               void *data);
587 extern int lprocfs_obd_seq_create(struct obd_device *obd, const char *name,
588                                   mode_t mode, const struct proc_ops *seq_fops,
589                                   void *data);
590 extern void lprocfs_stats_header(struct seq_file *seq, ktime_t now,
591                                  ktime_t ts_init, int width, const char *colon,
592                                  bool show_units);
593
594 /* Generic callbacks */
595 extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data);
596 extern int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data);
597 ssize_t conn_uuid_show(struct kobject *kobj, struct attribute *attr, char *buf);
598 extern int lprocfs_import_seq_show(struct seq_file *m, void *data);
599 extern int lprocfs_state_seq_show(struct seq_file *m, void *data);
600 extern int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data);
601 #ifdef HAVE_SERVER_SUPPORT
602 ssize_t num_exports_show(struct kobject *kobj, struct attribute *attr,
603                          char *buf);
604 ssize_t grant_check_threshold_show(struct kobject *kobj,
605                                    struct attribute *attr, char *buf);
606 ssize_t grant_check_threshold_store(struct kobject *kobj,
607                                     struct attribute *attr,
608                                     const char *buffer, size_t count);
609 #endif
610 struct adaptive_timeout;
611 extern int lprocfs_at_hist_helper(struct seq_file *m,
612                                   struct adaptive_timeout *at);
613 extern int lprocfs_timeouts_seq_show(struct seq_file *m, void *data);
614 extern ssize_t
615 lprocfs_timeouts_seq_write(struct file *file, const char __user *buffer,
616                            size_t count, loff_t *off);
617 #ifdef HAVE_SERVER_SUPPORT
618 extern ssize_t
619 lprocfs_evict_client_seq_write(struct file *file, const char __user *buffer,
620                                 size_t count, loff_t *off);
621 #endif
622 ssize_t ping_store(struct kobject *kobj, struct attribute *attr,
623                    const char *buffer, size_t count);
624 ssize_t ping_show(struct kobject *kobj, struct attribute *attr,
625                   char *buffer);
626
627 extern ssize_t
628 ldebugfs_import_seq_write(struct file *file, const char __user *buffer,
629                           size_t count, loff_t *off);
630 static inline ssize_t
631 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
632                          size_t count, loff_t *off)
633 {
634         return ldebugfs_import_seq_write(file, buffer, count, off);
635 }
636
637 extern int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data);
638 extern ssize_t
639 lprocfs_pinger_recov_seq_write(struct file *file, const char __user *buffer,
640                                size_t count, loff_t *off);
641
642 int string_to_size(u64 *size, const char *buffer, size_t count);
643 int sysfs_memparse(const char *buffer, size_t count, u64 *val,
644                     const char *defunit);
645 char *lprocfs_strnstr(const char *s1, const char *s2, size_t len);
646 char *lprocfs_find_named_value(const char *buffer, const char *name,
647                                 size_t *count);
648 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
649 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
650 void lprocfs_oh_clear(struct obd_histogram *oh);
651 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
652
653 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
654                            struct lprocfs_counter *cnt);
655
656 #ifdef HAVE_SERVER_SUPPORT
657 /* lprocfs_status.c: recovery status */
658 int lprocfs_recovery_status_seq_show(struct seq_file *m, void *data);
659
660 /* lprocfs_status.c: hash statistics */
661 int lprocfs_hash_seq_show(struct seq_file *m, void *data);
662
663 /* lprocfs_status.c: IR factor */
664 ssize_t ir_factor_show(struct kobject *kobj, struct attribute *attr,
665                        char *buf);
666 ssize_t ir_factor_store(struct kobject *kobj, struct attribute *attr,
667                         const char *buffer, size_t count);
668 #endif
669
670 /* lprocfs_status.c: dump pages on cksum error */
671 int lprocfs_checksum_dump_seq_show(struct seq_file *m, void *data);
672 ssize_t
673 lprocfs_checksum_dump_seq_write(struct file *file, const char __user *buffer,
674                                 size_t count, loff_t *off);
675
676 extern int lprocfs_single_release(struct inode *, struct file *);
677 extern int lprocfs_seq_release(struct inode *, struct file *);
678
679 /* You must use these macros when you want to refer to
680  * the import in a client obd_device for a lprocfs entry
681  * Note that it is not safe to 'goto', 'return' or 'break'
682  * out of the body of this statement.  It *IS* safe to
683  * 'goto' the a label inside the statement, or to 'continue'
684  * to get out of the statement.
685  */
686
687 #define with_imp_locked_nested(__obd, __imp, __rc, __nest)              \
688         for (down_read_nested(&(__obd)->u.cli.cl_sem, __nest),          \
689              __imp = (__obd)->u.cli.cl_import,                          \
690              __rc = __imp ? 0 : -ENODEV;                                \
691              __imp ? 1 : (up_read(&(__obd)->u.cli.cl_sem), 0);          \
692              __imp = NULL)
693
694 #define with_imp_locked(__obd, __imp, __rc)     \
695         with_imp_locked_nested(__obd, __imp, __rc, 0)
696
697 /* write the name##_seq_show function, call LDEBUGFS_SEQ_FOPS_RO for read-only
698  * debugfs entries; otherwise, you will define name##_seq_write function also
699  * for a read-write debugfs entry, and then call LDEBUGFS_SEQ_FOPS instead.
700  * Finally, call debugfs_create_file(filename, 0444, obd, data, &name#_fops);
701  */
702 #define __LDEBUGFS_SEQ_FOPS(name, custom_seq_write)                     \
703 static int name##_single_open(struct inode *inode, struct file *file)   \
704 {                                                                       \
705         return single_open(file, name##_seq_show, inode->i_private);    \
706 }                                                                       \
707 static const struct file_operations name##_fops = {                     \
708         .owner   = THIS_MODULE,                                         \
709         .open    = name##_single_open,                                  \
710         .read    = seq_read,                                            \
711         .write   = custom_seq_write,                                    \
712         .llseek  = seq_lseek,                                           \
713         .release = single_release,                                      \
714 }
715
716 #define LDEBUGFS_SEQ_FOPS_RO(name)      __LDEBUGFS_SEQ_FOPS(name, NULL)
717 #define LDEBUGFS_SEQ_FOPS(name)         __LDEBUGFS_SEQ_FOPS(name, \
718                                                             name##_seq_write)
719
720 #define LDEBUGFS_SEQ_FOPS_RO_TYPE(name, type)                           \
721         static int name##_##type##_seq_show(struct seq_file *m, void *v)\
722         {                                                               \
723                 if (!m->private)                                        \
724                         return -ENODEV;                                 \
725                 return lprocfs_##type##_seq_show(m, m->private);        \
726         }                                                               \
727         LDEBUGFS_SEQ_FOPS_RO(name##_##type)
728
729 #define LDEBUGFS_SEQ_FOPS_RW_TYPE(name, type)                           \
730         static int name##_##type##_seq_show(struct seq_file *m, void *v)\
731         {                                                               \
732                 if (!m->private)                                        \
733                         return -ENODEV;                                 \
734                 return lprocfs_##type##_seq_show(m, m->private);        \
735         }                                                               \
736         static ssize_t name##_##type##_seq_write(struct file *file,     \
737                         const char __user *buffer, size_t count,        \
738                         loff_t *off)                                    \
739         {                                                               \
740                 struct seq_file *seq = file->private_data;              \
741                                                                         \
742                 if (!seq->private)                                      \
743                         return -ENODEV;                                 \
744                 return ldebugfs_##type##_seq_write(file, buffer, count, \
745                                                    seq->private);       \
746         }                                                               \
747         LDEBUGFS_SEQ_FOPS(name##_##type);
748
749 #define LDEBUGFS_FOPS_WR_ONLY(name, type)                               \
750         static ssize_t name##_##type##_write(struct file *file,         \
751                         const char __user *buffer, size_t count,        \
752                         loff_t *off)                                    \
753         {                                                               \
754                 return ldebugfs_##type##_seq_write(file, buffer, count, \
755                                                    off);                \
756         }                                                               \
757         static int name##_##type##_open(struct inode *inode,            \
758                                         struct file *file)              \
759         {                                                               \
760                 return single_open(file, NULL, inode->i_private);       \
761         }                                                               \
762         static const struct file_operations name##_##type##_fops = {    \
763                 .open    = name##_##type##_open,                        \
764                 .write   = name##_##type##_write,                       \
765                 .release = single_release,                              \
766         };
767
768 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
769  * proc entries; otherwise, you will define name##_seq_write function also for
770  * a read-write proc entry, and then call LPROC_SEQ_FOPS instead. Finally,
771  * call ldebugfs_obd_seq_create(obd, filename, 0444, &name#_fops, data);
772  */
773 #define __LPROC_SEQ_FOPS(name, custom_seq_write)                        \
774 static int name##_single_open(struct inode *inode, struct file *file)   \
775 {                                                                       \
776         return single_open(file, name##_seq_show,                       \
777                            inode->i_private ? inode->i_private :        \
778                                               PDE_DATA(inode));         \
779 }                                                                       \
780 static const struct proc_ops name##_fops = {                            \
781         PROC_OWNER(THIS_MODULE)                                         \
782         .proc_open              = name##_single_open,                   \
783         .proc_read              = seq_read,                             \
784         .proc_write             = custom_seq_write,                     \
785         .proc_lseek             = seq_lseek,                            \
786         .proc_release           = lprocfs_single_release,               \
787 }
788
789 #define LPROC_SEQ_FOPS_RO(name)         __LPROC_SEQ_FOPS(name, NULL)
790 #define LPROC_SEQ_FOPS(name)            __LPROC_SEQ_FOPS(name, name##_seq_write)
791
792 #define LPROC_SEQ_FOPS_RO_TYPE(name, type)                              \
793         static int name##_##type##_seq_show(struct seq_file *m, void *v)\
794         {                                                               \
795                 return lprocfs_##type##_seq_show(m, m->private);        \
796         }                                                               \
797         LPROC_SEQ_FOPS_RO(name##_##type)
798
799 #define LPROC_SEQ_FOPS_RW_TYPE(name, type)                              \
800         static int name##_##type##_seq_show(struct seq_file *m, void *v)\
801         {                                                               \
802                 return lprocfs_##type##_seq_show(m, m->private);        \
803         }                                                               \
804         static ssize_t name##_##type##_seq_write(struct file *file,     \
805                         const char __user *buffer, size_t count,        \
806                         loff_t *off)                                    \
807         {                                                               \
808                 struct seq_file *seq = file->private_data;              \
809                 return lprocfs_##type##_seq_write(file, buffer,         \
810                                                   count, seq->private); \
811         }                                                               \
812         LPROC_SEQ_FOPS(name##_##type);
813
814 #define LPROC_SEQ_FOPS_WR_ONLY(name, type)                              \
815         static ssize_t name##_##type##_write(struct file *file,         \
816                         const char __user *buffer, size_t count,        \
817                         loff_t *off)                                    \
818         {                                                               \
819                 return lprocfs_##type##_seq_write(file, buffer, count, off);\
820         }                                                               \
821         static int name##_##type##_open(struct inode *inode, struct file *file)\
822         {                                                               \
823                 return single_open(file, NULL,                          \
824                                    inode->i_private ? inode->i_private : \
825                                    PDE_DATA(inode));                    \
826         }                                                               \
827         static const struct proc_ops name##_##type##_fops = {           \
828                 .proc_open      = name##_##type##_open,                 \
829                 .proc_write     = name##_##type##_write,                \
830                 .proc_release   = lprocfs_single_release,               \
831         };
832
833 struct lustre_attr {
834         struct attribute attr;
835         ssize_t (*show)(struct kobject *kobj, struct attribute *attr,
836                         char *buf);
837         ssize_t (*store)(struct kobject *kobj, struct attribute *attr,
838                          const char *buf, size_t len);
839 };
840
841 #define LUSTRE_ATTR(name, mode, show, store) \
842 static struct lustre_attr lustre_attr_##name = __ATTR(name, mode, show, store)
843
844 #define LUSTRE_WO_ATTR(name) LUSTRE_ATTR(name, 0200, NULL, name##_store)
845 #define LUSTRE_RO_ATTR(name) LUSTRE_ATTR(name, 0444, name##_show, NULL)
846 #define LUSTRE_RW_ATTR(name) LUSTRE_ATTR(name, 0644, name##_show, name##_store)
847
848 ssize_t lustre_attr_show(struct kobject *kobj, struct attribute *attr,
849                          char *buf);
850 ssize_t lustre_attr_store(struct kobject *kobj, struct attribute *attr,
851                           const char *buf, size_t len);
852
853 extern const struct sysfs_ops lustre_sysfs_ops;
854
855 /* lproc_ptlrpc.c */
856 struct ptlrpc_request;
857 extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
858
859 #ifdef HAVE_SERVER_SUPPORT
860 /* lprocfs_jobstats.c */
861 int lprocfs_job_stats_log(struct obd_device *obd, char *jobid,
862                           int event, long amount);
863 void lprocfs_job_stats_fini(struct obd_device *obd);
864 int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num,
865                            cntr_init_callback fn);
866 ssize_t job_cleanup_interval_show(struct kobject *kobj, struct attribute *attr,
867                                   char *buf);
868 ssize_t job_cleanup_interval_store(struct kobject *kobj,
869                                    struct attribute *attr,
870                                    const char *buffer, size_t count);
871 /* lproc_status_server.c */
872 ssize_t recovery_time_soft_show(struct kobject *kobj, struct attribute *attr,
873                                 char *buf);
874 ssize_t recovery_time_soft_store(struct kobject *kobj,
875                                  struct attribute *attr,
876                                  const char *buffer, size_t count);
877 ssize_t recovery_time_hard_show(struct kobject *kobj, struct attribute *attr,
878                                 char *buf);
879 ssize_t recovery_time_hard_store(struct kobject *kobj,
880                                  struct attribute *attr,
881                                  const char *buffer, size_t count);
882 ssize_t instance_show(struct kobject *kobj, struct attribute *attr,
883                       char *buf);
884 #endif
885 /* lproc_status.c */
886 int lprocfs_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *data);
887 ssize_t lprocfs_obd_max_pages_per_rpc_seq_write(struct file *file,
888                                                 const char __user *buffer,
889                                                 size_t count, loff_t *off);
890 ssize_t short_io_bytes_show(struct kobject *kobj, struct attribute *attr,
891                             char *buf);
892 ssize_t short_io_bytes_store(struct kobject *kobj, struct attribute *attr,
893                              const char *buffer, size_t count);
894
895 struct root_squash_info;
896 int lprocfs_wr_root_squash(const char __user *buffer, unsigned long count,
897                            struct root_squash_info *squash, char *name);
898 int lprocfs_wr_nosquash_nids(const char __user *buffer, unsigned long count,
899                              struct root_squash_info *squash, char *name);
900
901 #else /* !CONFIG_PROC_FS */
902
903 #define proc_lustre_root NULL
904
905 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
906                                        int index, long amount)
907 { return; }
908 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
909                                         int index)
910 { return; }
911 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
912                                        int index, long amount)
913 { return; }
914 static inline void lprocfs_counter_decr(struct lprocfs_stats *stats,
915                                         int index)
916 { return; }
917 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
918                                         int index, unsigned conf,
919                                         const char *name, const char *units)
920 { return; }
921
922 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
923                                    enum lprocfs_fields_flags field)
924 { return 0; }
925
926 /* NB: we return !NULL to satisfy error checker */
927 static inline struct lprocfs_stats *
928 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags)
929 { return (struct lprocfs_stats *)1; }
930 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
931 { return; }
932 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
933 { return; }
934 static inline int lprocfs_register_stats(struct proc_dir_entry *root,
935                                          const char *name,
936                                          struct lprocfs_stats *stats)
937 { return 0; }
938 static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
939 { return; }
940 static inline int lprocfs_alloc_obd_stats(struct obd_device *obd,
941                                           unsigned int num_stats)
942 { return 0; }
943 static inline int lprocfs_alloc_md_stats(struct obd_device *obd,
944                                          unsigned int num_private_stats)
945 { return 0; }
946 static inline void lprocfs_free_obd_stats(struct obd_device *obd)
947 { return; }
948 static inline void lprocfs_free_md_stats(struct obd_device *obd)
949 { return; }
950
951 struct obd_export;
952 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
953 { return 0; }
954 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
955 { return; }
956 #ifdef HAVE_SERVER_SUPPORT
957 static inline
958 ssize_t lprocfs_nid_stats_seq_write(struct file *file,
959                                     const char __user *buffer,
960                                     size_t count, loff_t *off)
961 {return 0;}
962 static inline
963 int lprocfs_nid_stats_clear_seq_show(struct seq_file *m, void *data)
964 {return 0;}
965 static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid)
966 { return 0; }
967 #endif
968 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
969 { return 0; }
970 static inline struct proc_dir_entry *
971 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
972                    void *data, const struct file_operations *fops)
973 {return 0; }
974 static inline struct proc_dir_entry *
975 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
976                     const char *format, ...)
977 {return NULL; }
978 static inline int lprocfs_add_vars(struct proc_dir_entry *root,
979                                    struct lprocfs_vars *var, void *data)
980 { return 0; }
981 static inline struct proc_dir_entry *
982 lprocfs_register(const char *name, struct proc_dir_entry *parent,
983                  struct lprocfs_vars *list, void *data)
984 { return NULL; }
985 static inline void lprocfs_remove(struct proc_dir_entry **root)
986 { return; }
987 static inline void lprocfs_remove_proc_entry(const char *name,
988                                              struct proc_dir_entry *parent)
989 { return; }
990 static inline int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only)
991 { return 0; }
992 static inline int lprocfs_obd_cleanup(struct obd_device *obd)
993 { return 0; }
994 static inline int lprocfs_uuid_seq_show(struct seq_file *m, void *data)
995 { return 0; }
996 static inline int lprocfs_server_seq_show(struct seq_file *m, void *data)
997 { return 0; }
998 static inline int lprocfs_import_seq_show(struct seq_file *m, void *data)
999 { return 0; }
1000 static inline int lprocfs_state_seq_show(struct seq_file *m, void *data)
1001 { return 0; }
1002 static inline int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data)
1003 { return 0; }
1004 #ifdef HAVE_SERVER_SUPPORT
1005 static inline int lprocfs_num_exports_seq_show(struct seq_file *m, void *data)
1006 { return 0; }
1007 #endif
1008 struct adaptive_timeout;
1009 static inline int lprocfs_at_hist_helper(struct seq_file *m,
1010                                          struct adaptive_timeout *at)
1011 { return 0; }
1012 static inline int lprocfs_timeouts_seq_show(struct seq_file *m, void *data)
1013 { return 0; }
1014 static inline ssize_t
1015 lprocfs_timeouts_seq_write(struct file *file, const char __user *buffer,
1016                            size_t count, loff_t *off)
1017 { return 0; }
1018 #ifdef HAVE_SERVER_SUPPORT
1019 static inline ssize_t
1020 lprocfs_evict_client_seq_write(struct file *file, const char __user *buffer,
1021                                size_t count, loff_t *off)
1022 { return 0; }
1023 #endif
1024 static inline ssize_t
1025 lprocfs_ping_seq_write(struct file *file, const char __user *buffer,
1026                        size_t count, loff_t *off)
1027 { return 0; }
1028 static inline ssize_t
1029 ldebugfs_import_seq_write(struct file *file, const char __user *buffer,
1030                           size_t count, loff_t *off)
1031 { return 0; }
1032 static inline ssize_t
1033 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
1034                          size_t count, loff_t *off)
1035 { return 0; }
1036 static inline int
1037 lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data)
1038 { return 0; }
1039 static inline ssize_t
1040 lprocfs_pinger_recov_seq_write(struct file *file, const char __user *buffer,
1041                                size_t count, loff_t *off)
1042 { return 0; }
1043
1044 /* Statfs helpers */
1045 static inline
1046 int lprocfs_blksize_seq_show(struct seq_file *m, void *data)
1047 { return 0; }
1048 static inline
1049 int lprocfs_kbytestotal_seq_show(struct seq_file *m, void *data)
1050 { return 0; }
1051 static inline
1052 int lprocfs_kbytesfree_seq_show(struct seq_file *m, void *data)
1053 { return 0; }
1054 static inline
1055 int lprocfs_kbytesavail_seq_show(struct seq_file *m, void *data)
1056 { return 0; }
1057 static inline
1058 int lprocfs_filestotal_seq_show(struct seq_file *m, void *data)
1059 { return 0; }
1060 static inline
1061 int lprocfs_filesfree_seq_show(struct seq_file *m, void *data)
1062 { return 0; }
1063 static inline
1064 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value)
1065 { return; }
1066 static inline
1067 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value)
1068 { return; }
1069 static inline
1070 void lprocfs_oh_clear(struct obd_histogram *oh)
1071 { return; }
1072 static inline
1073 unsigned long lprocfs_oh_sum(struct obd_histogram *oh)
1074 { return 0; }
1075 static inline
1076 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
1077                            struct lprocfs_counter *cnt)
1078 { return; }
1079 static inline
1080 u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
1081                             enum lprocfs_fields_flags field)
1082 { return (__u64)0; }
1083
1084 #define LPROC_SEQ_FOPS_RO(name)
1085 #define LPROC_SEQ_FOPS(name)
1086 #define LPROC_SEQ_FOPS_RO_TYPE(name, type)
1087 #define LPROC_SEQ_FOPS_RW_TYPE(name, type)
1088 #define LPROC_SEQ_FOPS_WR_ONLY(name, type)
1089
1090 /* lprocfs_jobstats.c */
1091 static inline
1092 int lprocfs_job_stats_log(struct obd_device *obd, char *jobid, int event,
1093                           long amount)
1094 { return 0; }
1095 static inline
1096 void lprocfs_job_stats_fini(struct obd_device *obd)
1097 { return; }
1098 static inline
1099 int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num,
1100                            cntr_init_callback fn)
1101 { return 0; }
1102
1103
1104 /* lproc_ptlrpc.c */
1105 #define target_print_req NULL
1106
1107 #endif /* CONFIG_PROC_FS */
1108
1109 #endif /* LPROCFS_STATUS_H */