- /* Always add in ldlm_stats */
- exp->exp_nid_stats->nid_ldlm_stats =
- lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC, 0);
- if (exp->exp_nid_stats->nid_ldlm_stats == NULL)
+ struct nid_stat *tmp = exp->exp_nid_stats;
+ int num_stats;
+
+ num_stats = (sizeof(*obd->obd_type->typ_md_ops) / sizeof(void *)) +
+ LPROC_MDT_LAST;
+ tmp->nid_stats = lprocfs_alloc_stats(num_stats,
+ LPROCFS_STATS_FLAG_NOPERCPU);
+ if (tmp->nid_stats == NULL)