Whamcloud - gitweb
LU-2600 osd-zfs: batched object accounting
[fs/lustre-release.git] / libcfs / libcfs / hash.c
index 0c4faf8..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 */