Skip to content

Commit 96ca322

Browse files
committed
crimson/os/seastore/cache: pass missing src to touch_extent()
Signed-off-by: Yingxin Cheng <[email protected]>
1 parent aa86e49 commit 96ca322

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/crimson/os/seastore/cache.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ record_t Cache::prepare_record(
13421342
i->state = CachedExtent::extent_state_t::CLEAN;
13431343
assert(i->is_logical());
13441344
i->clear_modified_region();
1345-
touch_extent(*i);
1345+
touch_extent(*i, &trans_src);
13461346
DEBUGT("inplace rewrite ool block is commmitted -- {}", t, *i);
13471347
}
13481348

@@ -1895,7 +1895,7 @@ Cache::replay_delta(
18951895
nullptr,
18961896
[](CachedExtent &) {},
18971897
[this](CachedExtent &ext) {
1898-
touch_extent(ext);
1898+
touch_extent(ext, nullptr);
18991899
}) :
19001900
_get_extent_if_cached(
19011901
delta.paddr)

src/crimson/os/seastore/cache.h

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ class Cache {
327327
SUBDEBUGT(seastore_cache, "{} {} is present in cache -- {}",
328328
t, type, offset, *ret);
329329
t.add_to_read_set(ret);
330-
touch_extent(*ret);
330+
const auto t_src = t.get_src();
331+
touch_extent(*ret, &t_src);
331332
return ret->wait_io().then([ret] {
332333
return get_extent_if_cached_iertr::make_ready_future<
333334
CachedExtentRef>(ret);
@@ -383,7 +384,8 @@ class Cache {
383384
t, T::TYPE, offset, length);
384385
auto f = [&t, this](CachedExtent &ext) {
385386
t.add_to_read_set(CachedExtentRef(&ext));
386-
touch_extent(ext);
387+
const auto t_src = t.get_src();
388+
touch_extent(ext, &t_src);
387389
};
388390
auto metric_key = std::make_pair(t.get_src(), T::TYPE);
389391
return trans_intr::make_interruptible(
@@ -420,7 +422,8 @@ class Cache {
420422
t, T::TYPE, offset, length);
421423
auto f = [&t, this](CachedExtent &ext) {
422424
t.add_to_read_set(CachedExtentRef(&ext));
423-
touch_extent(ext);
425+
const auto t_src = t.get_src();
426+
touch_extent(ext, &t_src);
424427
};
425428
auto metric_key = std::make_pair(t.get_src(), T::TYPE);
426429
return trans_intr::make_interruptible(
@@ -494,7 +497,8 @@ class Cache {
494497
// stable from trans-view
495498
assert(!p_extent->is_pending_in_trans(t.get_trans_id()));
496499
if (t.maybe_add_to_read_set(p_extent)) {
497-
touch_extent(*p_extent);
500+
const auto t_src = t.get_src();
501+
touch_extent(*p_extent, &t_src);
498502
}
499503
}
500504
} else {
@@ -510,7 +514,6 @@ class Cache {
510514
}
511515
}
512516

513-
assert(p_extent->is_stable() || p_extent->is_exist_clean());
514517
// user should not see RETIRED_PLACEHOLDER extents
515518
ceph_assert(p_extent->get_type() != extent_types_t::RETIRED_PLACEHOLDER);
516519
if (!p_extent->is_fully_loaded()) {
@@ -723,7 +726,8 @@ class Cache {
723726
t, type, offset, length, laddr);
724727
auto f = [&t, this](CachedExtent &ext) {
725728
t.add_to_read_set(CachedExtentRef(&ext));
726-
touch_extent(ext);
729+
const auto t_src = t.get_src();
730+
touch_extent(ext, &t_src);
727731
};
728732
auto src = t.get_src();
729733
return trans_intr::make_interruptible(
@@ -757,7 +761,8 @@ class Cache {
757761
t, type, offset, length, laddr);
758762
auto f = [&t, this](CachedExtent &ext) {
759763
t.add_to_read_set(CachedExtentRef(&ext));
760-
touch_extent(ext);
764+
const auto t_src = t.get_src();
765+
touch_extent(ext, &t_src);
761766
};
762767
auto src = t.get_src();
763768
return trans_intr::make_interruptible(
@@ -1350,7 +1355,7 @@ class Cache {
13501355
/// Update lru for access to ref
13511356
void touch_extent(
13521357
CachedExtent &ext,
1353-
const Transaction::src_t* p_src=nullptr)
1358+
const Transaction::src_t* p_src)
13541359
{
13551360
if (p_src &&
13561361
is_background_transaction(*p_src) &&

0 commit comments

Comments
 (0)