crimson/os/seastore/cache: drop the unnecessary friend fixed_kv_btree

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin Cheng 2024-03-07 13:42:51 +08:00
parent ac30ee6cd9
commit 0558ef8b1a
2 changed files with 9 additions and 13 deletions

View File

@ -579,12 +579,12 @@ public:
if constexpr (
std::is_base_of_v<typename internal_node_t::base_t, child_node_t>)
{
assert(!c.cache.query_cache(i->get_val(), nullptr));
assert(!c.cache.test_query_cache(i->get_val()));
} else {
if constexpr (leaf_has_children) {
assert(i->get_val().pladdr.is_paddr()
? (bool)!c.cache.query_cache(
i->get_val().pladdr.get_paddr(), nullptr)
? (bool)!c.cache.test_query_cache(
i->get_val().pladdr.get_paddr())
: true);
}
}

View File

@ -600,6 +600,12 @@ public:
return epm.get_block_size();
}
// Interfaces only for tests.
public:
CachedExtentRef test_query_cache(paddr_t offset) {
return query_cache(offset, nullptr);
}
private:
// This is a workaround std::move_only_function not being available,
// not really worth generalizing at this time.
@ -1732,16 +1738,6 @@ private:
return CachedExtentRef();
}
}
template <
typename node_key_t,
typename node_val_t,
typename internal_node_t,
typename leaf_node_t,
typename pin_t,
size_t node_size,
bool leaf_has_children>
friend class FixedKVBtree;
};
using CacheRef = std::unique_ptr<Cache>;