-#ifdef CONFIG_PROC_FS
-#define OBD_COUNTER_OFFSET(op) \
- ((offsetof(struct obd_ops, o_ ## op) - \
- offsetof(struct obd_ops, o_iocontrol)) \
- / sizeof(((struct obd_ops *)NULL)->o_iocontrol))
-
-/* The '- 1' below is for o_owner. */
-#define NUM_OBD_STATS \
- (sizeof(struct obd_ops) / \
- sizeof(((struct obd_ops *)NULL)->o_iocontrol) - 1)
-
-#define OBD_COUNTER_INCREMENT(obd, op) \
- lprocfs_counter_incr((obd)->obd_stats, \
- (obd)->obd_cntr_base + OBD_COUNTER_OFFSET(op))
-
-#define EXP_COUNTER_INCREMENT(exp, op) \
- do { \
- unsigned int _off; \
- _off = (exp)->exp_obd->obd_cntr_base + OBD_COUNTER_OFFSET(op); \
- lprocfs_counter_incr((exp)->exp_obd->obd_stats, _off); \
- if ((exp)->exp_obd->obd_uses_nid_stats && \
- (exp)->exp_nid_stats != NULL) \
- lprocfs_counter_incr((exp)->exp_nid_stats->nid_stats, \
- _off); \
- } while (0)
-
-#define _MD_COUNTER_OFFSET(m_op) \
- ((offsetof(struct md_ops, m_op) - \
- offsetof(struct md_ops, MD_STATS_FIRST_OP)) / \
- sizeof(((struct md_ops *)NULL)->MD_STATS_FIRST_OP))
-
-#define MD_COUNTER_OFFSET(op) _MD_COUNTER_OFFSET(m_ ## op)
-
-#define NUM_MD_STATS \
- (_MD_COUNTER_OFFSET(MD_STATS_LAST_OP) - \
- _MD_COUNTER_OFFSET(MD_STATS_FIRST_OP) + 1)
-
-/* Note that we only increment md counters for ops whose offset is less
- * than NUM_MD_STATS. This is explained in a comment in the definition
- * of struct md_ops. */
-#define EXP_MD_COUNTER_INCREMENT(exp, op) \
- do { \
- if (MD_COUNTER_OFFSET(op) < NUM_MD_STATS) \
- lprocfs_counter_incr((exp)->exp_obd->obd_md_stats, \
- (exp)->exp_obd->obd_md_cntr_base + \
- MD_COUNTER_OFFSET(op)); \
- } while (0)
-
-#else
-#define OBD_COUNTER_OFFSET(op)
-#define OBD_COUNTER_INCREMENT(obd, op)
-#define EXP_COUNTER_INCREMENT(exp, op)
-#define EXP_MD_COUNTER_INCREMENT(exp, op)
-#endif
-