From f9d67f1ae932ae0970e904eb684cff8aa4f332ac Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 9 Feb 2012 21:53:45 -0800 Subject: [PATCH] osd: new encoding for osd_stat_t Signed-off-by: Sage Weil --- src/osd/osd_types.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 1151a82f5f2bc..b79d865163bb9 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -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& o) { o.push_back(new osd_stat_t); -- 2.39.5