]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mdsmap: add flags
authorSage Weil <sage@newdream.net>
Thu, 27 Jan 2011 16:24:52 +0000 (08:24 -0800)
committerSage Weil <sage@newdream.net>
Thu, 27 Jan 2011 16:34:29 +0000 (08:34 -0800)
Convert unused client_epoch field to flags to avoid a protocol change. It
is always 0 on current clusters.  Lucky us!

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/MDSMap.cc
src/mds/MDSMap.h

index 957d77d07b5a65545a50f1471699e8229dc35655..73230a539835d6b46d4d0b58e68c2463eaad172f 100644 (file)
@@ -60,8 +60,8 @@ CompatSet mdsmap_compat_base(feature_compat_base,
 
 void MDSMap::print(ostream& out) 
 {
-  out << "epoch " << epoch << std::endl;
-  out << "\nclient_epoch " << client_epoch << std::endl;
+  out << "epoch " << epoch << "\n";
+  out << "flags " << hex << flags << dec << "\n";
   out << "created " << created << std::endl;
   out << "modified " << modified << std::endl;
   out << "tableserver " << tableserver << std::endl;
index b69baff89befe7b137998368802c57fd8eb260cc..bc1015f2712b2f584e534f01590f3f3ee7392657 100644 (file)
@@ -154,7 +154,7 @@ public:
 protected:
   // base map
   epoch_t epoch;
-  epoch_t client_epoch;  // incremented only when change is significant to client.
+  uint32_t flags;        // flags
   epoch_t last_failure;  // mds epoch of last failure
   epoch_t last_failure_osd_epoch; // osd epoch of last failure; any mds entering replay needs
                                   // at least this osdmap to ensure the blacklist propagates.
@@ -195,7 +195,7 @@ public:
   friend class MDSMonitor;
 
 public:
-  MDSMap() : epoch(0), client_epoch(0), last_failure(0), last_failure_osd_epoch(0), tableserver(0), root(0),
+  MDSMap() : epoch(0), flags(0), last_failure(0), last_failure_osd_epoch(0), tableserver(0), root(0),
             cas_pg_pool(0), metadata_pg_pool(0) {
     // hack.. this doesn't really belong here
     session_timeout = (int)g_conf.mds_session_timeout;
@@ -208,6 +208,11 @@ public:
   }
   uint64_t get_max_filesize() { return max_file_size; }
   
+  int get_flags() const { return flags; }
+  int test_flag(int f) const { return flags & f; }
+  void set_flag(int f) { flags |= f; }
+  void clear_flag(int f) { flags &= ~f; }
+
   epoch_t get_epoch() const { return epoch; }
   void inc_epoch() { epoch++; }
 
@@ -456,7 +461,7 @@ public:
     __u16 v = 2;
     ::encode(v, bl);
     ::encode(epoch, bl);
-    ::encode(client_epoch, bl);
+    ::encode(flags, bl);
     ::encode(last_failure, bl);
     ::encode(root, bl);
     ::encode(session_timeout, bl);
@@ -486,7 +491,7 @@ public:
     __u16 v;
     ::decode(v, p);
     ::decode(epoch, p);
-    ::decode(client_epoch, p);
+    ::decode(flags, p);
     ::decode(last_failure, p);
     ::decode(root, p);
     ::decode(session_timeout, p);