Whamcloud - gitweb
b=18711
authorjxiong <jxiong>
Wed, 22 Apr 2009 00:45:23 +0000 (00:45 +0000)
committerjxiong <jxiong>
Wed, 22 Apr 2009 00:45:23 +0000 (00:45 +0000)
r=jay, adilger

in lu_context_key_deregister
- to not print message inside a spinlock
- assert when the key has extra references

lustre/obdclass/lu_object.c

index 8c55d6b..4aa0443 100644 (file)
@@ -1094,11 +1094,11 @@ void lu_context_key_degister(struct lu_context_key *key)
         ++key_set_version;
         spin_lock(&lu_keys_guard);
         key_fini(&lu_shrink_env.le_ctx, key->lct_index);
-
-        if (atomic_read(&key->lct_used) > 1)
-                CERROR("key has instances.\n");
         lu_keys[key->lct_index] = NULL;
         spin_unlock(&lu_keys_guard);
+
+        LASSERTF(atomic_read(&key->lct_used) == 1, "key has instances: %d\n",
+                 atomic_read(&key->lct_used));
 }
 EXPORT_SYMBOL(lu_context_key_degister);