]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os: new encoding for hobject_t
authorSage Weil <sage.weil@dreamhost.com>
Fri, 10 Feb 2012 05:56:18 +0000 (21:56 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 10 Feb 2012 06:06:38 +0000 (22:06 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/os/hobject.cc

index 113cf76b92f70a10b666ccaa9c7085dd5cc47d17..dabdb0ce6a047e9e07dcc1e0018e0e763c642bf0 100644 (file)
@@ -5,28 +5,28 @@
 
 void hobject_t::encode(bufferlist& bl) const
 {
-  __u8 version = 2;
-  ::encode(version, bl);
+  ENCODE_START(3, 3, bl);
   ::encode(key, bl);
   ::encode(oid, bl);
   ::encode(snap, bl);
   ::encode(hash, bl);
   ::encode(max, bl);
+  ENCODE_FINISH(bl);
 }
 
 void hobject_t::decode(bufferlist::iterator& bl)
 {
-  __u8 version;
-  ::decode(version, bl);
-  if (version >= 1)
+  DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
+  if (struct_v >= 1)
     ::decode(key, bl);
   ::decode(oid, bl);
   ::decode(snap, bl);
   ::decode(hash, bl);
-  if (version >= 2)
+  if (struct_v >= 2)
     ::decode(max, bl);
   else
     max = false;
+  DECODE_FINISH(bl);
 }
 
 void hobject_t::dump(Formatter *f) const