__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);
struct nid_stat *stat = obj;
int i;
ENTRY;
- /* object has only hash + iterate_all references.
- * add/delete blocked by hash bucket lock */
+
CDEBUG(D_INFO,"refcnt %d\n", cfs_atomic_read(&stat->nid_exp_ref_count));
- if (cfs_atomic_read(&stat->nid_exp_ref_count) == 2) {
+ if (cfs_atomic_read(&stat->nid_exp_ref_count) == 1) {
+ /* object has only hash references. */
cfs_spin_lock(&stat->nid_obd->obd_nid_lock);
cfs_list_move(&stat->nid_list, data);
cfs_spin_unlock(&stat->nid_obd->obd_nid_lock);