Whamcloud - gitweb
LU-2349 osp: Move log ops init to module init.
[fs/lustre-release.git] / lustre / mdd / mdd_device.c
index 2670c1f..104d2b5 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -301,8 +301,6 @@ static int mdd_changelog_llog_init(const struct lu_env *env,
        if (rc)
                RETURN(-ENODEV);
 
-       changelog_orig_logops = llog_osd_ops;
-       changelog_orig_logops.lop_cancel = llog_changelog_cancel;
        rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CHANGELOG_ORIG_CTXT,
                        obd, &changelog_orig_logops);
        if (rc) {
@@ -319,10 +317,6 @@ static int mdd_changelog_llog_init(const struct lu_env *env,
        if (rc)
                GOTO(out_cleanup, rc);
 
-       ctxt->loc_handle->lgh_logops->lop_add = llog_cat_add_rec;
-       ctxt->loc_handle->lgh_logops->lop_declare_add =
-                                       llog_cat_declare_add_rec;
-
        rc = llog_cat_init_and_process(env, ctxt->loc_handle);
        if (rc)
                GOTO(out_close, rc);
@@ -1766,6 +1760,11 @@ static int __init mdd_mod_init(void)
        if (rc)
                return rc;
 
+       changelog_orig_logops = llog_osd_ops;
+       changelog_orig_logops.lop_cancel = llog_changelog_cancel;
+       changelog_orig_logops.lop_add = llog_cat_add_rec;
+       changelog_orig_logops.lop_declare_add = llog_cat_declare_add_rec;
+
        llo_local_obj_register(&llod_capa_key);
        llo_local_obj_register(&llod_mdd_orphan);
        llo_local_obj_register(&llod_mdd_root);