summaryrefslogtreecommitdiffstats
path: root/src/crimson/os
diff options
context:
space:
mode:
authorYingxin Cheng <yingxin.cheng@intel.com>2024-08-27 10:26:06 +0200
committerYingxin Cheng <yingxin.cheng@intel.com>2024-09-02 04:57:56 +0200
commit339019377fb2a6c640e9135bb3cf3ec61970e244 (patch)
treefce66151f8c1aa2d7b8d7deb261d37a04a77e873 /src/crimson/os
parentcrimson/os/seastore/transaction_manager: minor cleanup (diff)
downloadceph-339019377fb2a6c640e9135bb3cf3ec61970e244.tar.xz
ceph-339019377fb2a6c640e9135bb3cf3ec61970e244.zip
crimson/os/seastore/cache: add asserts
Currently, cached must be stable, and absent must be clean. Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
Diffstat (limited to 'src/crimson/os')
-rw-r--r--src/crimson/os/seastore/cache.h8
-rw-r--r--src/crimson/os/seastore/cached_extent.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h
index 8ee1b9fdab4..647e146a3a5 100644
--- a/src/crimson/os/seastore/cache.h
+++ b/src/crimson/os/seastore/cache.h
@@ -423,6 +423,10 @@ public:
SUBTRACET(seastore_cache, "{} {}~{} is absent on t, query cache ...",
t, T::TYPE, offset, length);
auto f = [&t, this](CachedExtent &ext) {
+ // FIXME: assert(ext.is_stable_clean());
+ assert(ext.is_stable());
+ assert(T::TYPE == ext.get_type());
+
t.add_to_read_set(CachedExtentRef(&ext));
const auto t_src = t.get_src();
touch_extent(ext, &t_src);
@@ -762,6 +766,9 @@ private:
SUBTRACET(seastore_cache, "{} {}~{} {} is absent on t, query cache ...",
t, type, offset, length, laddr);
auto f = [&t, this](CachedExtent &ext) {
+ // FIXME: assert(ext.is_stable_clean());
+ assert(ext.is_stable());
+
t.add_to_read_set(CachedExtentRef(&ext));
const auto t_src = t.get_src();
touch_extent(ext, &t_src);
@@ -1791,6 +1798,7 @@ private:
!is_retired_placeholder_type(iter->get_type())) {
++p_counters->hit;
}
+ assert(iter->is_stable());
return CachedExtentRef(&*iter);
} else {
return CachedExtentRef();
diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h
index 96cf91b1d43..6c5c6c6fcc2 100644
--- a/src/crimson/os/seastore/cached_extent.h
+++ b/src/crimson/os/seastore/cached_extent.h
@@ -786,7 +786,7 @@ protected:
struct retired_placeholder_t{};
CachedExtent(retired_placeholder_t, extent_len_t _length)
- : state(extent_state_t::INVALID),
+ : state(extent_state_t::CLEAN),
length(_length) {
assert(length > 0);
}