Whamcloud - gitweb
LU-580: update mgc llog process code
[fs/lustre-release.git] / lustre / mgs / mgs_handler.c
index 476b965..4829c1f 100644 (file)
@@ -90,7 +90,7 @@ static int mgs_connect(const struct lu_env *env,
                 data->ocd_version = LUSTRE_VERSION_CODE;
         }
 
-        rc = mgs_export_stats_init(obd, lexp, 0, localdata);
+        rc = mgs_export_stats_init(obd, lexp, localdata);
 
         if (rc) {
                 class_disconnect(lexp);
@@ -119,7 +119,7 @@ static int mgs_reconnect(const struct lu_env *env,
                 data->ocd_version = LUSTRE_VERSION_CODE;
         }
 
-        RETURN(mgs_export_stats_init(obd, exp, 1, localdata));
+        RETURN(mgs_export_stats_init(obd, exp, localdata));
 }
 
 static int mgs_disconnect(struct obd_export *exp)
@@ -197,8 +197,10 @@ static int mgs_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         }
 
         /* namespace for mgs llog */
-        obd->obd_namespace = ldlm_namespace_new(obd ,"MGS", LDLM_NAMESPACE_SERVER,
-                                                LDLM_NAMESPACE_MODEST);
+        obd->obd_namespace = ldlm_namespace_new(obd ,"MGS",
+                                                LDLM_NAMESPACE_SERVER,
+                                                LDLM_NAMESPACE_MODEST,
+                                                LDLM_NS_TYPE_MGT);
         if (obd->obd_namespace == NULL)
                 GOTO(err_ops, rc = -ENOMEM);
 
@@ -248,7 +250,7 @@ static int mgs_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                 GOTO(err_llog, rc = -ENOMEM);
         }
 
-        rc = ptlrpc_start_threads(obd, mgs->mgs_service);
+        rc = ptlrpc_start_threads(mgs->mgs_service);
         if (rc)
                 GOTO(err_thread, rc);
 
@@ -330,7 +332,7 @@ static int mgs_get_cfg_lock(struct obd_device *obd, char *fsname,
         int rc, flags = 0;
         ENTRY;
 
-        rc = mgc_fsname2resid(fsname, &res_id);
+        rc = mgc_fsname2resid(fsname, &res_id, CONFIG_T_CONFIG);
         if (!rc)
                 rc = ldlm_cli_enqueue_local(obd->obd_namespace, &res_id,
                                             LDLM_PLAIN, NULL, LCK_EX,
@@ -452,7 +454,8 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
                         /* Nothing wrong, or fatal error */
                         GOTO(out_nolock, rc);
         } else {
-                if ((rc = mgs_check_failover_reg(mti)))
+                if (!(mti->mti_flags & LDD_F_NO_PRIMNODE)
+                    && (rc = mgs_check_failover_reg(mti)))
                         GOTO(out_nolock, rc);
         }
 
@@ -657,8 +660,8 @@ int mgs_handle(struct ptlrpc_request *req)
         ENTRY;
 
         req_capsule_init(&req->rq_pill, req, RCL_SERVER);
-        OBD_FAIL_TIMEOUT_MS(OBD_FAIL_MGS_PAUSE_REQ, obd_fail_val);
-        if (OBD_FAIL_CHECK(OBD_FAIL_MGS_ALL_REQUEST_NET))
+        CFS_FAIL_TIMEOUT_MS(OBD_FAIL_MGS_PAUSE_REQ, cfs_fail_val);
+        if (CFS_FAIL_CHECK(OBD_FAIL_MGS_ALL_REQUEST_NET))
                 RETURN(0);
 
         LASSERT(current->journal_info == NULL);