]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: calc_pg_rank -> calc_pg_role
authorSage Weil <sage@redhat.com>
Mon, 9 Dec 2019 15:29:22 +0000 (09:29 -0600)
committerSage Weil <sage@redhat.com>
Mon, 9 Dec 2019 15:50:12 +0000 (09:50 -0600)
These were identical.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc
src/osd/OSDMap.h

index 4e4bd663d1e16a282d3b3fd9b30036e5cbb8ee52..45af7ad7c28b3c8b2bd3db70410310a0fb5fd7c6 100644 (file)
@@ -2639,7 +2639,7 @@ void OSDMap::_pg_to_up_acting_osds(
     *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();
@@ -2649,11 +2649,6 @@ int OSDMap::calc_pg_rank(int osd, const vector<int>& acting, int nrep)
   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,
@@ -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)
 }
index ae5731b72db1972a071eb00a34edcfe5fe27b2f9..3020aba2559ca5328514308079feaeb72fdc2e95 100644 (file)
@@ -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<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,
@@ -1407,7 +1405,7 @@ public:
   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 {