]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: new encoding for osd_stat_t
authorSage Weil <sage.weil@dreamhost.com>
Fri, 10 Feb 2012 05:53:45 +0000 (21:53 -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 1151a82f5f2bc4b5125ec8954648d43815ce4ccc..b79d865163bb97316af23da0d54e0428103d610c 100644 (file)
@@ -113,8 +113,7 @@ void osd_stat_t::dump(Formatter *f) const
 
 void osd_stat_t::encode(bufferlist &bl) const
 {
-  __u8 v = 1;
-  ::encode(v, bl);
+  ENCODE_START(2, 2, bl);
   ::encode(kb, bl);
   ::encode(kb_used, bl);
   ::encode(kb_avail, bl);
@@ -122,12 +121,12 @@ void osd_stat_t::encode(bufferlist &bl) const
   ::encode(num_snap_trimming, bl);
   ::encode(hb_in, bl);
   ::encode(hb_out, bl);
+  ENCODE_FINISH(bl);
 }
 
 void osd_stat_t::decode(bufferlist::iterator &bl)
 {
-  __u8 v;
-  ::decode(v, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
   ::decode(kb, bl);
   ::decode(kb_used, bl);
   ::decode(kb_avail, bl);
@@ -135,9 +134,9 @@ void osd_stat_t::decode(bufferlist::iterator &bl)
   ::decode(num_snap_trimming, bl);
   ::decode(hb_in, bl);
   ::decode(hb_out, bl);
+  DECODE_FINISH(bl);
 }
 
-
 void osd_stat_t::generate_test_instances(std::list<osd_stat_t*>& o)
 {
   o.push_back(new osd_stat_t);