Skip to content

Commit

Permalink
minor style changes...
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhaskar Bora committed Jan 21, 2025
1 parent 1f2d280 commit 6216416
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/llfs/page_allocator_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,14 @@ void run_ref_count_update_sanity_checks(const PageIdFactory& id_factory,
<< BATT_INSPECT(new_count) << ")" << BATT_INSPECT(delta_generation) << BATT_INSPECT(index);
};

LLFS_VLOG(2) << "rrcusc: " << debug_info;
LLFS_VLOG(2) << debug_info;

BATT_CHECK_GE(old_count, 0) << "ref counts must be non-negative" << debug_info;
BATT_CHECK_GE(new_count, 0) << "ref counts must be non-negative" << debug_info;

if (old_count == new_count) {
BATT_CHECK_EQ(delta.ref_count, 0)
<< "delta was non-zero but count did not change (bbora)" << debug_info;
<< "delta was non-zero but count did not change" << debug_info;
return;
}

Expand Down
10 changes: 6 additions & 4 deletions src/llfs/page_recycler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ StatusOr<SlotRange> refresh_recycler_info_slot(TypedSlotWriter<PageRecycleEvent>
/*static*/ u64 PageRecycler::calculate_log_size(const PageRecyclerOptions& options,
Optional<PageCount> max_buffered_page_count)
{
const usize log_size_raw = calculate_log_size_no_padding(options, max_buffered_page_count);
const usize log_size_raw =
PageRecycler::calculate_log_size_no_padding(options, max_buffered_page_count);
const usize padding_bytes = 1 * kKiB;

return round_up_to_page_size_multiple(log_size_raw + padding_bytes);
Expand Down Expand Up @@ -175,7 +176,7 @@ StatusOr<SlotRange> refresh_recycler_info_slot(TypedSlotWriter<PageRecycleEvent>

return std::unique_ptr<PageRecycler>{
new PageRecycler(scheduler, std::string{name}, page_deleter, std::move(*recovered_log),
std::move(latest_batch), std::move(state), visitor.largest_offset())};
std::move(latest_batch), std::move(state), visitor.largest_unique_offset())};
}

//==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - -
Expand All @@ -184,7 +185,7 @@ PageRecycler::PageRecycler(batt::TaskScheduler& scheduler, const std::string& na
PageDeleter& page_deleter, std::unique_ptr<LogDevice>&& wal_device,
Optional<Batch>&& recovered_batch,
std::unique_ptr<PageRecycler::State>&& state,
u64 largest_offset_as_unique_identifier_init) noexcept
llfs::slot_offset_type largest_offset_as_unique_identifier_init) noexcept
: scheduler_{scheduler}
, name_{name}
, page_deleter_{page_deleter}
Expand Down Expand Up @@ -329,7 +330,8 @@ StatusOr<slot_offset_type> PageRecycler::recycle_pages(
LLFS_VLOG(1) << "PageRecycler::recycle_pages(page_ids=" << batt::dump_range(page_ids) << "["
<< page_ids.size() << "]"
<< ", grant=[" << (grant ? grant->size() : usize{0}) << "], depth=" << depth << ") "
<< this->name_ << BATT_INSPECT(offset_as_unique_identifier);
<< this->name_ << BATT_INSPECT(offset_as_unique_identifier)
<< BATT_INSPECT(this->largest_offset_as_unique_identifier_);

if (page_ids.empty()) {
return this->wal_device_->slot_range(LogReadMode::kDurable).upper_bound;
Expand Down
2 changes: 1 addition & 1 deletion src/llfs/page_recycler_recovery_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Optional<SlotRange> PageRecyclerRecoveryVisitor::latest_info_refresh_slot() cons

//==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - -
//
u64 PageRecyclerRecoveryVisitor::largest_offset() const
slot_offset_type PageRecyclerRecoveryVisitor::largest_unique_offset() const
{
return this->largest_offset_as_unique_identifier_;
}
Expand Down
6 changes: 4 additions & 2 deletions src/llfs/page_recycler_recovery_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PageRecyclerRecoveryVisitor

Optional<SlotRange> latest_info_refresh_slot() const;

u64 largest_offset() const;
slot_offset_type largest_unique_offset() const;

//+++++++++++-+-+--+----- --- -- - - - -

Expand Down Expand Up @@ -82,7 +82,9 @@ class PageRecyclerRecoveryVisitor
*/
Optional<SlotRange> latest_info_refresh_slot_;

u64 largest_offset_as_unique_identifier_;
// This is to track largest unique_offset value during recovery.
//
slot_offset_type largest_offset_as_unique_identifier_;
};

} // namespace llfs
Expand Down

0 comments on commit 6216416

Please sign in to comment.