]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async, v2: drop the bl onwire space optimization in ControlFrames.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 8 Mar 2019 16:24:33 +0000 (17:24 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Sun, 10 Mar 2019 00:12:01 +0000 (01:12 +0100)
BEWARE: this changes the V2 onwire format without preserving backward
compatibility!

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/msg/async/frames_v2.h

index b2b9d91047ae94be5d1a3a8cda33284214f24dce..2fade004b306d1658f9e0e2e1a25fdc8206f976c 100644 (file)
@@ -305,9 +305,7 @@ protected:
 
   template <typename T>
   inline void _encode_payload_each(T &t) {
-    if constexpr (std::is_same<T, bufferlist const>()) {
-      this->get_payload_segment().claim_append((bufferlist &)t);
-    } else if constexpr (std::is_same<T, std::vector<uint32_t> const>()) {
+    if constexpr (std::is_same<T, std::vector<uint32_t> 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 <typename T>
   inline void _decode_payload_each(T &t, bufferlist::const_iterator &ti) const {
-    if constexpr (std::is_same<T, bufferlist>()) {
-      if (ti.get_remaining()) {
-        t.append(ti.get_current_ptr());
-      }
-    } else if constexpr (std::is_same<T, std::vector<uint32_t>>()) {
+    if constexpr (std::is_same<T, std::vector<uint32_t>>()) {
       uint32_t size;
       decode(size, ti);
       t.resize(size);