Skip to content

Commit a6cac66

Browse files
committed
crimson/os/seastore/transaction: rename ool_block_lists
Drop the inaccurate written_ prefix because they may be still writting when added to the lists. Signed-off-by: Yingxin Cheng <[email protected]>
1 parent 1c91120 commit a6cac66

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

src/crimson/os/seastore/cache.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ record_t Cache::prepare_record(
13221322
}
13231323
}
13241324

1325-
for (auto &i: t.written_ool_block_list) {
1325+
for (auto &i: t.ool_block_list) {
13261326
TRACET("fresh ool extent -- {}", t, *i);
13271327
ceph_assert(i->is_valid());
13281328
assert(!i->is_inline());
@@ -1340,7 +1340,7 @@ record_t Cache::prepare_record(
13401340
}
13411341
}
13421342

1343-
for (auto &i: t.written_inplace_ool_block_list) {
1343+
for (auto &i: t.inplace_ool_block_list) {
13441344
if (!i->is_valid()) {
13451345
continue;
13461346
}
@@ -1422,13 +1422,13 @@ record_t Cache::prepare_record(
14221422

14231423
ceph_assert(t.get_fresh_block_stats().num ==
14241424
t.inline_block_list.size() +
1425-
t.written_ool_block_list.size() +
1425+
t.ool_block_list.size() +
14261426
t.num_delayed_invalid_extents +
14271427
t.num_allocated_invalid_extents);
14281428

14291429
auto& ool_stats = t.get_ool_write_stats();
1430-
ceph_assert(ool_stats.extents.num == t.written_ool_block_list.size() +
1431-
t.written_inplace_ool_block_list.size());
1430+
ceph_assert(ool_stats.extents.num == t.ool_block_list.size() +
1431+
t.inplace_ool_block_list.size());
14321432

14331433
if (record.is_empty()) {
14341434
SUBINFOT(seastore_t,

src/crimson/os/seastore/transaction.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class Transaction {
198198
}
199199

200200
void mark_delayed_extent_ool(CachedExtentRef& ref) {
201-
written_ool_block_list.push_back(ref);
201+
ool_block_list.push_back(ref);
202202
}
203203

204204
void update_delayed_ool_extent_addr(LogicalCachedExtentRef& ref,
@@ -214,13 +214,13 @@ class Transaction {
214214
void mark_allocated_extent_ool(CachedExtentRef& ref) {
215215
assert(ref->get_paddr().is_absolute());
216216
assert(!ref->is_inline());
217-
written_ool_block_list.push_back(ref);
217+
ool_block_list.push_back(ref);
218218
}
219219

220220
void mark_inplace_rewrite_extent_ool(LogicalCachedExtentRef ref) {
221221
assert(ref->get_paddr().is_absolute());
222222
assert(!ref->is_inline());
223-
written_inplace_ool_block_list.push_back(ref);
223+
inplace_ool_block_list.push_back(ref);
224224
}
225225

226226
void add_inplace_rewrite_extent(CachedExtentRef ref) {
@@ -332,7 +332,7 @@ class Transaction {
332332

333333
template <typename F>
334334
auto for_each_finalized_fresh_block(F &&f) const {
335-
std::for_each(written_ool_block_list.begin(), written_ool_block_list.end(), f);
335+
std::for_each(ool_block_list.begin(), ool_block_list.end(), f);
336336
std::for_each(inline_block_list.begin(), inline_block_list.end(), f);
337337
}
338338

@@ -410,8 +410,8 @@ class Transaction {
410410
num_allocated_invalid_extents = 0;
411411
delayed_alloc_list.clear();
412412
inline_block_list.clear();
413-
written_ool_block_list.clear();
414-
written_inplace_ool_block_list.clear();
413+
ool_block_list.clear();
414+
inplace_ool_block_list.clear();
415415
pre_alloc_list.clear();
416416
pre_inplace_rewrite_list.clear();
417417
retired_set.clear();
@@ -555,7 +555,7 @@ class Transaction {
555555
* Contains a reference (without a refcount) to every extent mutated
556556
* as part of *this. No contained extent may be referenced outside
557557
* of *this. Every contained extent will be in one of inline_block_list,
558-
* written_ool_block_list or/and pre_alloc_list, mutated_block_list,
558+
* ool_block_list or/and pre_alloc_list, mutated_block_list,
559559
* or delayed_alloc_list.
560560
*/
561561
ExtentIndex write_set;
@@ -566,20 +566,23 @@ class Transaction {
566566
io_stat_t fresh_block_stats;
567567
uint64_t num_delayed_invalid_extents = 0;
568568
uint64_t num_allocated_invalid_extents = 0;
569-
/// fresh blocks with delayed allocation, may become inline or ool below
569+
/// fresh blocks with delayed allocation,
570+
/// may become inline_block_list or ool_block_list below
570571
std::list<CachedExtentRef> delayed_alloc_list;
571572
/// fresh blocks with pre-allocated addresses with RBM,
572-
/// should be released upon conflicts, will be added to ool below
573+
/// should be released upon conflicts,
574+
/// will be added to ool_block_list below
573575
std::list<CachedExtentRef> pre_alloc_list;
574-
/// dirty blocks for inplace rewrite with RBM, will be added to inplace ool below
576+
/// dirty blocks for inplace rewrite with RBM,
577+
/// will be added to inplace inplace_ool_block_list below
575578
std::list<LogicalCachedExtentRef> pre_inplace_rewrite_list;
576579

577580
/// fresh blocks that will be committed with inline journal record
578581
std::list<CachedExtentRef> inline_block_list;
579582
/// fresh blocks that will be committed with out-of-line record
580-
std::list<CachedExtentRef> written_ool_block_list;
583+
std::list<CachedExtentRef> ool_block_list;
581584
/// dirty blocks that will be committed out-of-line with inplace rewrite
582-
std::list<LogicalCachedExtentRef> written_inplace_ool_block_list;
585+
std::list<LogicalCachedExtentRef> inplace_ool_block_list;
583586

584587
/// list of mutated blocks, holds refcounts, subset of write_set
585588
std::list<CachedExtentRef> mutated_block_list;

0 commit comments

Comments
 (0)