Whamcloud - gitweb
LU-2349 osp: Move log ops init to module init.
[fs/lustre-release.git] / lustre / osp / osp_dev.c
index 18ac9a8..7d5cb30 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <obd_class.h>
 #include <lustre_param.h>
+#include <lustre_log.h>
 
 #include "osp_internal.h"
 
@@ -971,6 +972,8 @@ static struct obd_ops osp_obd_device_ops = {
        .o_statfs       = osp_obd_statfs,
 };
 
+struct llog_operations osp_mds_ost_orig_logops;
+
 static int __init osp_mod_init(void)
 {
        struct lprocfs_static_vars       lvars;
@@ -992,6 +995,11 @@ static int __init osp_mod_init(void)
                return rc;
        }
 
+       /* Note: add_rec/delcare_add_rec will be only used by catalogs */
+       osp_mds_ost_orig_logops = llog_osd_ops;
+       osp_mds_ost_orig_logops.lop_add = llog_cat_add_rec;
+       osp_mds_ost_orig_logops.lop_declare_add = llog_cat_declare_add_rec;
+
        osc_proc_dir = lprocfs_srch(proc_lustre_root, "osc");
        if (osc_proc_dir == NULL) {
                osc_proc_dir = lprocfs_register("osc", proc_lustre_root, NULL,