X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fofd%2Fofd_dev.c;h=9e810a2c31a1849e025f3471b28b8d472deb5280;hp=40cbf71cb7dde14d8ddfc0bb636fd6bc24bcaf49;hb=45cb603b4352a73077dcc45ec2cdea403837a7ba;hpb=a5a7890093ea2509db15f8aa8a8c9d9c86133209 diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 40cbf71..9e810a2 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -2884,12 +2884,13 @@ struct lu_context_key ofd_thread_key = { static int ofd_init0(const struct lu_env *env, struct ofd_device *m, struct lu_device_type *ldt, struct lustre_cfg *cfg) { - const char *dev = lustre_cfg_string(cfg, 0); - struct ofd_thread_info *info = NULL; - struct obd_device *obd; - struct obd_statfs *osfs; - struct lu_fid fid; - int rc; + const char *dev = lustre_cfg_string(cfg, 0); + struct ofd_thread_info *info = NULL; + struct obd_device *obd; + struct obd_statfs *osfs; + struct lu_fid fid; + struct nm_config_file *nodemap_config; + int rc; ENTRY; @@ -3032,9 +3033,12 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m, if (rc != 0) GOTO(err_fini_fs, rc); - rc = nodemap_fs_init(env, m->ofd_osd, obd, m->ofd_los); - if (rc != 0) - GOTO(err_fini_los, rc); + nodemap_config = nm_config_file_register_tgt(env, m->ofd_osd, + m->ofd_los); + if (IS_ERR(nodemap_config)) + GOTO(err_fini_los, rc = PTR_ERR(nodemap_config)); + + obd->u.obt.obt_nodemap_config_file = nodemap_config; rc = ofd_start_inconsistency_verification_thread(m); if (rc != 0) @@ -3045,7 +3049,8 @@ static int ofd_init0(const struct lu_env *env, struct ofd_device *m, RETURN(0); err_fini_nm: - nodemap_fs_fini(env, obd); + nm_config_file_deregister_tgt(env, obd->u.obt.obt_nodemap_config_file); + obd->u.obt.obt_nodemap_config_file = NULL; err_fini_los: local_oid_storage_fini(env, m->ofd_los); m->ofd_los = NULL; @@ -3093,7 +3098,8 @@ static void ofd_fini(const struct lu_env *env, struct ofd_device *m) ofd_stop_inconsistency_verification_thread(m); lfsck_degister(env, m->ofd_osd); ofd_fs_cleanup(env, m); - nodemap_fs_fini(env, obd); + nm_config_file_deregister_tgt(env, obd->u.obt.obt_nodemap_config_file); + obd->u.obt.obt_nodemap_config_file = NULL; if (m->ofd_los != NULL) { local_oid_storage_fini(env, m->ofd_los);