From f8a8b4f0e41929bb4dde4217ae2bc1e8b02f7b2c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 1 Dec 2016 11:01:14 +0800 Subject: [PATCH] buffer: add copy(unsigned, ptr) back 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 --- src/common/buffer.cc | 11 +++++++++++ src/include/buffer.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index dce326dadce..cd1015c2d8d 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1175,6 +1175,12 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; } } + template + void buffer::list::iterator_impl::copy(unsigned len, ptr &dest) + { + copy_deep(len, dest); + } + template void buffer::list::iterator_impl::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::copy(len, dest); } + void buffer::list::iterator::copy(unsigned len, ptr &dest) + { + return buffer::list::iterator_impl::copy_deep(len, dest); + } + void buffer::list::iterator::copy_deep(unsigned len, ptr &dest) { buffer::list::iterator_impl::copy_deep(len, dest); diff --git a/src/include/buffer.h b/src/include/buffer.h index b28de838431..a016bab4c64 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -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); -- 2.39.5