Skip to content

Commit bfc2aba

Browse files
committed
crimson/os/seastore/btree: drop FixedKVNode::child_pos_for_key()
Signed-off-by: Xuehan Xu <[email protected]>
1 parent dca239f commit bfc2aba

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/crimson/os/seastore/btree/fixed_kv_node.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ struct FixedKVNode : ChildableCachedExtent {
281281
return c.cache.template get_extent_viewable_by_trans<T>(c.trans, (T*)child);
282282
} else if (is_pending()) {
283283
auto &sparent = get_stable_for_key(key);
284-
auto spos = sparent.child_pos_for_key(key);
284+
auto spos = sparent.lower_bound_offset(key);
285285
auto child = sparent.children[spos];
286286
if (is_valid_child_ptr(child)) {
287287
return c.cache.template get_extent_viewable_by_trans<T>(c.trans, (T*)child);
@@ -454,7 +454,6 @@ struct FixedKVNode : ChildableCachedExtent {
454454

455455
virtual uint16_t lower_bound_offset(node_key_t) const = 0;
456456
virtual uint16_t upper_bound_offset(node_key_t) const = 0;
457-
virtual uint16_t child_pos_for_key(node_key_t) const = 0;
458457

459458
virtual bool validate_stable_children() = 0;
460459

@@ -687,13 +686,6 @@ struct FixedKVInternalNode
687686
return this->upper_bound(key).get_offset();
688687
}
689688

690-
uint16_t child_pos_for_key(NODE_KEY key) const final {
691-
auto it = this->upper_bound(key);
692-
assert(it != this->begin());
693-
--it;
694-
return it.get_offset();
695-
}
696-
697689
NODE_KEY get_key_from_idx(uint16_t idx) const final {
698690
return this->iter_idx(idx).get_key();
699691
}
@@ -1057,7 +1049,7 @@ struct FixedKVLeafNode
10571049
} else if (this->is_pending()) {
10581050
auto key = this->iter_idx(pos).get_key();
10591051
auto &sparent = this->get_stable_for_key(key);
1060-
auto spos = sparent.child_pos_for_key(key);
1052+
auto spos = sparent.lower_bound_offset(key);
10611053
auto child = sparent.children[spos];
10621054
if (is_valid_child_ptr(child)) {
10631055
ceph_assert(child->is_logical());
@@ -1147,10 +1139,6 @@ struct FixedKVLeafNode
11471139
return this->upper_bound(key).get_offset();
11481140
}
11491141

1150-
uint16_t child_pos_for_key(NODE_KEY key) const final {
1151-
return lower_bound_offset(key);
1152-
}
1153-
11541142
NODE_KEY get_key_from_idx(uint16_t idx) const final {
11551143
return this->iter_idx(idx).get_key();
11561144
}

0 commit comments

Comments
 (0)