]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
features: explicitly use CEPH_FEATURES_ALL instead of -1
authorSage Weil <sage@inktank.com>
Wed, 16 May 2012 23:04:19 +0000 (16:04 -0700)
committerSage Weil <sage@inktank.com>
Wed, 16 May 2012 23:04:19 +0000 (16:04 -0700)
Make it clear to readers what that -1 is all about.  Alex would be proud.

Signed-off-by: Sage Weil <sage@inktank.com>
src/ceph_mon.cc
src/include/ceph_features.h
src/messages/MMonElection.h
src/mon/MonMap.cc
src/mon/Monitor.cc
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/osd/OSDMap.h

index e24046c4045cfff266b1378b3d178d5bfde65fa2..00cb94383e45d6888a41ff92cf4300cdb86c0304 100644 (file)
@@ -278,7 +278,7 @@ int main(int argc, const char **argv)
       tmp.set_epoch(v);
     }
     bufferlist mapbl;
-    tmp.encode(mapbl, -1);
+    tmp.encode(mapbl, CEPH_FEATURES_ALL);
     bufferlist final;
     ::encode(v, final);
     ::encode(mapbl, final);
index 8791f475480c8ec467d7ce13f0e710dc5670ed1e..93c1410564b886897c4fba63bf4d5fee19785359 100644 (file)
@@ -24,7 +24,7 @@
 /*
  * Features supported.  Should be everything above.
  */
-#define CEPH_FEATURES_SUPPORTED_DEFAULT  \
+#define CEPH_FEATURES_ALL               \
        (CEPH_FEATURE_UID |              \
         CEPH_FEATURE_NOSRCADDR |        \
         CEPH_FEATURE_MONCLOCKCHECK |    \
@@ -42,4 +42,6 @@
         CEPH_FEATURE_OMAP |             \
         CEPH_FEATURE_MONENC)
 
+#define CEPH_FEATURES_SUPPORTED_DEFAULT  CEPH_FEATURES_ALL
+
 #endif
index 5adf6ff432b57f92ec9222ce78662e9ce6cb55dd..b35cbd566b59ffeada45a0b6504ab633107bb386 100644 (file)
@@ -48,7 +48,7 @@ public:
   MMonElection(int o, epoch_t e, MonMap *m) : 
     Message(MSG_MON_ELECTION, HEAD_VERSION), 
     fsid(m->fsid), op(o), epoch(e) {
-    m->encode(monmap_bl, -1);
+    m->encode(monmap_bl, CEPH_FEATURES_ALL);
   }
 private:
   ~MMonElection() {}
index c51aa69e9c4a1ab23f73313afa483de46a740e74..33c04213707b48321d73166b93cee47b0b0a1516 100644 (file)
@@ -85,7 +85,7 @@ int MonMap::write(const char *fn)
 {
   // encode
   bufferlist bl;
-  encode(bl, -1);
+  encode(bl, CEPH_FEATURES_ALL);
   
   return bl.write_file(fn);
 }
index 06b686396e4454c3adde33b6262712514fdb1f86..57294f4da9cc7d60f0c0527bd7c725062c217ab5 100644 (file)
@@ -1141,7 +1141,7 @@ void Monitor::forward_request_leader(PaxosServiceMessage *req)
     RoutedRequest *rr = new RoutedRequest;
     rr->tid = ++routed_request_tid;
     rr->client = req->get_source_inst();
-    encode_message(req, -1, rr->request_bl);   // for my use only; use all features
+    encode_message(req, CEPH_FEATURES_ALL, rr->request_bl);   // for my use only; use all features
     rr->session = (MonSession *)session->get();
     routed_requests[rr->tid] = rr;
     session->routed_request_tids.insert(rr->tid);
@@ -1207,7 +1207,7 @@ void Monitor::try_send_message(Message *m, entity_inst_t to)
   dout(10) << "try_send_message " << *m << " to " << to << dendl;
 
   bufferlist bl;
-  encode_message(m, -1, bl);  // fixme: assume peers have all features we do.
+  encode_message(m, CEPH_FEATURES_ALL, bl);  // fixme: assume peers have all features we do.
 
   messenger->send_message(m, to);
 
@@ -1825,7 +1825,7 @@ int Monitor::mkfs(bufferlist& osdmapbl)
 
   // save monmap, osdmap, keyring.
   bufferlist monmapbl;
-  monmap->encode(monmapbl, -1);
+  monmap->encode(monmapbl, CEPH_FEATURES_ALL);
   monmap->set_epoch(0);     // must be 0 to avoid confusing first MonmapMonitor::update_from_paxos()
   store->put_bl_ss(monmapbl, "mkfs", "monmap");
 
index f9e029ffcaa97d722d93bcfb29b7213cb92d5742..25b09cf856623cf9eb68e0144e523c93268e0088 100644 (file)
@@ -102,7 +102,7 @@ void MonmapMonitor::encode_pending(bufferlist& bl)
 
   assert(mon->monmap->epoch + 1 == pending_map.epoch ||
         pending_map.epoch == 1);  // special case mkfs!
-  pending_map.encode(bl, -1);
+  pending_map.encode(bl, CEPH_FEATURES_ALL);
 }
 
 bool MonmapMonitor::preprocess_query(PaxosServiceMessage *m)
@@ -137,7 +137,7 @@ bool MonmapMonitor::preprocess_command(MMonCommand *m)
       r = 0;
     }
     else if (m->cmd.size() == 2 && m->cmd[1] == "getmap") {
-      mon->monmap->encode(rdata, -1);
+      mon->monmap->encode(rdata, CEPH_FEATURES_ALL);
       r = 0;
       ss << "got latest monmap";
     }
index ce33343f225411e7aa75468dc0c5ccdc2fdf70cc..facbcd17608c4082f2775495afe06c9eeeb65f74 100644 (file)
@@ -389,7 +389,7 @@ void OSDMonitor::encode_pending(bufferlist &bl)
 
   // encode
   assert(paxos->get_version() + 1 == pending_inc.epoch);
-  ::encode(pending_inc, bl, -1);
+  ::encode(pending_inc, bl, CEPH_FEATURES_ALL);
 }
 
 
index 18dbf457976f6489a86779beaac01eb906a945dc..29bca37e57e55021626a316c555cc731d2e6e338 100644 (file)
@@ -28,6 +28,8 @@
 #include "common/Mutex.h"
 #include "common/Clock.h"
 
+#include "include/ceph_features.h"
+
 #include "crush/CrushWrapper.h"
 
 #include "include/interval_set.h"
@@ -128,7 +130,7 @@ public:
     int identify_osd(uuid_d u) const;
 
     void encode_client_old(bufferlist& bl) const;
-    void encode(bufferlist& bl, uint64_t features=-1) const;
+    void encode(bufferlist& bl, uint64_t features=CEPH_FEATURES_ALL) const;
     void decode(bufferlist::iterator &p);
     void dump(Formatter *f) const;
     static void generate_test_instances(list<Incremental*>& o);
@@ -371,7 +373,7 @@ private:
 private:
   void encode_client_old(bufferlist& bl) const;
 public:
-  void encode(bufferlist& bl, uint64_t features=-1) const;
+  void encode(bufferlist& bl, uint64_t features=CEPH_FEATURES_ALL) const;
   void decode(bufferlist& bl);
   void decode(bufferlist::iterator& p);