Whamcloud - gitweb
LU-5002 flock: accept EDEADLK in sanityn test_74
[fs/lustre-release.git] / libcfs / libcfs / hash.c
index af0b3a9..bfed025 100644 (file)
@@ -1035,8 +1035,10 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
         LASSERT(ops->hs_hash);
         LASSERT(ops->hs_object);
         LASSERT(ops->hs_keycmp);
-        LASSERT(ops->hs_get != NULL);
-        LASSERT(ops->hs_put_locked != NULL);
+       if ((flags & CFS_HASH_NO_ITEMREF) == 0) {
+               LASSERT(ops->hs_get != NULL);
+               LASSERT(ops->hs_put_locked != NULL);
+       }
 
         if ((flags & CFS_HASH_REHASH) != 0)
                 flags |= CFS_HASH_COUNTER; /* must have counter */
@@ -2131,7 +2133,7 @@ int cfs_hash_debug_str(cfs_hash_t *hs, char *str, int size)
 #endif
                 }
                 total += bd.bd_bucket->hsb_count;
-               dist[min(__fls(bd.bd_bucket->hsb_count/max(theta,1)),7UL)]++;
+                dist[min(fls(bd.bd_bucket->hsb_count/max(theta,1)),7)]++;
                 cfs_hash_bd_unlock(hs, &bd, 0);
         }
 
@@ -2200,7 +2202,7 @@ int cfs_hash_debug_str_seq(cfs_hash_t *hs, struct seq_file *m)
 #endif
                }
                total += bd.bd_bucket->hsb_count;
-               dist[min(__fls(bd.bd_bucket->hsb_count/max(theta,1)),7UL)]++;
+               dist[min(fls(bd.bd_bucket->hsb_count/max(theta,1)),7)]++;
                cfs_hash_bd_unlock(hs, &bd, 0);
        }