From bdae5bf37ce0ecad157265e6b3c4a76f7e0e8403 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 30 Dec 2015 15:04:08 -0500 Subject: [PATCH] include/compact_map: featureful encoders, too Signed-off-by: Sage Weil --- src/include/compact_map.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/include/compact_map.h b/src/include/compact_map.h index a530c27130d8f..12ba8b3504a30 100644 --- a/src/include/compact_map.h +++ b/src/include/compact_map.h @@ -284,6 +284,12 @@ public: else ::encode((uint32_t)0, bl); } + void encode(bufferlist &bl, uint64_t features) const { + if (map) + ::encode(*map, bl, features); + else + ::encode((uint32_t)0, bl); + } void decode(bufferlist::iterator& p) { uint32_t n; ::decode(n, p); @@ -300,6 +306,11 @@ inline void encode(const compact_map_base& m, bufferlist& bl) { m.encode(bl); } template +inline void encode(const compact_map_base& m, bufferlist& bl, + uint64_t features) { + m.encode(bl, features); +} +template inline void decode(compact_map_base& m, bufferlist::iterator& p) { m.decode(p); } -- 2.39.5