* table. Also, user can break the iteration by return 1 in callback.
*/
#include <linux/seq_file.h>
+#include <linux/log2.h>
#include <libcfs/linux/linux-list.h>
#include <libcfs/libcfs.h>
if (rc == 0) {
bd2->bd_bucket = NULL;
- } else if (rc > 0) { /* swab bd1 and bd2 */
- struct cfs_hash_bd tmp;
-
- tmp = *bd2;
- *bd2 = *bd1;
- *bd1 = tmp;
+ } else if (rc > 0) {
+ swap(*bd1, *bd2); /* swab bd1 and bd2 */
}
}
for (i = 2; cfs_hash_is_rehashing(hs); i++) {
cfs_hash_unlock(hs, 1);
/* raise console warning while waiting too long */
- CDEBUG(IS_PO2(i >> 3) ? D_WARNING : D_INFO,
+ CDEBUG(is_power_of_2(i >> 3) ? D_WARNING : D_INFO,
"hash %s is still rehashing, rescheded %d\n",
hs->hs_name, i - 1);
cond_resched();