*acting_primary = _acting_primary;
}
-int OSDMap::calc_pg_rank(int osd, const vector<int>& acting, int nrep)
+int OSDMap::calc_pg_role(int osd, const vector<int>& acting, int nrep)
{
if (!nrep)
nrep = acting.size();
return -1;
}
-int OSDMap::calc_pg_role(int osd, const vector<int>& acting, int nrep)
-{
- return calc_pg_rank(osd, acting, nrep);
-}
-
bool OSDMap::primary_changed(
int oldprimary,
const vector<int> &oldacting,
return true; // was empty, now not, or vice versa
if (oldprimary != newprimary)
return true; // primary changed
- if (calc_pg_rank(oldprimary, oldacting) !=
- calc_pg_rank(newprimary, newacting))
+ if (calc_pg_role(oldprimary, oldacting) !=
+ calc_pg_role(newprimary, newacting))
return true;
return false; // same primary (tho replicas may have changed)
}
}
- /* what replica # is a given osd? 0 primary, -1 for none. */
- static int calc_pg_rank(int osd, const std::vector<int>& acting, int nrep=0);
static int calc_pg_role(int osd, const std::vector<int>& acting, int nrep=0);
static bool primary_changed(
int oldprimary,
int get_pg_acting_rank(pg_t pg, int osd) const {
std::vector<int> group;
pg_to_acting_osds(pg, group);
- return calc_pg_rank(osd, group, group.size());
+ return calc_pg_role(osd, group, group.size());
}
/* role is -1 (stray), 0 (primary), 1 (replica) */
int get_pg_acting_role(const pg_t& pg, int osd) const {