From 5335c8de8ecf7f2a2e324bb810bc2e859af68cbd Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 17 Oct 2020 22:41:06 +0000 Subject: [PATCH] Do not use unordered_map for list_ops/list_results --- osd_peering.cpp | 6 ++---- osd_peering_pg.cpp | 1 + osd_peering_pg.h | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osd_peering.cpp b/osd_peering.cpp index b29c8385..1d223885 100644 --- a/osd_peering.cpp +++ b/osd_peering.cpp @@ -220,8 +220,7 @@ void osd_t::start_pg_peering(pg_t & pg) { // Discard the result after completion, which, chances are, will be unsuccessful discard_list_subop(it->second); - pg.peering_state->list_ops.erase(it); - it = pg.peering_state->list_ops.begin(); + pg.peering_state->list_ops.erase(it++); } else it++; @@ -234,8 +233,7 @@ void osd_t::start_pg_peering(pg_t & pg) { free(it->second.buf); } - pg.peering_state->list_results.erase(it); - it = pg.peering_state->list_results.begin(); + pg.peering_state->list_results.erase(it++); } else it++; diff --git a/osd_peering_pg.cpp b/osd_peering_pg.cpp index d844dd58..25a0eda8 100644 --- a/osd_peering_pg.cpp +++ b/osd_peering_pg.cpp @@ -1,6 +1,7 @@ // Copyright (c) Vitaliy Filippov, 2019+ // License: VNPL-1.0 (see README.md for details) +#include #include "osd_peering_pg.h" struct obj_ver_role diff --git a/osd_peering_pg.h b/osd_peering_pg.h index f4d07ffe..c2ba4b92 100644 --- a/osd_peering_pg.h +++ b/osd_peering_pg.h @@ -2,7 +2,6 @@ // License: VNPL-1.0 (see README.md for details) #include -#include #include #include @@ -45,8 +44,8 @@ struct osd_op_t; struct pg_peering_state_t { // osd_num -> list result - std::unordered_map list_ops; - std::unordered_map list_results; + std::map list_ops; + std::map list_results; pool_id_t pool_id = 0; pg_num_t pg_num = 0; };