summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Dachary <loic@dachary.org>2013-06-10 18:39:47 +0200
committerLoic Dachary <loic@dachary.org>2013-06-19 20:52:23 +0200
commite11cc1c8c3412127f4ce686c0146c2c3dcc2aea3 (patch)
treedb72a565d66eff07fe2e97c9405f2b828ccda7d8
parent02b3c552659299c7c7c2e789f0660f0add2f639f (diff)
downloadceph-e11cc1c8c3412127f4ce686c0146c2c3dcc2aea3.tar.gz
add constness to PGLog::proc_replica_log
The function is made const by replacing a single call to log.objects[] with log.objects.find. The olog argument is also a const and does not require any change. http://tracker.ceph.com/issues/5213 refs #5213 Signed-off-by: Loic Dachary <loic@dachary.org>
-rw-r--r--src/osd/PGLog.cc4
-rw-r--r--src/osd/PGLog.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc
index d62991e06d6..94639eedaff 100644
--- a/src/osd/PGLog.cc
+++ b/src/osd/PGLog.cc
@@ -154,7 +154,7 @@ void PGLog::trim(eversion_t trim_to, pg_info_t &info)
}
void PGLog::proc_replica_log(ObjectStore::Transaction& t,
- pg_info_t &oinfo, pg_log_t &olog, pg_missing_t& omissing, int from)
+ pg_info_t &oinfo, const pg_log_t &olog, pg_missing_t& omissing, int from) const
{
dout(10) << "proc_replica_log for osd." << from << ": "
<< oinfo << " " << olog << " " << omissing << dendl;
@@ -196,7 +196,7 @@ void PGLog::proc_replica_log(ObjectStore::Transaction& t,
continue;
}
- pg_log_entry_t& ne = *log.objects[oe.soid];
+ const pg_log_entry_t& ne = *(log.objects.find(oe.soid)->second);
if (ne.version == oe.version) {
dout(10) << " had " << oe << " new " << ne << " : match, stopping" << dendl;
lu = pp->version;
diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h
index bc40e23709b..d6e566a8eeb 100644
--- a/src/osd/PGLog.h
+++ b/src/osd/PGLog.h
@@ -336,8 +336,8 @@ public:
log.last_requested = 0;
}
- void proc_replica_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog,
- pg_missing_t& omissing, int from);
+ void proc_replica_log(ObjectStore::Transaction& t, pg_info_t &oinfo, const pg_log_t &olog,
+ pg_missing_t& omissing, int from) const;
protected:
bool merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe,