Whamcloud - gitweb
b22131 ASSERTION(request->rq_repdata == NULL) failed
[fs/lustre-release.git] / lustre / mgs / mgs_fs.c
index f4adf56..bd69bca 100644 (file)
@@ -63,6 +63,7 @@ static int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp,
 {
         lnet_nid_t *client_nid = localdata;
         int rc, newnid;
+        ENTRY;
 
         rc = lprocfs_exp_setup(exp, client_nid, &newnid);
         if (rc) {
@@ -70,21 +71,17 @@ static int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp,
                  * /proc entries */
                 if (rc == -EALREADY)
                         rc = 0;
-                return rc;
+                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,
-                                            LPROCFS_STATS_FLAG_NOPERCPU);
-                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;
 }