From: Kefu Chai Date: Thu, 1 Dec 2016 03:01:14 +0000 (+0800) Subject: buffer: add copy(unsigned, ptr) back X-Git-Tag: v11.1.0~99^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f8a8b4f0e41929bb4dde4217ae2bc1e8b02f7b2c;p=ceph-ci.git 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 --- 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);