Whamcloud - gitweb
b=13698 llapi_get_version
[fs/lustre-release.git] / lustre / include / lustre_log.h
index 6b21ff0..634a19b 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
 #ifndef _LUSTRE_LOG_H
 #define _LUSTRE_LOG_H
 
+/** \defgroup log log
+ *
+ * @{
+ */
+
 #if defined(__linux__)
 #include <linux/lustre_log.h>
 #elif defined(__APPLE__)
@@ -384,12 +389,10 @@ static inline void llog_gen_init(struct llog_ctxt *ctxt)
 {
         struct obd_device *obd = ctxt->loc_exp->exp_obd;
 
-        if (!strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME))
-                ctxt->loc_gen.mnt_cnt = obd->u.mds.mds_mount_count;
-        else if (!strstr(obd->obd_type->typ_name, LUSTRE_OST_NAME))
-                ctxt->loc_gen.mnt_cnt = obd->u.filter.fo_mount_count;
-        else
-                ctxt->loc_gen.mnt_cnt = 0;
+        LASSERTF(obd->u.obt.obt_magic == OBT_MAGIC,
+                 "%s: wrong obt magic %#x\n",
+                 obd->obd_name, obd->u.obt.obt_magic);
+        ctxt->loc_gen.mnt_cnt = obd->u.obt.obt_mount_count;
         ctxt->loc_gen.conn_cnt++;
 }
 
@@ -457,7 +460,7 @@ static inline void llog_group_init(struct obd_llog_group *olg, int group)
         cfs_waitq_init(&olg->olg_waitq);
         cfs_spin_lock_init(&olg->olg_lock);
         cfs_sema_init(&olg->olg_cat_processing, 1);
-        olg->olg_group = group;
+        olg->olg_seq = group;
 }
 
 static inline void llog_group_set_export(struct obd_llog_group *olg,
@@ -468,7 +471,7 @@ static inline void llog_group_set_export(struct obd_llog_group *olg,
         cfs_spin_lock(&olg->olg_lock);
         if (olg->olg_exp != NULL && olg->olg_exp != exp)
                 CWARN("%s: export for group %d is changed: 0x%p -> 0x%p\n",
-                      exp->exp_obd->obd_name, olg->olg_group,
+                      exp->exp_obd->obd_name, olg->olg_seq,
                       olg->olg_exp, exp);
         olg->olg_exp = exp;
         cfs_spin_unlock(&olg->olg_lock);
@@ -688,4 +691,6 @@ int lustre_process_log(struct super_block *sb, char *logname,
 int lustre_end_log(struct super_block *sb, char *logname,
                    struct config_llog_instance *cfg);
 
+/** @} log */
+
 #endif