- RETURN(cfs_hash_find_or_add(hs, key, hnode, 1) != hnode ?
- -EALREADY : 0);
+ return cfs_hash_find_or_add(hs, key, hnode, 1) != hnode ?
+ -EALREADY : 0;
- 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_hash_bd_for_each_hlist(hs, &bd, hhead) {
for (hnode = hhead->first; hnode != NULL;) {
cfs_hash_bucket_validate(hs, &bd, hnode);
cfs_hash_bd_for_each_hlist(hs, &bd, hhead) {
for (hnode = hhead->first; hnode != NULL;) {
cfs_hash_bucket_validate(hs, &bd, hnode);
cfs_hash_bd_unlock(hs, &bd, 0);
cfs_hash_unlock(hs, 0);
rc = func(hs, &bd, hnode, data);
if (stop_on_change)
cfs_hash_bd_unlock(hs, &bd, 0);
cfs_hash_unlock(hs, 0);
rc = func(hs, &bd, hnode, data);
if (stop_on_change)
cfs_hash_bd_lock(hs, &bd, 0);
hhead = cfs_hash_bd_hhead(hs, &bd);
cfs_hash_bd_lock(hs, &bd, 0);
hhead = cfs_hash_bd_hhead(hs, &bd);
if (rc != 0)
CDEBUG(D_INFO, "early quit of of rehashing: %d\n", rc);
/* cfs_workitem require us to always return 0 */
if (rc != 0)
CDEBUG(D_INFO, "early quit of of rehashing: %d\n", rc);
/* cfs_workitem require us to always return 0 */