Whamcloud - gitweb
LU-10171 headers: define pct(a,b) once
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
index 863afd9..865553d 100644 (file)
@@ -45,8 +45,7 @@
 #include <linux/spinlock.h>
 #include <linux/seq_file.h>
 
-#include <libcfs/libcfs_time.h>
-#include <libcfs/linux/linux-misc.h>
+#include <libcfs/libcfs.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 
 struct lprocfs_vars {
@@ -59,6 +58,11 @@ struct lprocfs_vars {
        mode_t                           proc_mode;
 };
 
+static inline u32 pct(s64 a, s64 b)
+{
+       return b ? a * 100 / b : 0;
+}
+
 /**
  * Append a space separated list of current set flags to str.
  */
@@ -469,13 +473,9 @@ 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);
+                                  unsigned int num_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,
@@ -576,9 +576,7 @@ extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name,
 
 /* Generic callbacks */
 extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data);
-extern int lprocfs_name_seq_show(struct seq_file *m, void *data);
 extern int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data);
-extern int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data);
 ssize_t conn_uuid_show(struct kobject *kobj, struct attribute *attr, char *buf);
 extern int lprocfs_import_seq_show(struct seq_file *m, void *data);
 extern int lprocfs_state_seq_show(struct seq_file *m, void *data);
@@ -617,6 +615,8 @@ extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
 extern int lprocfs_str_with_units_to_s64(const char __user *buffer,
                                         unsigned long count, __s64 *val,
                                         char defunit);
+
+char *lprocfs_strnstr(const char *s1, const char *s2, size_t len);
 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);
@@ -855,6 +855,10 @@ int lprocfs_obd_short_io_bytes_seq_show(struct seq_file *m, void *data);
 ssize_t lprocfs_obd_short_io_bytes_seq_write(struct file *file,
                                             const char __user *buffer,
                                             size_t count, loff_t *off);
+ssize_t short_io_bytes_show(struct kobject *kobj, struct attribute *attr,
+                           char *buf);
+ssize_t short_io_bytes_store(struct kobject *kobj, struct attribute *attr,
+                            const char *buffer, size_t count);
 
 struct root_squash_info;
 int lprocfs_wr_root_squash(const char __user *buffer, unsigned long count,
@@ -899,16 +903,10 @@ 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)
+                                         unsigned int num_stats)
 { return 0; }
 static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
                                          unsigned int num_private_stats)
@@ -963,12 +961,8 @@ static inline int lprocfs_obd_cleanup(struct obd_device *dev)
 { return 0; }
 static inline int lprocfs_uuid_seq_show(struct seq_file *m, void *data)
 { return 0; }
-static inline int lprocfs_name_seq_show(struct seq_file *m, void *data)
-{ return 0; }
 static inline int lprocfs_server_seq_show(struct seq_file *m, void *data)
 { return 0; }
-static inline int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
-{ return 0; }
 static inline int lprocfs_import_seq_show(struct seq_file *m, void *data)
 { return 0; }
 static inline int lprocfs_state_seq_show(struct seq_file *m, void *data)