#include "BtreeAllocator.h"
+#include <bit>
#include <limits>
#include "common/config_proxy.h"
<< " max_alloc_size 0x" << max_alloc_size
<< " hint 0x" << hint
<< std::dec << dendl;
- ceph_assert(isp2(unit));
+ ceph_assert(std::has_single_bit(unit));
ceph_assert(want % unit == 0);
if (max_alloc_size == 0) {
}
}
-void BtreeAllocator::dump(std::function<void(uint64_t offset, uint64_t length)> notify)
+void BtreeAllocator::foreach(std::function<void(uint64_t offset, uint64_t length)> notify)
{
+ std::lock_guard l(lock);
for (auto& rs : range_tree) {
notify(rs.first, rs.second - rs.first);
}