Skip to content

Commit

Permalink
Merge pull request ceph#38721 from changchengx/pwl
Browse files Browse the repository at this point in the history
librbd/cache/pwl: fix parameter type to update argument

Reviewed-by: Xiaoyan Li <[email protected]>
Reviewed-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman authored Jan 14, 2021
2 parents 334a783 + 2a7f497 commit e2e76b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/librbd/cache/pwl/AbstractWriteLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void AbstractWriteLog<I>::arm_periodic_stats() {
}

template <typename I>
void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> log_entry,
void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> *log_entry,
WriteLogCacheEntry *cache_entry, std::map<uint64_t, bool> &missing_sync_points,
std::map<uint64_t, std::shared_ptr<SyncPointLogEntry>> &sync_point_entries,
int entry_index) {
Expand All @@ -347,7 +347,7 @@ void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> log_en
ldout(m_image_ctx.cct, 20) << "Entry " << entry_index
<< " is a sync point. cache_entry=[" << *cache_entry << "]" << dendl;
auto sync_point_entry = std::make_shared<SyncPointLogEntry>(cache_entry->sync_gen_number);
log_entry = sync_point_entry;
*log_entry = sync_point_entry;
sync_point_entries[cache_entry->sync_gen_number] = sync_point_entry;
missing_sync_points.erase(cache_entry->sync_gen_number);
m_current_sync_gen = cache_entry->sync_gen_number;
Expand All @@ -357,22 +357,22 @@ void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> log_en
auto write_entry =
m_builder->create_write_log_entry(nullptr, cache_entry->image_offset_bytes, cache_entry->write_bytes);
write_data_to_buffer(write_entry, cache_entry);
log_entry = write_entry;
*log_entry = write_entry;
} else if (cache_entry->is_writesame()) {
ldout(m_image_ctx.cct, 20) << "Entry " << entry_index
<< " is a write same. cache_entry=[" << *cache_entry << "]" << dendl;
auto ws_entry =
m_builder->create_writesame_log_entry(nullptr, cache_entry->image_offset_bytes,
cache_entry->write_bytes, cache_entry->ws_datalen);
write_data_to_buffer(ws_entry, cache_entry);
log_entry = ws_entry;
*log_entry = ws_entry;
} else if (cache_entry->is_discard()) {
ldout(m_image_ctx.cct, 20) << "Entry " << entry_index
<< " is a discard. cache_entry=[" << *cache_entry << "]" << dendl;
auto discard_entry =
std::make_shared<DiscardLogEntry>(nullptr, cache_entry->image_offset_bytes, cache_entry->write_bytes,
m_discard_granularity_bytes);
log_entry = discard_entry;
*log_entry = discard_entry;
} else {
lderr(m_image_ctx.cct) << "Unexpected entry type in entry " << entry_index
<< ", cache_entry=[" << *cache_entry << "]" << dendl;
Expand Down
2 changes: 1 addition & 1 deletion src/librbd/cache/pwl/AbstractWriteLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class AbstractWriteLog {
void wake_up();

void update_entries(
std::shared_ptr<pwl::GenericLogEntry> log_entry,
std::shared_ptr<pwl::GenericLogEntry> *log_entry,
pwl::WriteLogCacheEntry *cache_entry,
std::map<uint64_t, bool> &missing_sync_points,
std::map<uint64_t,
Expand Down
2 changes: 1 addition & 1 deletion src/librbd/cache/pwl/rwl/WriteLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void WriteLog<I>::load_existing_entries(DeferredContexts &later) {
std::shared_ptr<GenericLogEntry> log_entry = nullptr;
ceph_assert(pmem_entry->entry_index == entry_index);

this->update_entries(log_entry, pmem_entry, missing_sync_points,
this->update_entries(&log_entry, pmem_entry, missing_sync_points,
sync_point_entries, entry_index);

log_entry->ram_entry = *pmem_entry;
Expand Down
2 changes: 1 addition & 1 deletion src/librbd/cache/pwl/ssd/WriteLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void WriteLog<I>::load_existing_entries(pwl::DeferredContexts &later) {
std::shared_ptr<GenericLogEntry> log_entry = nullptr;

for (auto it = ssd_log_entries.begin(); it != ssd_log_entries.end(); ++it) {
this->update_entries(log_entry, &*it, missing_sync_points,
this->update_entries(&log_entry, &*it, missing_sync_points,
sync_point_entries, curr_log_pos);
log_entry->ram_entry = *it;
log_entry->log_entry_index = curr_log_pos;
Expand Down

0 comments on commit e2e76b5

Please sign in to comment.