From: Radoslaw Zarzynski Date: Fri, 8 Mar 2019 16:24:33 +0000 (+0100) Subject: msg/async, v2: drop the bl onwire space optimization in ControlFrames. X-Git-Tag: v14.2.0~23^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cced2bfd3775564a2b0c4919837eea2f5278dd03;p=ceph.git msg/async, v2: drop the bl onwire space optimization in ControlFrames. BEWARE: this changes the V2 onwire format without preserving backward compatibility! Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index b2b9d91047a..2fade004b30 100644 --- a/src/msg/async/frames_v2.h +++ b/src/msg/async/frames_v2.h @@ -305,9 +305,7 @@ protected: template inline void _encode_payload_each(T &t) { - if constexpr (std::is_same()) { - this->get_payload_segment().claim_append((bufferlist &)t); - } else if constexpr (std::is_same const>()) { + if constexpr (std::is_same const>()) { encode((uint32_t)t.size(), this->get_payload_segment(), features); for (const auto &elem : t) { encode(elem, this->get_payload_segment(), features); @@ -319,11 +317,7 @@ protected: template inline void _decode_payload_each(T &t, bufferlist::const_iterator &ti) const { - if constexpr (std::is_same()) { - if (ti.get_remaining()) { - t.append(ti.get_current_ptr()); - } - } else if constexpr (std::is_same>()) { + if constexpr (std::is_same>()) { uint32_t size; decode(size, ti); t.resize(size);