parent_pos=std::move(parent_pos)]
(internal_node_t &node) {
using tree_root_linker_t = TreeRootLinker<RootBlock, internal_node_t>;
- assert(!node.is_pending());
+ assert(node.is_stable());
assert(!node.is_linked());
node.range = fixed_kv_node_meta_t<node_key_t>{begin, end, depth};
if (parent_pos) {
auto &stable_root = (RootBlockRef&)*root_block->get_prior_instance();
tree_root_linker_t::link_root(stable_root, &node);
} else {
- assert(!root_block->is_pending());
+ assert(root_block->is_stable());
tree_root_linker_t::link_root(root_block, &node);
}
}
*ret);
// This can only happen during init_cached_extent
// or when backref extent being rewritten by gc space reclaiming
- if (!ret->is_pending() && !ret->is_linked()) {
+ if (ret->is_stable() && !ret->is_linked()) {
assert(ret->has_delta() || is_backref_node(ret->get_type()));
init_internal(*ret);
}
parent_pos=std::move(parent_pos)]
(leaf_node_t &node) {
using tree_root_linker_t = TreeRootLinker<RootBlock, leaf_node_t>;
- assert(!node.is_pending());
+ assert(node.is_stable());
assert(!node.is_linked());
node.range = fixed_kv_node_meta_t<node_key_t>{begin, end, 1};
if (parent_pos) {
auto &stable_root = (RootBlockRef&)*root_block->get_prior_instance();
tree_root_linker_t::link_root(stable_root, &node);
} else {
- assert(!root_block->is_pending());
+ assert(root_block->is_stable());
tree_root_linker_t::link_root(root_block, &node);
}
}
*ret);
// This can only happen during init_cached_extent
// or when backref extent being rewritten by gc space reclaiming
- if (!ret->is_pending() && !ret->is_linked()) {
+ if (ret->is_stable() && !ret->is_linked()) {
assert(ret->has_delta() || is_backref_node(ret->get_type()));
init_leaf(*ret);
}
}
virtual ~FixedKVInternalNode() {
- if (this->is_valid() && !this->is_pending()) {
+ if (this->is_stable()) {
if (this->is_btree_root()) {
this->root_node_t::destroy();
} else {
}
virtual ~FixedKVLeafNode() {
- if (this->is_valid() && !this->is_pending()) {
+ if (this->is_stable()) {
if (this->is_btree_root()) {
this->root_node_t::destroy();
} else {
void rewrite(Transaction &t, CachedExtent &e, extent_len_t o) {
assert(is_initial_pending());
- if (!e.is_pending()) {
+ assert(e.is_valid());
+ if (e.is_stable()) {
set_prior_instance(&e);
} else {
assert(e.has_mutation());
state == extent_state_t::EXIST_MUTATION_PENDING;
}
- /// Returns true if extent is part of an open transaction
+ /// Returns true if extent is part of an open transaction,
+ /// normally equivalent to !is_stable.
bool is_pending() const {
return is_mutable() || state == extent_state_t::EXIST_CLEAN;
}
return (has_mutation() || is_initial_pending()) && is_pending_io();
}
- /// Returns true if extent is stable and shared among transactions
+ /// Returns true if extent is stable and shared among transactions,
+ /// normally equivalent to !is_pending
bool is_stable() const {
return is_stable_written() || is_stable_writting();
}
iter.get_key() == logn->get_laddr() &&
iter.get_val().pladdr.is_paddr() &&
iter.get_val().pladdr.get_paddr() == logn->get_paddr()) {
- assert(!iter.get_leaf_node()->is_pending());
+ assert(iter.get_leaf_node()->is_stable());
iter.get_leaf_node()->link_child(logn.get(), iter.get_leaf_pos());
logn->set_laddr(iter.get_key());
ceph_assert(iter.get_val().len == e->get_length());
virtual key_t node_begin() const = 0;
protected:
parent_tracker_ref<ParentT> parent_tracker;
- virtual bool valid() const = 0;
- virtual bool pending() const = 0;
+ virtual bool _is_valid() const = 0;
+ virtual bool _is_stable() const = 0;
template <typename, typename, typename>
friend class ParentNode;
};
assert(pos < me.get_size());
assert(pos < children.capacity());
assert(child);
- ceph_assert(!me.is_pending());
- assert(child->valid() && !child->pending());
+ ceph_assert(me.is_stable());
+ assert(child->_is_stable());
assert(!children[pos]);
ceph_assert(is_valid_child_ptr(child));
update_child_ptr(pos, child);
void on_rewrite(Transaction &t, T &foreign_extent) {
auto &me = down_cast();
- if (!foreign_extent.is_pending()) {
+ if (foreign_extent.is_stable()) {
foreign_extent.add_copy_dest(t, &me);
copy_sources.emplace(&foreign_extent);
} else {
T &src)
{
ceph_assert(dest.is_initial_pending());
- if (!src.is_pending()) {
+ if (src.is_stable()) {
src.add_copy_dest(t, &dest);
dest.copy_sources.emplace(&src);
} else if (src.is_mutation_pending()) {
for (auto it = children.begin();
it != children.begin() + down_cast().get_size();
it++) {
- if (is_valid_child_ptr(*it) && (*it)->valid()) {
+ if (is_valid_child_ptr(*it) && (*it)->_is_valid()) {
return false;
}
}
assert(iter.get_key() == me.get_begin());
return iter.get_offset();
}
- bool valid() const final {
+ bool _is_valid() const final {
return down_cast().is_valid();
}
- bool pending() const final {
- return down_cast().is_pending();
+ bool _is_stable() const final {
+ return down_cast().is_stable();
}
key_t node_begin() const final {
return down_cast().get_begin();
LogicalChildNode(T&&... t) : LogicalCachedExtent(std::forward<T>(t)...) {}
virtual ~LogicalChildNode() {
- if (this->is_valid() &&
- !this->is_pending()) {
+ if (this->is_stable()) {
lba_child_node_t::destroy();
}
}
}
~OMapInnerNode() {
- if (this->is_valid()
- && !this->is_pending()
+ if (this->is_stable()
&& !this->is_btree_root()
// dirty omap extent may not be accessed/linked yet
&& this->base_child_t::has_parent_tracker()) {
}
~OMapLeafNode() {
- if (this->is_valid()
- && !this->is_pending()
+ if (this->is_stable()
&& !this->is_btree_root()
// dirty omap extent may not be accessed/linked yet
&& this->base_child_t::has_parent_tracker()) {