Whamcloud - gitweb
LU-1303 mds: integration lod/osp into the stack
[fs/lustre-release.git] / lustre / obdclass / obd_config.c
index 3728a35..f2344e2 100644 (file)
@@ -783,6 +783,7 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
         }
         if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
             strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) &&
+           strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) &&
             strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME)) {
                 CERROR("can't add connection on non-client dev\n");
                 RETURN(-EINVAL);
@@ -1431,6 +1432,32 @@ static int class_config_llog_handler(const struct lu_env *env,
                         }
                 }
 
+#if defined(HAVE_SERVER_SUPPORT) && defined(__KERNEL__)
+               /* newer MDS replaces LOV/OSC with LOD/OSP */
+               {
+                       char *typename = lustre_cfg_string(lcfg, 1);
+
+                       if ((lcfg->lcfg_command == LCFG_ATTACH && typename &&
+                           strcmp(typename, LUSTRE_LOV_NAME) == 0) &&
+                           IS_MDT(s2lsi(clli->cfg_sb))) {
+                               CDEBUG(D_CONFIG,
+                                      "For 2.x interoperability, rename obd "
+                                      "type from lov to lod (%s)\n",
+                                      s2lsi(clli->cfg_sb)->lsi_svname);
+                               strcpy(typename, LUSTRE_LOD_NAME);
+                       }
+                       if ((lcfg->lcfg_command == LCFG_ATTACH && typename &&
+                           strcmp(typename, LUSTRE_OSC_NAME) == 0) &&
+                           IS_MDT(s2lsi(clli->cfg_sb))) {
+                               CDEBUG(D_CONFIG,
+                                      "For 2.x interoperability, rename obd "
+                                      "type from osc to osp (%s)\n",
+                                      s2lsi(clli->cfg_sb)->lsi_svname);
+                               strcpy(typename, LUSTRE_OSP_NAME);
+                       }
+               }
+#endif
+
                 if ((clli->cfg_flags & CFG_F_EXCLUDE) &&
                     (lcfg->lcfg_command == LCFG_LOV_ADD_OBD))
                         /* Add inactive instead */