void btree_range_pin_t::take_pin(btree_range_pin_t &other)
{
- assert(other.extent);
- assert(other.pins);
+ ceph_assert(other.extent);
+ ceph_assert(other.pins);
other.pins->replace_pin(*this, other);
pins = other.pins;
other.pins = nullptr;
btree_range_pin_t::~btree_range_pin_t()
{
- assert(!pins == !is_linked());
- assert(!ref);
+ ceph_assert(!pins == !is_linked());
+ ceph_assert(!ref);
if (pins) {
logger().debug("{}: removing {}", __func__, *this);
pins->remove_pin(*this, true);
void btree_pin_set_t::remove_pin(btree_range_pin_t &pin, bool do_check_parent)
{
logger().debug("{}: {}", __func__, pin);
- assert(pin.is_linked());
- assert(pin.pins);
- assert(!pin.ref);
+ ceph_assert(pin.is_linked());
+ ceph_assert(pin.pins);
+ ceph_assert(!pin.ref);
pins.erase(pin);
pin.pins = nullptr;
void btree_pin_set_t::release_if_no_children(btree_range_pin_t &pin)
{
- assert(pin.is_linked());
+ ceph_assert(pin.is_linked());
if (maybe_get_first_child(pin.range) == nullptr) {
pin.drop_ref();
}
void btree_pin_set_t::add_pin(btree_range_pin_t &pin)
{
- assert(!pin.is_linked());
- assert(!pin.pins);
- assert(!pin.ref);
+ ceph_assert(!pin.is_linked());
+ ceph_assert(!pin.pins);
+ ceph_assert(!pin.ref);
auto [prev, inserted] = pins.insert(pin);
if (!inserted) {
logger().error("{}: unable to add {}, found {}", __func__, pin, *prev);
- assert(0 == "impossible");
+ ceph_assert(0 == "impossible");
return;
}
pin.pins = this;
if (!pin.is_root()) {
auto *parent = maybe_get_parent(pin.range);
- assert(parent);
+ ceph_assert(parent);
if (!parent->has_ref()) {
logger().debug("{}: acquiring parent {}", __func__,
static_cast<void*>(parent));
static lba_node_meta_t merge_from(
const lba_node_meta_t &lhs, const lba_node_meta_t &rhs) {
- assert(lhs.depth == rhs.depth);
+ ceph_assert(lhs.depth == rhs.depth);
return lba_node_meta_t{lhs.begin, rhs.end, lhs.depth};
}
static std::pair<lba_node_meta_t, lba_node_meta_t>
rebalance(const lba_node_meta_t &lhs, const lba_node_meta_t &rhs, laddr_t pivot) {
- assert(lhs.depth == rhs.depth);
+ ceph_assert(lhs.depth == rhs.depth);
return std::make_pair(
lba_node_meta_t{lhs.begin, pivot, lhs.depth},
lba_node_meta_t{pivot, rhs.end, lhs.depth});
range = nrange;
}
void set_extent(CachedExtent *nextent) {
- assert(!extent);
+ ceph_assert(!extent);
extent = nextent;
}
void check_parent(btree_range_pin_t &pin);
~btree_pin_set_t() {
- assert(pins.empty());
+ ceph_assert(pins.empty());
}
};
}
extent_len_t get_length() const final {
- assert(pin.range.end > pin.range.begin);
+ ceph_assert(pin.range.end > pin.range.begin);
return pin.range.end - pin.range.begin;
}