These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / include / lprocfs_status.h
index d030847..9e654b2 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef _LPROCFS_SNMP_H
 #define _LPROCFS_SNMP_H
 
-#include <linux/proc_fs.h>
+#include <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
@@ -60,8 +60,8 @@ struct lprocfs_vars {
 };
 
 struct lprocfs_static_vars {
-       struct lprocfs_vars *module_vars;
        struct lprocfs_vars *obd_vars;
+       struct attribute_group *sysfs_vars;
 };
 
 /* if we find more consumers this could be generalized */
@@ -158,6 +158,7 @@ struct lprocfs_counter {
         */
        __s64   lc_array_sum[1];
 };
+
 #define lc_sum         lc_array_sum[0]
 #define lc_sum_irq     lc_array_sum[1]
 
@@ -206,7 +207,8 @@ struct lprocfs_stats {
 #define OPC_RANGE(seg) (seg ## _LAST_OPC - seg ## _FIRST_OPC)
 
 /* Pack all opcodes down into a single monotonically increasing index */
-static inline int opcode_offset(__u32 opc) {
+static inline int opcode_offset(__u32 opc)
+{
        if (opc < OST_LAST_OPC) {
                 /* OST opcode */
                return (opc - OST_FIRST_OPC);
@@ -301,7 +303,6 @@ static inline int opcode_offset(__u32 opc) {
        }
 }
 
-
 #define LUSTRE_MAX_OPCODES (OPC_RANGE(OST)  + \
                            OPC_RANGE(MDS)  + \
                            OPC_RANGE(LDLM) + \
@@ -348,7 +349,8 @@ enum {
 
 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
 /* class_obd.c */
-extern struct proc_dir_entry *proc_lustre_root;
+extern struct dentry *debugfs_lustre_root;
+extern struct kobject *lustre_kobj;
 
 struct obd_device;
 struct obd_histogram;
@@ -357,15 +359,18 @@ struct obd_histogram;
 struct dhms {
        int d, h, m, s;
 };
-static inline void s2dhms(struct dhms *ts, time_t secs)
+
+static inline void s2dhms(struct dhms *ts, time64_t secs64)
 {
-       ts->d = secs / 86400;
-       secs = secs % 86400;
+       unsigned int secs;
+
+       ts->d = div_u64_rem(secs64, 86400, &secs);
        ts->h = secs / 3600;
        secs = secs % 3600;
        ts->m = secs / 60;
        ts->s = secs % 60;
 }
+
 #define DHMS_FMT "%dd%dh%02dm%02ds"
 #define DHMS_VARS(x) (x)->d, (x)->h, (x)->m, (x)->s
 
@@ -374,14 +379,11 @@ static inline void s2dhms(struct dhms *ts, time_t secs)
 #define JOBSTATS_PROCNAME_UID          "procname_uid"
 #define JOBSTATS_NODELOCAL             "nodelocal"
 
-extern int lprocfs_write_frac_helper(const char __user *buffer,
-                                    unsigned long count, int *val, int mult);
-extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
-                                   long val, int mult);
-#if defined (CONFIG_PROC_FS)
-
-extern int lprocfs_stats_alloc_one(struct lprocfs_stats *stats,
-                                  unsigned int cpuid);
+int lprocfs_write_frac_helper(const char __user *buffer,
+                             unsigned long count, int *val, int mult);
+int lprocfs_read_frac_helper(char *buffer, unsigned long count,
+                            long val, int mult);
+int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid);
 /*
  * \return value
  *      < 0     : on error (only possible for opc as LPROCFS_GET_SMP_ID)
@@ -422,9 +424,8 @@ static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int opc,
                        else
                                spin_lock(&stats->ls_lock);
                        return 1;
-               } else {
-                       return stats->ls_biggest_alloc_num;
                }
+               return stats->ls_biggest_alloc_num;
        }
 }
 
@@ -499,20 +500,18 @@ lprocfs_stats_counter_get(struct lprocfs_stats *stats, unsigned int cpuid,
  * count itself to reside within a single cache line.
  */
 
-extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
-                               long amount);
-extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
-                               long amount);
+void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount);
+void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx, long amount);
 
 #define lprocfs_counter_incr(stats, idx) \
        lprocfs_counter_add(stats, idx, 1)
 #define lprocfs_counter_decr(stats, idx) \
        lprocfs_counter_sub(stats, idx, 1)
 
-extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
-                                struct lprocfs_counter_header *header,
-                                enum lprocfs_stats_flags flags,
-                                enum lprocfs_fields_flags field);
+__s64 lprocfs_read_helper(struct lprocfs_counter *lc,
+                         struct lprocfs_counter_header *header,
+                         enum lprocfs_stats_flags flags,
+                         enum lprocfs_fields_flags field);
 static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
                                            int idx,
                                            enum lprocfs_fields_flags field)
@@ -539,124 +538,81 @@ static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
 
 extern struct lprocfs_stats *
 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
-extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
-extern void lprocfs_free_stats(struct lprocfs_stats **stats);
-extern void lprocfs_init_ops_stats(int num_private_stats,
-                                  struct lprocfs_stats *stats);
-extern void lprocfs_init_mps_stats(int num_private_stats,
-                                  struct lprocfs_stats *stats);
-extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
-extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
-                                  unsigned int num_private_stats);
-extern int lprocfs_alloc_md_stats(struct obd_device *obddev,
-                                 unsigned int num_private_stats);
-extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
-                                unsigned conf, const char *name,
-                                const char *units);
-extern void lprocfs_free_obd_stats(struct obd_device *obddev);
-extern void lprocfs_free_md_stats(struct obd_device *obddev);
+void lprocfs_clear_stats(struct lprocfs_stats *stats);
+void lprocfs_free_stats(struct lprocfs_stats **stats);
+void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
+                         unsigned conf, const char *name, const char *units);
 struct obd_export;
-struct nid_stat;
-extern int lprocfs_add_clear_entry(struct obd_device *obd,
-                                  struct proc_dir_entry *entry);
-extern int lprocfs_exp_setup(struct obd_export *exp,
-                            lnet_nid_t *peer_nid, int *newnid);
-extern int lprocfs_exp_cleanup(struct obd_export *exp);
-extern struct proc_dir_entry *lprocfs_add_simple(struct proc_dir_entry *root,
-                                               char *name,
-                                               void *data,
-                                               struct file_operations *fops);
-extern struct proc_dir_entry *
-lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
-                   const char *format, ...);
-extern void lprocfs_free_per_client_stats(struct obd_device *obd);
-extern int
-lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
-                             unsigned long count, void *data);
-extern int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data);
+int lprocfs_exp_cleanup(struct obd_export *exp);
+struct dentry *ldebugfs_add_simple(struct dentry *root,
+                                  char *name,
+                                  void *data,
+                                  struct file_operations *fops);
 
-extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
-                                 struct lprocfs_stats *stats);
+int ldebugfs_register_stats(struct dentry *parent,
+                           const char *name,
+                           struct lprocfs_stats *stats);
 
 /* lprocfs_status.c */
-extern int lprocfs_add_vars(struct proc_dir_entry *root,
-                           struct lprocfs_vars *var,
+int ldebugfs_add_vars(struct dentry *parent,
+                     struct lprocfs_vars *var,
+                     void *data);
+
+struct dentry *ldebugfs_register(const char *name,
+                                struct dentry *parent,
+                                struct lprocfs_vars *list,
+                                void *data);
+
+void ldebugfs_remove(struct dentry **entryp);
+
+int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
+                     struct attribute_group *attrs);
+int lprocfs_obd_cleanup(struct obd_device *obd);
+
+int ldebugfs_seq_create(struct dentry *parent,
+                       const char *name,
+                       umode_t mode,
+                       const struct file_operations *seq_fops,
+                       void *data);
+int ldebugfs_obd_seq_create(struct obd_device *dev,
+                           const char *name,
+                           umode_t mode,
+                           const struct file_operations *seq_fops,
                            void *data);
 
