+ /* colocated MDT will cache config in target root dir */
+ nm_config_file_obj = local_index_find_or_create(env, mgs->mgs_los,
+ mgs->mgs_configs_dir,
+ LUSTRE_NODEMAP_NAME,
+ S_IFREG | S_IRUGO |
+ S_IWUSR,
+ &dt_nodemap_features);
+ if (IS_ERR(nm_config_file_obj))
+ GOTO(out_configs, rc = PTR_ERR(nm_config_file_obj));
+
+ if (nm_config_file_obj->do_index_ops == NULL) {
+ rc = nm_config_file_obj->do_ops->do_index_try(env,
+ nm_config_file_obj,
+ &dt_nodemap_features);
+ if (rc < 0) {
+ lu_object_put(env, &nm_config_file_obj->do_lu);
+ GOTO(out_configs, rc);
+ }
+ }
+ nm_config_file = nm_config_file_register_mgs(env, nm_config_file_obj,
+ mgs->mgs_los);
+ lu_object_put(env, &nm_config_file_obj->do_lu);
+ if (IS_ERR(nm_config_file)) {
+ CERROR("%s: error loading nodemap config file, file must be "
+ "removed via ldiskfs: rc = %ld\n",
+ mgs->mgs_obd->obd_name, PTR_ERR(nm_config_file));
+ GOTO(out_configs, rc = PTR_ERR(nm_config_file));
+ }
+ mgs->mgs_obd->u.obt.obt_nodemap_config_file = nm_config_file;
+