// an existing pg_primary field to imply a change
if (p->second.size() &&
(osdmap.pg_temp->count(p->first) == 0 ||
- !vectors_equal(osdmap.pg_temp->get(p->first), p->second) ||
+ osdmap.pg_temp->get(p->first) != p->second ||
osdmap.primary_temp->count(p->first)))
return false;
}
vector<int> raw_up;
int primary;
tmpmap.pg_to_raw_up(pg.first, &raw_up, &primary);
- if (vectors_equal(raw_up, pg.second)) {
+ if (raw_up == pg.second) {
ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first << " "
<< pg.second << " that matches raw_up mapping" << dendl;
if (osdmap.pg_temp->count(pg.first))
vector<int> raw;
int primary;
pg_to_raw_osds(p.first, &raw, &primary);
- if (vectors_equal(raw, p.second)) {
+ if (raw == p.second) {
ldout(cct, 10) << " removing redundant pg_upmap " << p.first << " "
<< p.second << dendl;
pending_inc->old_pg_upmap.insert(p.first);
class CrushWrapper;
class health_check_map_t;
-// FIXME C++11 does not have std::equal for two differently-typed containers.
-// use this until we move to c++14
-template<typename A, typename B>
-bool vectors_equal(A a, B b)
-{
- return
- a.size() == b.size() &&
- (a.empty() ||
- memcmp((char*)&a[0], (char*)&b[0], sizeof(a[0]) * a.size()) == 0);
-}
-
-
/*
* we track up to two intervals during which the osd was alive and
* healthy. the most recent is [up_from,up_thru), where up_thru is