atomic_t la_exit;
};
+#define LC_MIN_INIT ((~(__u64)0) >> 1)
+
struct lprocfs_counter {
struct lprocfs_atomic lc_cntl; /* may need to move to per set */
unsigned int lc_config;
struct lprocfs_stats {
unsigned int ls_num; /* # of counters */
- unsigned int ls_percpu_size;
int ls_flags; /* See LPROCFS_STATS_FLAG_* */
spinlock_t ls_lock; /* Lock used only when there are
* no percpu stats areas */
* count itself to reside within a single cache line.
*/
-static inline void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
- long amount)
-{
- struct lprocfs_counter *percpu_cntr;
- int smp_id;
-
- if (stats == NULL)
- return;
-
- /* With per-client stats, statistics are allocated only for
- * single CPU area, so the smp_id should be 0 always. */
- smp_id = lprocfs_stats_lock(stats, LPROCFS_GET_SMP_ID);
-
- percpu_cntr = &(stats->ls_percpu[smp_id]->lp_cntr[idx]);
- atomic_inc(&percpu_cntr->lc_cntl.la_entry);
- percpu_cntr->lc_count++;
-
- if (percpu_cntr->lc_config & LPROCFS_CNTR_AVGMINMAX) {
- percpu_cntr->lc_sum += amount;
- if (percpu_cntr->lc_config & LPROCFS_CNTR_STDDEV)
- percpu_cntr->lc_sumsquare += (__u64)amount * amount;
- if (amount < percpu_cntr->lc_min)
- percpu_cntr->lc_min = amount;
- if (amount > percpu_cntr->lc_max)
- percpu_cntr->lc_max = amount;
- }
- atomic_inc(&percpu_cntr->lc_cntl.la_exit);
- lprocfs_stats_unlock(stats);
-}
+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);
#define lprocfs_counter_incr(stats, idx) \
lprocfs_counter_add(stats, idx, 1)
-
-static inline void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
- long amount)
-{
- struct lprocfs_counter *percpu_cntr;
- int smp_id;
-
- if (stats == NULL)
- return;
-
- /* With per-client stats, statistics are allocated only for
- * single CPU area, so the smp_id should be 0 always. */
- smp_id = lprocfs_stats_lock(stats, LPROCFS_GET_SMP_ID);
-
- percpu_cntr = &(stats->ls_percpu[smp_id]->lp_cntr[idx]);
- atomic_inc(&percpu_cntr->lc_cntl.la_entry);
- if (percpu_cntr->lc_config & LPROCFS_CNTR_AVGMINMAX)
- percpu_cntr->lc_sum -= amount;
- atomic_inc(&percpu_cntr->lc_cntl.la_exit);
- lprocfs_stats_unlock(stats);
-}
#define lprocfs_counter_decr(stats, idx) \
lprocfs_counter_sub(stats, idx, 1)
const char *units);
extern void lprocfs_free_obd_stats(struct obd_device *obddev);
struct obd_export;
-extern int lprocfs_exp_setup(struct obd_export *exp);
+struct nid_stat;
+extern int lprocfs_add_clear_entry(struct obd_device * obd,
+ cfs_proc_dir_entry_t *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 int lprocfs_add_simple(struct proc_dir_entry *root,
+ char *name, read_proc_t *read_proc,
+ write_proc_t *write_proc, void *data);
+extern struct proc_dir_entry *lprocfs_add_symlink(const char *name,
+ struct proc_dir_entry *parent, const char *dest);
+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(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+
extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
struct lprocfs_stats *stats);
void *data);
extern void lprocfs_remove(cfs_proc_dir_entry_t **root);
+extern void lprocfs_remove_proc_entry(const char *name,
+ struct proc_dir_entry *parent);
extern cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *root,
const char *name);
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_add_simple(struct proc_dir_entry *root, char *name,
+ read_proc_t *read_proc, write_proc_t *write_proc,
+ void *data);
+extern void lprocfs_free_per_client_stats(struct obd_device *obd);
extern struct file_operations lprocfs_evict_client_fops;
extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, char *name,
{ return; }
struct obd_export;
-static inline int lprocfs_exp_setup(struct obd_export *exp)
+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 int lprocfs_add_simple(struct proc_dir_entry *root,
+ char *name,
+ read_proc_t *read_proc,
+ write_proc_t *write_proc,
+ void *data)
+{return 0; }
+static inline struct proc_dir_entry *lprocfs_add_symlink(const char *name,
+ struct proc_dir_entry *parent, const char *dest)
+{return NULL; }
+static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
+{}
+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(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{return count;}
static inline cfs_proc_dir_entry_t *
lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
struct lprocfs_vars *var,
void *data) { return 0; }
static inline void lprocfs_remove(cfs_proc_dir_entry_t **root) {};
+static inline void lprocfs_remove_proc_entry(const char *name,
+ struct proc_dir_entry *parent) {};
static inline cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *head,
const char *name) {return 0;}
static inline int lprocfs_obd_setup(struct obd_device *dev,