From e68f2f0ff0fddf55b2eb6291d029537b22ddea8e Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Wed, 14 Mar 2018 17:32:47 -0700 Subject: [PATCH] PG: use clear_location() to clear out missing_loc Signed-off-by: Neha Ojha --- src/osd/PG.h | 9 +++++++++ src/osd/PrimaryLogPG.cc | 8 +------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index 1a8d012f7595a..8c8b8e4b3f0c3 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -782,6 +782,15 @@ protected: _inc_count(p->second); } } + + void clear_location(const hobject_t &hoid) { + auto p = missing_loc.find(hoid); + if (p != missing_loc.end()) { + _dec_count(p->second); + missing_loc.erase(p); + } + } + void add_active_missing(const pg_missing_t &missing) { for (map::const_iterator i = missing.get_items().begin(); diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 5f45e0245fd83..9395a89a4a55e 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10125,13 +10125,7 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx) if (requires_missing_loc) { // clear out missing_loc - set peers(missing_loc.get_locations(soid)); - for (set::iterator r = peers.begin(); - r != peers.end(); - ++r) { - pg_shard_t peer(*r); - missing_loc.remove_location(soid, peer); - } + missing_loc.clear_location(soid); for (set::const_iterator i = actingset.begin(); i != actingset.end(); ++i) { -- 2.39.5