]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdmap: drop obsolete PG_ROLE_* constants
authorSage Weil <sage@newdream.net>
Wed, 25 Apr 2012 23:22:14 +0000 (16:22 -0700)
committerSage Weil <sage@newdream.net>
Fri, 27 Apr 2012 01:49:19 +0000 (18:49 -0700)
There are cruft from the old primary/chain/splay replication code.  All
current code says <0 is stray, 0 is primary, and >0 is replica.  That is,
the role is the acting vector position, or -1 if not in the vector.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/osd/PG.h

index a89fd0ade2bde96ff5ad4bb529c0194ce0265af1..767fd868c59573f7f4dde00613861669e5706294 100644 (file)
@@ -879,16 +879,7 @@ int OSDMap::calc_pg_role(int osd, vector<int>& acting, int nrep)
 {
   if (!nrep)
     nrep = acting.size();
-  int rank = calc_pg_rank(osd, acting, nrep);
-    
-  if (rank < 0)
-    return PG_ROLE_STRAY;
-  else if (rank == 0) 
-    return PG_ROLE_HEAD;
-  else if (rank == 1) 
-    return PG_ROLE_ACKER;
-  else
-    return PG_ROLE_MIDDLE;
+  return calc_pg_rank(osd, acting, nrep);
 }
 
 
index 9580ea8f5272bc1604280ecf1524390b8adc22cf..66cc543f533957f2a13b349c14e98cae81a35056 100644 (file)
@@ -42,21 +42,6 @@ using namespace std;
 #include <ext/hash_set>
 using __gnu_cxx::hash_set;
 
-
-
-/*
- * some system constants
- */
-
-// pg roles
-#define PG_ROLE_STRAY   -1
-#define PG_ROLE_HEAD     0
-#define PG_ROLE_ACKER    1
-#define PG_ROLE_MIDDLE   2  // der.. misnomer
-//#define PG_ROLE_TAIL     2
-
-
-
 /*
  * 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
index 70466db5a4a60a279d265db6cd1b7343c6a81d7b..e8a31bbf982e6d275e1cbd47fae5a3a5f9a6807c 100644 (file)
@@ -1315,7 +1315,7 @@ public:
   int        get_role() const { return role; }
   void       set_role(int r) { role = r; }
 
-  bool       is_primary() const { return role == PG_ROLE_HEAD; }
+  bool       is_primary() const { return role == 0; }
   bool       is_replica() const { return role > 0; }
 
   epoch_t get_last_peering_reset() const { return last_peering_reset; }