#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 {
mode_t proc_mode;
};
+static inline unsigned int pct(unsigned long a, unsigned long b)
+{
+ return b ? a * 100 / b : 0;
+}
+
/**
* Append a space separated list of current set flags to str.
*/
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,
/* 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);
#endif
ssize_t ping_store(struct kobject *kobj, struct attribute *attr,
const char *buffer, size_t count);
-extern ssize_t
-lprocfs_ping_seq_write(struct file *file, const char __user *buffer,
- size_t count, loff_t *off);
+ssize_t ping_show(struct kobject *kobj, struct attribute *attr,
+ char *buffer);
+
extern ssize_t
lprocfs_import_seq_write(struct file *file, const char __user *buffer,
size_t count, loff_t *off);
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)
{ 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)