From 0637c269552d9da09faa8c57b50fcae6df38731f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 9 Dec 2019 09:29:22 -0600 Subject: [PATCH] osd/OSDMap: calc_pg_rank -> calc_pg_role These were identical. Signed-off-by: Sage Weil --- src/osd/OSDMap.cc | 11 +++-------- src/osd/OSDMap.h | 4 +--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 4e4bd663d1e..45af7ad7c28 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 ae5731b72db..3020aba2559 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 { -- 2.39.5