From ab3e0cbb056c0fa7b2160ca0c2bd9d5ac3e25cef Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 21 May 2021 15:27:31 +0200 Subject: [PATCH] librbd/cache/pwl/ssd: flushed_sync_gen capture is unused Signed-off-by: Ilya Dryomov (cherry picked from commit f8fb7609b30bf3e60a64e4282250b121151d1559) --- src/librbd/cache/pwl/ssd/WriteLog.cc | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/librbd/cache/pwl/ssd/WriteLog.cc b/src/librbd/cache/pwl/ssd/WriteLog.cc index e864dd4f65f02..eec483f8da77d 100644 --- a/src/librbd/cache/pwl/ssd/WriteLog.cc +++ b/src/librbd/cache/pwl/ssd/WriteLog.cc @@ -690,23 +690,23 @@ bool WriteLog::retire_entries(const unsigned long int frees_per_tx) { pool_root.first_valid_entry = first_valid_entry; Context *ctx = new LambdaContext( - [this, flushed_sync_gen, first_valid_entry, - initial_first_valid_entry, retiring_entries](int r) { - uint64_t allocated_bytes = 0; - uint64_t cached_bytes = 0; - uint64_t former_log_pos = 0; - for (auto &entry : retiring_entries) { - ceph_assert(entry->log_entry_index != 0); - if (entry->log_entry_index != former_log_pos ) { - // Space for control blocks - allocated_bytes += MIN_WRITE_ALLOC_SSD_SIZE; - former_log_pos = entry->log_entry_index; - } - if (entry->is_write_entry()) { - cached_bytes += entry->write_bytes(); - //space for userdata - allocated_bytes += entry->get_aligned_data_size(); - } + [this, first_valid_entry, initial_first_valid_entry, + retiring_entries](int r) { + uint64_t allocated_bytes = 0; + uint64_t cached_bytes = 0; + uint64_t former_log_pos = 0; + for (auto &entry : retiring_entries) { + ceph_assert(entry->log_entry_index != 0); + if (entry->log_entry_index != former_log_pos ) { + // Space for control blocks + allocated_bytes += MIN_WRITE_ALLOC_SSD_SIZE; + former_log_pos = entry->log_entry_index; + } + if (entry->is_write_entry()) { + cached_bytes += entry->write_bytes(); + // space for userdata + allocated_bytes += entry->get_aligned_data_size(); + } } { std::lock_guard locker(m_lock); @@ -736,8 +736,8 @@ bool WriteLog::retire_entries(const unsigned long int frees_per_tx) { this->process_writeback_dirty_entries(); }); - std::lock_guard locker(m_lock); - schedule_update_root(new_root, ctx); + std::lock_guard locker(m_lock); + schedule_update_root(new_root, ctx); } else { ldout(cct, 20) << "Nothing to retire" << dendl; return false; -- 2.39.5