]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: new encoding for watch_info_t
authorSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 20:43:38 +0000 (12:43 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 10 Feb 2012 05:58:08 +0000 (21:58 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/osd_types.cc

index 8f56750251c6083586f996300971f751b47e003f..3f84348c0e6c14cf35f6e87e31d92c395ac92a24 100644 (file)
@@ -1756,22 +1756,22 @@ ostream& operator<<(ostream& out, const SnapSet& cs)
 
 void watch_info_t::encode(bufferlist& bl) const
 {
-  const __u8 v = 2;
-  ::encode(v, bl);
+  ENCODE_START(3, 3, bl);
   ::encode(cookie, bl);
   ::encode(timeout_seconds, bl);
+  ENCODE_FINISH(bl);
 }
 
 void watch_info_t::decode(bufferlist::iterator& bl)
 {
-  __u8 v;
-  ::decode(v, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
   ::decode(cookie, bl);
-  if (v < 2) {
+  if (struct_v < 2) {
     uint64_t ver;
     ::decode(ver, bl);
   }
   ::decode(timeout_seconds, bl);
+  DECODE_FINISH(bl);
 }
 
 void watch_info_t::dump(Formatter *f) const