From: Kefu Chai Date: Tue, 15 Nov 2016 16:18:37 +0000 (+0800) Subject: buffer: add advance(unsigned) back X-Git-Tag: v11.1.0~211^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=77b244fd8e0513be77e701f620c1edf9a9237cc5;p=ceph.git buffer: add advance(unsigned) back advance(unsigned) and seek(int) were replaced with advance(size_t> and seek(ssize_t) in 053bfa6. this change broke the backward compatibility of librados/librbd's ABI. - deprecates advance(unsigned) and seek(int) - update the callers to use the prefered versions. 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 ff687e289189..2ff974edea87 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1082,7 +1082,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; : iterator_impl(i.bl, i.off, i.p, i.p_off) {} template - void buffer::list::iterator_impl::advance(ssize_t o) + void buffer::list::iterator_impl::advance(int o) { //cout << this << " advance " << o << " from " << off << " (p_off " << p_off << " in " << p->length() << ")" << std::endl; if (o > 0) { @@ -1121,7 +1121,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; } template - void buffer::list::iterator_impl::seek(size_t o) + void buffer::list::iterator_impl::seek(unsigned o) { p = ls->begin(); off = p_off = 0; @@ -1313,12 +1313,12 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; : iterator_impl(l, o, ip, po) {} - void buffer::list::iterator::advance(ssize_t o) + void buffer::list::iterator::advance(int o) { buffer::list::iterator_impl::advance(o); } - void buffer::list::iterator::seek(size_t o) + void buffer::list::iterator::seek(unsigned o) { buffer::list::iterator_impl::seek(o); } diff --git a/src/include/buffer.h b/src/include/buffer.h index 7306b9906dd9..a69d866fe8a8 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -390,8 +390,8 @@ namespace buffer CEPH_BUFFER_API { //return off == bl->length(); } - void advance(ssize_t o); - void seek(size_t o); + void advance(int o); + void seek(unsigned o); char operator*() const; iterator_impl& operator++(); ptr get_current_ptr() const; @@ -434,8 +434,8 @@ namespace buffer CEPH_BUFFER_API { iterator(bl_t *l, unsigned o=0); iterator(bl_t *l, unsigned o, list_iter_t ip, unsigned po); - void advance(ssize_t o); - void seek(size_t o); + void advance(int o); + void seek(unsigned o); char operator*(); iterator& operator++(); ptr get_current_ptr();