Whamcloud - gitweb
b=22070 revert incompatible protocol change
[fs/lustre-release.git] / lustre / mdt / mdt_handler.c
index ed96c2b..a38edde 100644 (file)
@@ -2842,7 +2842,6 @@ static int mdt_msg_check_version(struct lustre_msg *msg)
         switch (lustre_msg_get_opc(msg)) {
         case MDS_CONNECT:
         case MDS_DISCONNECT:
-        case MDS_SET_INFO:
         case OBD_PING:
         case SEC_CTX_INIT:
         case SEC_CTX_INIT_CONT:
@@ -2868,6 +2867,7 @@ static int mdt_msg_check_version(struct lustre_msg *msg)
         case MDS_SYNC:
         case MDS_GETXATTR:
         case MDS_SETXATTR:
+        case MDS_SET_INFO:
         case MDS_GET_INFO:
         case MDS_QUOTACHECK:
         case MDS_QUOTACTL:
@@ -4498,8 +4498,6 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
         obd = class_name2obd(dev);
         LASSERT(obd != NULL);
 
-        cfs_spin_lock_init(&m->mdt_transno_lock);
-
         m->mdt_max_mdsize = MAX_MD_SIZE;
         m->mdt_max_cookiesize = sizeof(struct llog_cookie);
         m->mdt_som_conf = 0;
@@ -4539,8 +4537,6 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
         m->mdt_nosquash_strlen = 0;
         cfs_init_rwsem(&m->mdt_squash_sem);
 
-        cfs_spin_lock_init(&m->mdt_client_bitmap_lock);
-
         OBD_ALLOC_PTR(mite);
         if (mite == NULL)
                 GOTO(err_lmi, rc = -ENOMEM);
@@ -5028,14 +5024,11 @@ static int mdt_obd_connect(const struct lu_env *env,
                         memcpy(lcd->lcd_uuid, cluuid, sizeof lcd->lcd_uuid);
                         lexp->exp_mdt_data.med_lcd = lcd;
                         rc = mdt_client_new(env, mdt);
-                        if (rc != 0) {
-                                OBD_FREE_PTR(lcd);
-                                lexp->exp_mdt_data.med_lcd = NULL;
-                        } else {
+                        if (rc == 0)
                                 mdt_export_stats_init(obd, lexp, localdata);
-                        }
-                } else
+                } else {
                         rc = -ENOMEM;
+                }
         }
 
 out:
@@ -5211,6 +5204,7 @@ static int mdt_destroy_export(struct obd_export *exp)
         if (obd_uuid_equals(&exp->exp_client_uuid, &exp->exp_obd->obd_uuid))
                 RETURN(0);
 
+        lut_client_free(exp);
         RETURN(rc);
 }
 
@@ -5573,7 +5567,7 @@ int mdt_obd_postrecov(struct obd_device *obd)
  */
 int mdt_hsm_copytool_send(struct obd_export *exp)
 {
-        struct lnl_hdr *lh;
+        struct kuc_hdr *lh;
         struct hsm_action_list *hal;
         struct hsm_action_item *hai;
         int rc, len;
@@ -5588,10 +5582,10 @@ int mdt_hsm_copytool_send(struct obd_export *exp)
         if (lh == NULL)
                 RETURN(-ENOMEM);
 
-        lh->lnl_magic = LNL_MAGIC;
-        lh->lnl_transport = LNL_TRANSPORT_HSM;
-        lh->lnl_msgtype = HMT_ACTION_LIST;
-        lh->lnl_msglen = len;
+        lh->kuc_magic = KUC_MAGIC;
+        lh->kuc_transport = KUC_TRANSPORT_HSM;
+        lh->kuc_msgtype = HMT_ACTION_LIST;
+        lh->kuc_msglen = len;
 
         hal = (struct hsm_action_list *)(lh + 1);
         hal->hal_version = HAL_VERSION;
@@ -5612,10 +5606,11 @@ int mdt_hsm_copytool_send(struct obd_export *exp)
 
         /* Uses the ldlm reverse import; this rpc will be seen by
           the ldlm_callback_handler */
-        rc = target_set_info_rpc(exp->exp_imp_reverse, LDLM_SET_INFO,
-                                 sizeof(KEY_HSM_COPYTOOL_SEND),
-                                 KEY_HSM_COPYTOOL_SEND,
-                                 len, lh, NULL);
+        rc = do_set_info_async(exp->exp_imp_reverse,
+                               LDLM_SET_INFO, LUSTRE_OBD_VERSION,
+                               sizeof(KEY_HSM_COPYTOOL_SEND),
+                               KEY_HSM_COPYTOOL_SEND,
+                               len, lh, NULL);
 
         OBD_FREE(lh, len);