* this needs to be called in log order as we extend the log. it
* assumes missing is accurate up through the previous log entry.
*/
-void PG::Missing::add_next_event(Log::Entry& e, const Info &info)
+void PG::Missing::add_next_event(const Log::Entry& e, const Info &info)
{
if (e.is_update()) {
if (e.prior_version == eversion_t()) {
void PG::Missing::rm(const hobject_t& oid, eversion_t v)
{
- if (missing.count(oid) && missing[oid].need <= v) {
- rmissing.erase(missing[oid].need.version);
- missing.erase(oid);
- }
+ std::map<hobject_t, Missing::item>::iterator p = missing.find(oid);
+ if (p != missing.end() && p->second.need <= v)
+ rm(p);
+}
+
+void PG::Missing::rm(const std::map<hobject_t, Missing::item>::iterator &m)
+{
+ rmissing.erase(m->second.need.version);
+ missing.erase(m);
}
void PG::Missing::got(const hobject_t& oid, eversion_t v)
{
- assert(missing.count(oid));
- assert(missing[oid].need <= v);
- rmissing.erase(missing[oid].need.version);
- missing.erase(oid);
+ std::map<hobject_t, Missing::item>::iterator p = missing.find(oid);
+ assert(p != missing.end());
+ assert(p->second.need <= v);
+ got(p);
}
void PG::Missing::got(const std::map<hobject_t, Missing::item>::iterator &m)
bool is_missing(const hobject_t& oid) const;
bool is_missing(const hobject_t& oid, eversion_t v) const;
eversion_t have_old(const hobject_t& oid) const;
- void add_next_event(Log::Entry& e, const Info &info);
+ void add_next_event(const Log::Entry& e, const Info &info);
void revise_need(hobject_t oid, eversion_t need);
void add(const hobject_t& oid, eversion_t need, eversion_t have);
void rm(const hobject_t& oid, eversion_t v);
+ void rm(const std::map<hobject_t, Missing::item>::iterator &m);
void got(const hobject_t& oid, eversion_t v);
void got(const std::map<hobject_t, Missing::item>::iterator &m);