+ lnet_nid_t *client_nid = localdata;
+ struct nid_stat *stats;
+ int rc;
+ ENTRY;
+
+ LASSERT(!obd->obd_uses_nid_stats);
+
+ rc = lprocfs_exp_setup(exp, client_nid);
+ if (rc != 0)
+ /* Mask error for already created /proc entries */
+ RETURN(rc == -EALREADY ? 0 : rc);
+
+ stats = exp->exp_nid_stats;
+ stats->nid_stats = lprocfs_alloc_stats(LPROC_MDT_LAST,
+ LPROCFS_STATS_FLAG_NOPERCPU);
+ if (stats->nid_stats == NULL)
+ RETURN(-ENOMEM);
+
+ mdt_stats_counter_init(stats->nid_stats);
+
+ rc = lprocfs_register_stats(stats->nid_proc, "stats", stats->nid_stats);
+ if (rc != 0) {
+ lprocfs_free_stats(&stats->nid_stats);
+ GOTO(out, rc);
+ }
+
+ rc = lprocfs_nid_ldlm_stats_init(stats);
+ if (rc != 0)
+ GOTO(out, rc);