-
-int nodemap_fs_init(const struct lu_env *env, struct dt_device *dev,
- struct obd_device *obd, struct local_oid_storage *los)
-{
- struct dt_object *config_obj;
- struct nm_config_file *nm_config_file;
- int rc = 0;
- ENTRY;
-
- CDEBUG(D_INFO, "%s: finding nodemap index\n", obd->obd_name);
- /* load or create the index file from disk (don't force create) */
- config_obj = nodemap_cache_find_create(env, dev, los, false);
- if (IS_ERR(config_obj))
- GOTO(out, rc = PTR_ERR(config_obj));
-
- CDEBUG(D_INFO, "%s: registering nodemap index\n", obd->obd_name);
-
- nm_config_file = nm_config_file_register(env, config_obj, los,
- NCFT_TGT);
- if (IS_ERR(nm_config_file)) {
- CERROR("%s: error loading nodemap config file, file must be "
- "removed via ldiskfs: rc = %ld\n",
- obd->obd_name, PTR_ERR(nm_config_file));
- GOTO(out, rc = PTR_ERR(nm_config_file));
- }
-
- obd->u.obt.obt_nodemap_config_file = nm_config_file;
-
- /* save los in case object needs to be re-created */
- nm_config_file->ncf_los = los;
-
- EXIT;
-
-out:
- return rc;
-}
-EXPORT_SYMBOL(nodemap_fs_init);
-
-void nodemap_fs_fini(const struct lu_env *env, struct obd_device *obd)
-{
- if (obd->u.obt.obt_nodemap_config_file == NULL)
- return;
-
- nm_config_file_deregister(env, obd->u.obt.obt_nodemap_config_file,
- NCFT_TGT);
- obd->u.obt.obt_nodemap_config_file = NULL;
-}
-EXPORT_SYMBOL(nodemap_fs_fini);