Whamcloud - gitweb
LU-8040 mgc: Apply changelog defaults values in mdd_init0()
[fs/lustre-release.git] / lustre / mdd / mdd_device.c
index 35a4529..6129e11 100644 (file)
@@ -124,6 +124,10 @@ static int mdd_init0(const struct lu_env *env, struct mdd_device *mdd,
        const char *dev;
        ENTRY;
 
+       /* LU-8040 Set defaults here, before values configs */
+       mdd->mdd_cl.mc_flags = 0; /* off by default */
+       mdd->mdd_cl.mc_mask = CHANGELOG_DEFMASK;
+
        dev = lustre_cfg_string(lcfg, 0);
        if (dev == NULL)
                RETURN(rc);
@@ -340,7 +344,7 @@ static int mdd_changelog_llog_init(const struct lu_env *env,
        if (rc)
                GOTO(out_cleanup, rc);
 
-       rc = llog_cat_init_and_process(env, ctxt->loc_handle);
+       rc = llog_init_handle(env, ctxt->loc_handle, LLOG_F_IS_CAT, NULL);
        if (rc)
                GOTO(out_close, rc);
 
@@ -376,7 +380,7 @@ static int mdd_changelog_llog_init(const struct lu_env *env,
        uctxt->loc_handle->lgh_logops->lop_add = llog_cat_add_rec;
        uctxt->loc_handle->lgh_logops->lop_declare_add = llog_cat_declare_add_rec;
 
-       rc = llog_cat_init_and_process(env, uctxt->loc_handle);
+       rc = llog_init_handle(env, uctxt->loc_handle, LLOG_F_IS_CAT, NULL);
        if (rc)
                GOTO(out_uclose, rc);
 
@@ -416,8 +420,6 @@ static int mdd_changelog_init(const struct lu_env *env, struct mdd_device *mdd)
        mdd->mdd_cl.mc_index = 0;
        spin_lock_init(&mdd->mdd_cl.mc_lock);
        mdd->mdd_cl.mc_starttime = cfs_time_current_64();
-       mdd->mdd_cl.mc_flags = 0; /* off by default */
-       mdd->mdd_cl.mc_mask = CHANGELOG_DEFMASK;
        spin_lock_init(&mdd->mdd_cl.mc_user_lock);
        mdd->mdd_cl.mc_lastuser = 0;
 
@@ -836,7 +838,7 @@ static int mdd_hsm_actions_llog_init(const struct lu_env *env,
                GOTO(out_cleanup, rc);
        }
 
-       rc = llog_cat_init_and_process(env, ctxt->loc_handle);
+       rc = llog_init_handle(env, ctxt->loc_handle, LLOG_F_IS_CAT, NULL);
        if (rc)
                GOTO(out_close, rc);