Browse Source

Do not use unordered_map for list_ops/list_results

tags/v0.5.1
Vitaliy Filippov 3 months ago
parent
commit
5335c8de8e
3 changed files with 5 additions and 7 deletions
  1. +2
    -4
      osd_peering.cpp
  2. +1
    -0
      osd_peering_pg.cpp
  3. +2
    -3
      osd_peering_pg.h

+ 2
- 4
osd_peering.cpp View File

@@ -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++;


+ 1
- 0
osd_peering_pg.cpp View File

@@ -1,6 +1,7 @@
// Copyright (c) Vitaliy Filippov, 2019+
// License: VNPL-1.0 (see README.md for details)

#include <unordered_map>
#include "osd_peering_pg.h"

struct obj_ver_role


+ 2
- 3
osd_peering_pg.h View File

@@ -2,7 +2,6 @@
// License: VNPL-1.0 (see README.md for details)

#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>

@@ -45,8 +44,8 @@ struct osd_op_t;
struct pg_peering_state_t
{
// osd_num -> list result
std::unordered_map<osd_num_t, osd_op_t*> list_ops;
std::unordered_map<osd_num_t, pg_list_result_t> list_results;
std::map<osd_num_t, osd_op_t*> list_ops;
std::map<osd_num_t, pg_list_result_t> list_results;
pool_id_t pool_id = 0;
pg_num_t pg_num = 0;
};


Loading…
Cancel
Save