]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer: add copy(unsigned, ptr) back 12246/head
authorKefu Chai <kchai@redhat.com>
Thu, 1 Dec 2016 03:01:14 +0000 (11:01 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 1 Dec 2016 03:05:26 +0000 (11:05 +0800)
to be ABI-compatible with prior versions.

copy(unsigned, ptr) was renamed to copy_deep() in 6d7f748

Fixes: http://tracker.ceph.com/issues/17809
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/buffer.cc
src/include/buffer.h

index dce326dadce608571faf30aad624018c5b3334ea..cd1015c2d8d813eef9bcd250eee0898ddb6054ad 100644 (file)
@@ -1175,6 +1175,12 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     }
   }
 
+  template<bool is_const>
+  void buffer::list::iterator_impl<is_const>::copy(unsigned len, ptr &dest)
+  {
+    copy_deep(len, dest);
+  }
+
   template<bool is_const>
   void buffer::list::iterator_impl<is_const>::copy_deep(unsigned len, ptr &dest)
   {
@@ -1350,6 +1356,11 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     return buffer::list::iterator_impl<false>::copy(len, dest);
   }
 
+  void buffer::list::iterator::copy(unsigned len, ptr &dest)
+  {
+    return buffer::list::iterator_impl<false>::copy_deep(len, dest);
+  }
+
   void buffer::list::iterator::copy_deep(unsigned len, ptr &dest)
   {
     buffer::list::iterator_impl<false>::copy_deep(len, dest);
index b28de8384319352ebfdfa77aafc36b7588453cee..a016bab4c642c452dba306411f8c76af32123d6c 100644 (file)
@@ -401,6 +401,8 @@ namespace buffer CEPH_BUFFER_API {
       // copy data out.
       // note that these all _append_ to dest!
       void copy(unsigned len, char *dest);
+      // deprecated, use copy_deep()
+      void copy(unsigned len, ptr &dest) __attribute__((deprecated));
       void copy_deep(unsigned len, ptr &dest);
       void copy_shallow(unsigned len, ptr &dest);
       void copy(unsigned len, list &dest);
@@ -442,6 +444,8 @@ namespace buffer CEPH_BUFFER_API {
 
       // copy data out
       void copy(unsigned len, char *dest);
+      // deprecated, use copy_deep()
+      void copy(unsigned len, ptr &dest) __attribute__((deprecated));
       void copy_deep(unsigned len, ptr &dest);
       void copy_shallow(unsigned len, ptr &dest);
       void copy(unsigned len, list &dest);