#include <linux/proc_fs.h>
#include <linux/version.h>
#include <linux/smp.h>
-#include <linux/kp30.h>
+#include <libcfs/kp30.h>
# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
# include <linux/statfs.h>
extern struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num);
extern void lprocfs_free_stats(struct lprocfs_stats *stats);
-extern int lprocfs_alloc_obd_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 int lprocfs_alloc_obd_stats(struct obd_device *obddev,
+ unsigned int num_private_stats);
extern void lprocfs_free_obd_stats(struct obd_device *obddev);
-extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
+extern int lprocfs_alloc_md_stats(struct obd_device *obddev,
+ unsigned int num_private_stats);
+extern void lprocfs_free_md_stats(struct obd_device *obddev);
+extern int lprocfs_register_stats(struct proc_dir_entry *root,
+ const char *name,
struct lprocfs_stats *stats);
-#define LPROCFS_INIT_MULTI_VARS(array, size) \
-void lprocfs_init_multi_vars(unsigned int idx, \
- struct lprocfs_static_vars *x) \
-{ \
- struct lprocfs_static_vars *glob = (struct lprocfs_static_vars*)array; \
- LASSERT(glob != 0); \
- LASSERT(idx < (unsigned int)(size)); \
- x->module_vars = glob[idx].module_vars; \
- x->obd_vars = glob[idx].obd_vars; \
-} \
-
-#define LPROCFS_INIT_VARS(name, vclass, vinstance) \
-void lprocfs_##name##_init_vars(struct lprocfs_static_vars *x) \
-{ \
- x->module_vars = vclass; \
- x->obd_vars = vinstance; \
-} \
-
-#define lprocfs_init_vars(NAME, VAR) \
-do { \
+#define LPROCFS_INIT_MULTI_VARS(array, size) \
+void lprocfs_init_multi_vars(unsigned int idx, \
+ struct lprocfs_static_vars *x) \
+{ \
+ struct lprocfs_static_vars *glob = (struct lprocfs_static_vars*)array; \
+ LASSERT(glob != 0); \
+ LASSERT(idx < (unsigned int)(size)); \
+ x->module_vars = glob[idx].module_vars; \
+ x->obd_vars = glob[idx].obd_vars; \
+} \
+
+#define LPROCFS_INIT_VARS(name, vclass, vinstance) \
+void lprocfs_##name##_init_vars(struct lprocfs_static_vars *x) \
+{ \
+ x->module_vars = vclass; \
+ x->obd_vars = vinstance; \
+} \
+
+#define lprocfs_init_vars(NAME, VAR) \
+do { \
extern void lprocfs_##NAME##_init_vars(struct lprocfs_static_vars *); \
lprocfs_##NAME##_init_vars(VAR); \
} while (0)
+
extern void lprocfs_init_multi_vars(unsigned int idx,
struct lprocfs_static_vars *var);
/* lprocfs_status.c */
extern struct proc_dir_entry *lprocfs_srch(struct proc_dir_entry *root,
const char *name);
-extern int lprocfs_obd_attach(struct obd_device *dev, struct lprocfs_vars *list);
-extern int lprocfs_obd_detach(struct obd_device *dev);
+extern int lprocfs_obd_attach(struct obd_device *obd, struct lprocfs_vars *list);
+extern int lprocfs_obd_detach(struct obd_device *obd);
/* Generic callbacks */
int count, int *eof, void *data);
extern int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
int count, int *eof, void *data);
+extern int lprocfs_rd_num_exports(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
extern int lprocfs_rd_numrefs(char *page, char **start, off_t off,
int count, int *eof, void *data);
int count, int *eof, void *data);
extern int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
int count, int *eof, void *data);
+extern int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
extern int lprocfs_rd_filestotal(char *page, char **start, off_t off,
int count, int *eof, void *data);
extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
int count, int *eof, void *data);
-extern int lprocfs_write_helper(const char *buffer, unsigned long count,
+extern int lprocfs_write_helper(const char *buffer, unsigned long count,
int *val);
-int lprocfs_obd_seq_create(struct obd_device *dev, char *name, mode_t mode,
+extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
+ __u64 *val);
+int lprocfs_obd_seq_create(struct obd_device *dev, char *name, mode_t mode,
struct file_operations *seq_fops, void *data);
struct obd_histogram;
void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
void lprocfs_oh_clear(struct obd_histogram *oh);
unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
+struct obd_service_time;
+void lprocfs_stime_record(struct obd_service_time *stime,
+ struct timeval *large, struct timeval *small);
+unsigned long lprocfs_stime_avg_ms(struct obd_service_time *stime);
+unsigned long lprocfs_stime_avg_us(struct obd_service_time *stime);
+
/* lprocfs_status.c: counter read/write functions */
extern int lprocfs_counter_read(char *page, char **start, off_t off,
int count, int *eof, void *data);
extern int lprocfs_counter_write(struct file *file, const char *buffer,
unsigned long count, void *data);
+
+/* lprocfs_status.c: recovery status */
+int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+
#else
/* LPROCFS is not defined */
static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
int index, unsigned conf,
const char *name, const char *units)
{ return; }
+struct obd_service_time;
+static inline void lprocfs_stime_record(struct obd_service_time *stime,
+ struct timeval *large, struct timeval *small)
+{ return; }
+
static inline struct lprocfs_stats* lprocfs_alloc_stats(unsigned int num)
{ return NULL; }
static inline int lprocfs_rd_name(char *page, char **start, off_t off,
int count, int *eof, void *data) { return 0; }
static inline int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
- int count, int *eof, void *data) { return 0; }
+ int count, int *eof, void *data)
+{ return 0; }
static inline int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
- int count, int *eof, void *data) { return 0; }
+ int count, int *eof, void *data)
+{ return 0; }
+static inline int lprocfs_rd_num_exports(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{ return 0; }
static inline int lprocfs_rd_numrefs(char *page, char **start, off_t off,
int count, int *eof, void *data) { return 0; }
int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
int count, int *eof, void *data) { return 0; }
static inline
+int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
+ int count, int *eof, void *data) { return 0; }
+static inline
int lprocfs_rd_filestotal(char *page, char **start, off_t off,
int count, int *eof, void *data) { return 0; }
static inline