Whamcloud - gitweb
b=19557 actually make lustre_hash_for_each_empty() more efficient
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_hash.h
index 769854f..e195c24 100644 (file)
@@ -407,8 +407,13 @@ cfs_hash_u64_hash(__u64 key, unsigned mask)
 #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