-extern struct proc_dir_entry *lprocfs_register(const char *name,
-                                             struct proc_dir_entry *parent,
-                                             struct lprocfs_vars *list,
-                                             void *data);
-
-extern void lprocfs_remove(struct proc_dir_entry **root);
-extern void lprocfs_remove_proc_entry(const char *name,
-                                     struct proc_dir_entry *parent);
-
-extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
-extern int lprocfs_obd_cleanup(struct obd_device *obd);
-
-extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name,
-                             umode_t mode,
-                             const struct file_operations *seq_fops,
-                             void *data);
-extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name,
-                                 umode_t mode,
-                                 const struct file_operations *seq_fops,
-                                 void *data);
-
 /* Generic callbacks */
 
-extern int lprocfs_rd_u64(struct seq_file *m, void *data);
-extern int lprocfs_rd_atomic(struct seq_file *m, void *data);
-extern int lprocfs_wr_atomic(struct file *file, const char __user *buffer,
-                            unsigned long count, void *data);
-extern int lprocfs_rd_uint(struct seq_file *m, void *data);
-extern int lprocfs_wr_uint(struct file *file, const char __user *buffer,
-                          unsigned long count, void *data);
-extern int lprocfs_rd_uuid(struct seq_file *m, void *data);
-extern int lprocfs_rd_name(struct seq_file *m, void *data);
-extern int lprocfs_rd_server_uuid(struct seq_file *m, void *data);
-extern int lprocfs_rd_conn_uuid(struct seq_file *m, void *data);
-extern int lprocfs_rd_import(struct seq_file *m, void *data);
-extern int lprocfs_rd_state(struct seq_file *m, void *data);
-extern int lprocfs_rd_connect_flags(struct seq_file *m, void *data);
-extern int lprocfs_rd_num_exports(struct seq_file *m, void *data);
-extern int lprocfs_rd_numrefs(struct seq_file *m, void *data);
+int lprocfs_rd_uint(struct seq_file *m, void *data);
+int lprocfs_wr_uint(struct file *file, const char __user *buffer,
+                   unsigned long count, void *data);
+int lprocfs_rd_server_uuid(struct seq_file *m, void *data);
+int lprocfs_rd_conn_uuid(struct seq_file *m, void *data);
+int lprocfs_rd_import(struct seq_file *m, void *data);
+int lprocfs_rd_state(struct seq_file *m, void *data);
+int lprocfs_rd_connect_flags(struct seq_file *m, void *data);
 
 struct adaptive_timeout;
-extern int lprocfs_at_hist_helper(struct seq_file *m,
-                                 struct adaptive_timeout *at);
-extern int lprocfs_rd_timeouts(struct seq_file *m, void *data);
-extern int lprocfs_wr_timeouts(struct file *file, const char __user *buffer,
-                              unsigned long count, void *data);
-extern int lprocfs_wr_evict_client(struct file *file, const char __user *buffer,
-                           size_t count, loff_t *off);
-extern int lprocfs_wr_ping(struct file *file, const char __user *buffer,
-                          size_t count, loff_t *off);
-extern int lprocfs_wr_import(struct file *file, const char __user *buffer,
+int lprocfs_at_hist_helper(struct seq_file *m, struct adaptive_timeout *at);
+int lprocfs_rd_timeouts(struct seq_file *m, void *data);
+int lprocfs_wr_ping(struct file *file, const char __user *buffer,
+                   size_t count, loff_t *off);
+int lprocfs_wr_import(struct file *file, const char __user *buffer,
                      size_t count, loff_t *off);
-extern int lprocfs_rd_pinger_recov(struct seq_file *m, void *n);
-extern int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer,
-                                  size_t count, loff_t *off);
+int lprocfs_rd_pinger_recov(struct seq_file *m, void *n);
+int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer,
+                           size_t count, loff_t *off);
 
 /* Statfs helpers */
