Whamcloud - gitweb
b=21140 Restore high priority request handling
[fs/lustre-release.git] / lustre / mdt / mdt_fs.c
index 5ce28b4..599881e 100644 (file)
@@ -50,6 +50,7 @@ int mdt_export_stats_init(struct obd_device *obd,
 {
         lnet_nid_t *client_nid = localdata;
         int        rc, newnid;
+        ENTRY;
 
         rc = lprocfs_exp_setup(exp, client_nid, &newnid);
         if (rc) {
@@ -57,22 +58,15 @@ int mdt_export_stats_init(struct obd_device *obd,
                  * /proc entries */
                 if (rc == -EALREADY)
                         rc = 0;
-                return rc;
+                RETURN(rc);
         }
-
-        if ((obd->md_stats == NULL) &&
-            (rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_NR)))
-                return rc;
         if (newnid) {
-                /* 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)
-                        return -ENOMEM;
-                lprocfs_init_ldlm_stats(exp->exp_nid_stats->nid_ldlm_stats);
-                rc = lprocfs_register_stats(exp->exp_nid_stats->nid_proc,
-                                            "ldlm_stats",
-                                            exp->exp_nid_stats->nid_ldlm_stats);
+                rc = lprocfs_nid_ldlm_stats_init(exp->exp_nid_stats);
+                if (rc)
+                        GOTO(clean, rc);
         }
+        RETURN(0);
+ clean:
+        lprocfs_exp_cleanup(exp);
         return rc;
 }