Whamcloud - gitweb
lu_object: debugging, add ->loo_object_invariant() method and lu_object_invariant...
authornikita <nikita>
Thu, 22 Jun 2006 21:53:54 +0000 (21:53 +0000)
committernikita <nikita>
Thu, 22 Jun 2006 21:53:54 +0000 (21:53 +0000)
lustre/include/lu_object.h

index c96c5d1..840ec14 100644 (file)
@@ -188,6 +188,11 @@ struct lu_object_operations {
          */
         int (*loo_object_print)(const struct lu_context *ctx,
                                 struct seq_file *f, const struct lu_object *o);
+        /*
+         * Optional debugging method. Returns true iff method is internally
+         * consistent.
+         */
+        int (*loo_object_invariant)(const struct lu_object *o);
 };
 
 /*
@@ -589,7 +594,7 @@ static inline void lu_object_get(struct lu_object *o)
  * Return true of object will not be cached after last reference to it is
  * released.
  */
-static inline int lu_object_is_dying(struct lu_object_header *h)
+static inline int lu_object_is_dying(const struct lu_object_header *h)
 {
         return test_bit(LU_OBJECT_HEARD_BANSHEE, &h->loh_flags);
 }
@@ -668,6 +673,11 @@ int lu_object_print(const struct lu_context *ctxt,
                     struct seq_file *f, const struct lu_object *o);
 
 /*
+ * Check object consistency.
+ */
+int lu_object_invariant(const struct lu_object *o);
+
+/*
  * Returns true iff object @o exists on the stable storage.
  */
 static inline int lu_object_exists(const struct lu_context *ctx,