diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 81927870976..fc7ffd48aa7 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -1402,7 +1402,7 @@ public: if (item.is_delete()) { ceph_assert(missing.may_include_deletes); } - missing.add(oid, item.need, item.have, item.is_delete()); + missing.add(oid, std::move(item)); } else if (p->key().substr(0, 4) == string("dup_")) { pg_log_dup_t dup; decode(dup, bp); @@ -1650,7 +1650,7 @@ public: if (item.is_delete()) { ceph_assert(missing.may_include_deletes); } - missing.add(oid, item.need, item.have, item.is_delete()); + missing.add(oid, std::move(item)); } else if (p.first.substr(0, 4) == string("dup_")) { pg_log_dup_t dup; decode(dup, bp); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index b077c0aba2e..3755d14d5d1 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -4525,6 +4525,12 @@ public: tracker.changed(oid); } + void add(const hobject_t& oid, pg_missing_item&& item) { + rmissing[item.need.version] = oid; + missing.insert({oid, std::move(item)}); + tracker.changed(oid); + } + void rm(const hobject_t& oid, eversion_t v) { std::map::iterator p = missing.find(oid); if (p != missing.end() && p->second.need <= v)