LASSERT(hs);
LASSERT(hnode);
LASSERT(CFS_HO(hs));
+ LASSERT(CFS_HOP(hs, key));
- if (CFS_HOP(hs, key))
- return CFS_HOP(hs, key)(hnode);
-
- return NULL;
+ return CFS_HOP(hs, key)(hnode);
}
/* Returns 1 on a match,
#define cfs_hash_for_each_bucket(hs, hsb, pos) \
for (pos = 0; \
pos <= hs->hs_cur_mask && \
- ({ hsb = hs->hs_buckets[i]; 1; }); \
+ (hsb = hs->hs_buckets[pos]); \
pos++)
+#define cfs_hash_for_each_bucket_restart(hs, hsb, pos) \
+ for (/* pos=0 done once by caller */; \
+ pos <= hs->hs_cur_mask && \
+ (hsb = hs->hs_buckets[pos]); \
+ pos++)
/* !__LIBCFS__HASH_H__ */
#endif