From: nikita Date: Thu, 22 Jun 2006 21:53:54 +0000 (+0000) Subject: lu_object: debugging, add ->loo_object_invariant() method and lu_object_invariant... X-Git-Tag: v1_8_0_110~486^2~1569 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=367dccc028fc82781fe2d43ea7b0ee6b58f7daad;p=fs%2Flustre-release.git lu_object: debugging, add ->loo_object_invariant() method and lu_object_invariant() wrapper to check for object consistency --- diff --git a/lustre/include/lu_object.h b/lustre/include/lu_object.h index c96c5d1..840ec14 100644 --- a/lustre/include/lu_object.h +++ b/lustre/include/lu_object.h @@ -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,