Whamcloud - gitweb
b=19813 cfs_hash_cond_del doesn't have dance of addref/decref anymore
[fs/lustre-release.git] / libcfs / libcfs / hash.c
index d676005..738e4f9 100644 (file)
@@ -1546,7 +1546,9 @@ CFS_EXPORT_SYMBOL(cfs_hash_is_empty);
 __u64
 cfs_hash_size_get(cfs_hash_t *hs)
 {
-        return cfs_hash_for_each_tight(hs, NULL, NULL, 0);
+        return cfs_hash_with_counter(hs) ?
+               cfs_atomic_read(&hs->hs_count) :
+               cfs_hash_for_each_tight(hs, NULL, NULL, 0);
 }
 CFS_EXPORT_SYMBOL(cfs_hash_size_get);