-extern int lprocfs_rd_blksize(struct seq_file *m, void *data);
-extern int lprocfs_rd_kbytestotal(struct seq_file *m, void *data);
-extern int lprocfs_rd_kbytesfree(struct seq_file *m, void *data);
-extern int lprocfs_rd_kbytesavail(struct seq_file *m, void *data);
-extern int lprocfs_rd_filestotal(struct seq_file *m, void *data);
-extern int lprocfs_rd_filesfree(struct seq_file *m, void *data);
-
-extern int lprocfs_write_helper(const char __user *buffer, unsigned long count,
-                               int *val);
-extern int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int mult);
-extern int lprocfs_write_u64_helper(const char __user *buffer,
-                               unsigned long count, __u64 *val);
-extern int lprocfs_write_frac_u64_helper(const char *buffer,
-                                        unsigned long count,
-                                        __u64 *val, int mult);
-extern char *lprocfs_find_named_value(const char *buffer, const char *name,
-                                     size_t *count);
+
+int lprocfs_write_helper(const char __user *buffer, unsigned long count,
+                        int *val);
+int lprocfs_write_u64_helper(const char __user *buffer,
+                            unsigned long count, __u64 *val);
+int lprocfs_write_frac_u64_helper(const char *buffer,
+                                 unsigned long count,
+                                 __u64 *val, int mult);
+char *lprocfs_find_named_value(const char *buffer, const char *name,
+                              size_t *count);
 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
 void lprocfs_oh_clear(struct obd_histogram *oh);
@@ -665,31 +621,20 @@ unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
                           struct lprocfs_counter *cnt);
 
-extern int lprocfs_single_release(struct inode *, struct file *);
-extern int lprocfs_seq_release(struct inode *, struct file *);
-
-/* You must use these macros when you want to refer to
- * the import in a client obd_device for a lprocfs entry */
-#define LPROCFS_CLIMP_CHECK(obd) do {     \
-       typecheck(struct obd_device *, obd);    \
-       down_read(&(obd)->u.cli.cl_sem);    \
-       if ((obd)->u.cli.cl_import == NULL) {   \
-            up_read(&(obd)->u.cli.cl_sem); \
-            return -ENODEV;                \
-       }                                      \
-} while (0)
+int lprocfs_single_release(struct inode *, struct file *);
+int lprocfs_seq_release(struct inode *, struct file *);
+
 #define LPROCFS_CLIMP_EXIT(obd)                 \
        up_read(&(obd)->u.cli.cl_sem)
 
-
 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
   proc entries; otherwise, you will define name##_seq_write function also for
   a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
-  call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
+  call ldebugfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
 #define __LPROC_SEQ_FOPS(name, custom_seq_write)                       \
 static int name##_single_open(struct inode *inode, struct file *file)  \
 {                                                                      \
-       return single_open(file, name##_seq_show, PDE_DATA(inode));     \
+       return single_open(file, name##_seq_show, inode->i_private);    \
 }                                                                      \
 static struct file_operations name##_fops = {                          \
        .owner   = THIS_MODULE,                                     \
@@ -734,7 +679,7 @@ static struct file_operations name##_fops = {                               \
        }                                                               \
        static int name##_##type##_open(struct inode *inode, struct file *file) \
        {                                                               \
-               return single_open(file, NULL, PDE_DATA(inode));        \
+               return single_open(file, NULL, inode->i_private);       \
        }                                                               \
        static struct file_operations name##_##type##_fops = {  \
                .open   = name##_##type##_open,                         \
@@ -742,274 +687,79 @@ static struct file_operations name##_fops = {                            \
                .release = lprocfs_single_release,                      \
        }
 
