From: Sage Weil Date: Mon, 9 Dec 2019 15:29:22 +0000 (-0600) Subject: osd/OSDMap: calc_pg_rank -> calc_pg_role X-Git-Tag: v15.1.0~577^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0637c269552d9da09faa8c57b50fcae6df38731f;p=ceph.git osd/OSDMap: calc_pg_rank -> calc_pg_role These were identical. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 4e4bd663d1e1..45af7ad7c28b 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2639,7 +2639,7 @@ void OSDMap::_pg_to_up_acting_osds( *acting_primary = _acting_primary; } -int OSDMap::calc_pg_rank(int osd, const vector& acting, int nrep) +int OSDMap::calc_pg_role(int osd, const vector& acting, int nrep) { if (!nrep) nrep = acting.size(); @@ -2649,11 +2649,6 @@ int OSDMap::calc_pg_rank(int osd, const vector& acting, int nrep) return -1; } -int OSDMap::calc_pg_role(int osd, const vector& acting, int nrep) -{ - return calc_pg_rank(osd, acting, nrep); -} - bool OSDMap::primary_changed( int oldprimary, const vector &oldacting, @@ -2666,8 +2661,8 @@ bool OSDMap::primary_changed( 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) } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index ae5731b72db1..3020aba2559c 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -1394,8 +1394,6 @@ public: } - /* what replica # is a given osd? 0 primary, -1 for none. */ - static int calc_pg_rank(int osd, const std::vector& acting, int nrep=0); static int calc_pg_role(int osd, const std::vector& acting, int nrep=0); static bool primary_changed( int oldprimary, @@ -1407,7 +1405,7 @@ public: int get_pg_acting_rank(pg_t pg, int osd) const { std::vector 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 {