-/* lproc_ptlrpc.c */
-struct ptlrpc_request;
-extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
-
-/* lproc_status.c */
-int lprocfs_obd_rd_max_pages_per_rpc(struct seq_file *m, void *data);
-int lprocfs_obd_wr_max_pages_per_rpc(struct file *file, const char *buffer,
-                                    size_t count, loff_t *off);
-
-/* all quota proc functions */
-extern int lprocfs_quota_rd_bunit(char *page, char **start,
-                                 loff_t off, int count,
-                                 int *eof, void *data);
-extern int lprocfs_quota_wr_bunit(struct file *file, const char *buffer,
-                                 unsigned long count, void *data);
-extern int lprocfs_quota_rd_btune(char *page, char **start,
-                                 loff_t off, int count,
-                                 int *eof, void *data);
-extern int lprocfs_quota_wr_btune(struct file *file, const char *buffer,
-                                 unsigned long count, void *data);
-extern int lprocfs_quota_rd_iunit(char *page, char **start,
-                                 loff_t off, int count,
-                                 int *eof, void *data);
-extern int lprocfs_quota_wr_iunit(struct file *file, const char *buffer,
-                                 unsigned long count, void *data);
-extern int lprocfs_quota_rd_itune(char *page, char **start,
-                                 loff_t off, int count,
-                                 int *eof, void *data);
-extern int lprocfs_quota_wr_itune(struct file *file, const char *buffer,
-                                 unsigned long count, void *data);
-extern int lprocfs_quota_rd_type(char *page, char **start, loff_t off, int count,
-                                int *eof, void *data);
-extern int lprocfs_quota_wr_type(struct file *file, const char *buffer,
-                                unsigned long count, void *data);
-extern int lprocfs_quota_rd_switch_seconds(char *page, char **start, loff_t off,
-                                          int count, int *eof, void *data);
-extern int lprocfs_quota_wr_switch_seconds(struct file *file,
-                                          const char *buffer,
-                                          unsigned long count, void *data);
-extern int lprocfs_quota_rd_sync_blk(char *page, char **start, loff_t off,
-                                    int count, int *eof, void *data);
-extern int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
-                                    unsigned long count, void *data);
-extern int lprocfs_quota_rd_switch_qs(char *page, char **start, loff_t off,
-                                     int count, int *eof, void *data);
-extern int lprocfs_quota_wr_switch_qs(struct file *file,
-                                     const char *buffer,
-                                     unsigned long count, void *data);
-extern int lprocfs_quota_rd_boundary_factor(char *page, char **start, loff_t off,
-                                           int count, int *eof, void *data);
-extern int lprocfs_quota_wr_boundary_factor(struct file *file,
-                                           const char *buffer,
-                                           unsigned long count, void *data);
-extern int lprocfs_quota_rd_least_bunit(char *page, char **start, loff_t off,
-                                       int count, int *eof, void *data);
-extern int lprocfs_quota_wr_least_bunit(struct file *file,
-                                       const char *buffer,
-                                       unsigned long count, void *data);
-extern int lprocfs_quota_rd_least_iunit(char *page, char **start, loff_t off,
-                                       int count, int *eof, void *data);
-extern int lprocfs_quota_wr_least_iunit(struct file *file,
-                                       const char *buffer,
-                                       unsigned long count, void *data);
-extern int lprocfs_quota_rd_qs_factor(char *page, char **start, loff_t off,
-                                     int count, int *eof, void *data);
-extern int lprocfs_quota_wr_qs_factor(struct file *file,
-                                     const char *buffer,
-                                     unsigned long count, void *data);
-#else
-/* CONFIG_PROC_FS is not defined */
-
-#define proc_lustre_root NULL
-
-static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
-                                      int index, long amount)
-{ return; }
-static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
-                                       int index)
-{ return; }
-static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
-                                      int index, long amount)
-{ return; }
-static inline void lprocfs_counter_decr(struct lprocfs_stats *stats,
-                                       int index)
-{ return; }
-static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
-                                       int index, unsigned conf,
-                                       const char *name, const char *units)
-{ return; }
-
-static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
-                                  enum lprocfs_fields_flags field)
-{ return 0; }
-
-/* NB: we return !NULL to satisfy error checker */
-static inline struct lprocfs_stats *
-lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags)
-{ return (struct lprocfs_stats *)1; }
-static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
-{ return; }
-static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
-{ return; }
-static inline int lprocfs_register_stats(struct proc_dir_entry *root,
-                                        const char *name,
-                                        struct lprocfs_stats *stats)
-{ return 0; }
-static inline void lprocfs_init_ops_stats(int num_private_stats,
-                                         struct lprocfs_stats *stats)
-{ return; }
-static inline void lprocfs_init_mps_stats(int num_private_stats,
-                                         struct lprocfs_stats *stats)
-{ return; }
-static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
-{ return; }
-static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
-                                         unsigned int num_private_stats)
-{ return 0; }
-static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
-                                        unsigned int num_private_stats)
-{ return 0; }
-static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
-{ return; }
-static inline void lprocfs_free_md_stats(struct obd_device *obddev)
-{ return; }
-
-struct obd_export;
-static inline int lprocfs_add_clear_entry(struct obd_export *exp)
-{ return 0; }
-static inline int lprocfs_exp_setup(struct obd_export *exp,
-                                   lnet_nid_t *peer_nid,
-                                   int *newnid)
-{ return 0; }
-static inline int lprocfs_exp_cleanup(struct obd_export *exp)
-{ return 0; }
-static inline struct proc_dir_entry *
-lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-                  void *data, struct file_operations *fops)
-{return 0; }
-static inline struct proc_dir_entry *
-lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
-                   const char *format, ...)
-{return NULL; }
-static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
-{ return; }
-static inline
-int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
-                                 unsigned long count, void *data)
-{return count;}
-static inline
-int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data)
-{ return 0; }
-
-static inline struct proc_dir_entry *
-lprocfs_register(const char *name, struct proc_dir_entry *parent,
-                struct lprocfs_vars *list, void *data)
-{ return NULL; }
-static inline int lprocfs_add_vars(struct proc_dir_entry *root,
-                                  struct lprocfs_vars *var,
-                                  void *data)
-{ return 0; }
-static inline void lprocfs_remove(struct proc_dir_entry **root)
-{ return; }
-static inline void lprocfs_remove_proc_entry(const char *name,
-                                            struct proc_dir_entry *parent)
-{ return; }
-static inline int lprocfs_obd_setup(struct obd_device *dev,
-                                   struct lprocfs_vars *list)
-{ return 0; }
-static inline int lprocfs_obd_cleanup(struct obd_device *dev)
-{ return 0; }
-static inline int lprocfs_rd_u64(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_uuid(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_name(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_server_uuid(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_conn_uuid(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_import(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_pinger_recov(struct seq_file *m, void *n)
-{ return 0; }
-static inline int lprocfs_rd_state(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_connect_flags(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_rd_num_exports(struct seq_file *m, void *data)
-{ return 0; }
-extern inline int lprocfs_rd_numrefs(struct seq_file *m, void *data)
-{ return 0; }
-struct adaptive_timeout;
-static inline int lprocfs_at_hist_helper(struct seq_file *m,
-                                        struct adaptive_timeout *at)
-{ return 0; }
-static inline int lprocfs_rd_timeouts(struct seq_file *m, void *data)
-{ return 0; }
-static inline int lprocfs_wr_timeouts(struct file *file,
-                               const char __user *buffer,
-                               unsigned long count, void *data)
-{ return 0; }
-static inline int lprocfs_wr_evict_client(struct file *file,
-                               const char __user *buffer,
-                               size_t count, loff_t *off)
-{ return 0; }
-static inline int lprocfs_wr_ping(struct file *file,
-                               const char __user *buffer,
-                               size_t count, loff_t *off)
-{ return 0; }
-static inline int lprocfs_wr_import(struct file *file,
-                               const char __user *buffer,
-                               size_t count, loff_t *off)
-{ return 0; }
-static inline int lprocfs_wr_pinger_recov(struct file *file,
-                               const char __user *buffer,
-                               size_t count, loff_t *off)
-{ return 0; }
-
-/* Statfs helpers */
-static inline
-int lprocfs_rd_blksize(struct seq_file *m, void *data)
-{ return 0; }
-static inline
-int lprocfs_rd_kbytestotal(struct seq_file *m, void *data)
-{ return 0; }
-static inline
-int lprocfs_rd_kbytesfree(struct seq_file *m, void *data)
-{ return 0; }
-static inline
-int lprocfs_rd_kbytesavail(struct seq_file *m, void *data)
-{ return 0; }
-static inline
-int lprocfs_rd_filestotal(struct seq_file *m, void *data)
-{ return 0; }
-static inline
-int lprocfs_rd_filesfree(struct seq_file *m, void *data)
-{ return 0; }
-static inline
-void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value)
-{ return; }
-static inline
-void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value)
-{ return; }
-static inline
-void lprocfs_oh_clear(struct obd_histogram *oh)
-{ return; }
-static inline
-unsigned long lprocfs_oh_sum(struct obd_histogram *oh)
-{ return 0; }
-static inline
-void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
-                          struct lprocfs_counter *cnt)
-{ return; }
-static inline
-__u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
-                              enum lprocfs_fields_flags field)
-{ return (__u64)0; }
+struct lustre_attr {
+       struct attribute attr;
+       ssize_t (*show)(struct kobject *kobj, struct attribute *attr,
+                       char *buf);
+       ssize_t (*store)(struct kobject *kobj, struct attribute *attr,
+                        const char *buf, size_t len);
+};
 
-#define LPROC_SEQ_FOPS_RO(name)
-#define LPROC_SEQ_FOPS(name)
-#define LPROC_SEQ_FOPS_RO_TYPE(name, type)
-#define LPROC_SEQ_FOPS_RW_TYPE(name, type)
-#define LPROC_SEQ_FOPS_WR_ONLY(name, type)
+#define LUSTRE_ATTR(name, mode, show, store) \
+static struct lustre_attr lustre_attr_##name = __ATTR(name, mode, show, store)
 
-/* lproc_ptlrpc.c */
-#define target_print_req NULL
+#define LUSTRE_RO_ATTR(name) LUSTRE_ATTR(name, 0444, name##_show, NULL)
+#define LUSTRE_RW_ATTR(name) LUSTRE_ATTR(name, 0644, name##_show, name##_store)
 
-#endif /* CONFIG_PROC_FS */
+extern const struct sysfs_ops lustre_sysfs_ops;
 
+/* all quota proc functions */
+int lprocfs_quota_rd_bunit(char *page, char **start,
+                          loff_t off, int count,
+                          int *eof, void *data);
+int lprocfs_quota_wr_bunit(struct file *file, const char *buffer,
+                          unsigned long count, void *data);
+int lprocfs_quota_rd_btune(char *page, char **start,
+                          loff_t off, int count,
+                          int *eof, void *data);
+int lprocfs_quota_wr_btune(struct file *file, const char *buffer,
+                          unsigned long count, void *data);
+int lprocfs_quota_rd_iunit(char *page, char **start,
+                          loff_t off, int count,
+                          int *eof, void *data);
+int lprocfs_quota_wr_iunit(struct file *file, const char *buffer,
+                          unsigned long count, void *data);
+int lprocfs_quota_rd_itune(char *page, char **start,
+                          loff_t off, int count,
+                          int *eof, void *data);
+int lprocfs_quota_wr_itune(struct file *file, const char *buffer,
+                          unsigned long count, void *data);
+int lprocfs_quota_rd_type(char *page, char **start, loff_t off, int count,
+                         int *eof, void *data);
+int lprocfs_quota_wr_type(struct file *file, const char *buffer,
+                         unsigned long count, void *data);
+int lprocfs_quota_rd_switch_seconds(char *page, char **start, loff_t off,
+                                   int count, int *eof, void *data);
+int lprocfs_quota_wr_switch_seconds(struct file *file,
+                                   const char *buffer,
+                                   unsigned long count, void *data);
+int lprocfs_quota_rd_sync_blk(char *page, char **start, loff_t off,
+                             int count, int *eof, void *data);
+int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
+                             unsigned long count, void *data);
+int lprocfs_quota_rd_switch_qs(char *page, char **start, loff_t off,
+                              int count, int *eof, void *data);
+int lprocfs_quota_wr_switch_qs(struct file *file,
+                              const char *buffer, unsigned long count,
+                              void *data);
+int lprocfs_quota_rd_boundary_factor(char *page, char **start, loff_t off,
+                                    int count, int *eof, void *data);
+int lprocfs_quota_wr_boundary_factor(struct file *file,
+                                    const char *buffer, unsigned long count,
+                                    void *data);
+int lprocfs_quota_rd_least_bunit(char *page, char **start, loff_t off,
+                                int count, int *eof, void *data);
+int lprocfs_quota_wr_least_bunit(struct file *file,
+                                const char *buffer, unsigned long count,
+                                void *data);
+int lprocfs_quota_rd_least_iunit(char *page, char **start, loff_t off,
+                                int count, int *eof, void *data);
+int lprocfs_quota_wr_least_iunit(struct file *file,
+                                const char *buffer, unsigned long count,
+                                void *data);
+int lprocfs_quota_rd_qs_factor(char *page, char **start, loff_t off,
+                              int count, int *eof, void *data);
+int lprocfs_quota_wr_qs_factor(struct file *file,
+                              const char *buffer, unsigned long count,
+                              void *data);
 #endif /* LPROCFS_SNMP_H */