]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer: add advance(unsigned) back 11993/head
authorKefu Chai <kchai@redhat.com>
Tue, 15 Nov 2016 16:18:37 +0000 (00:18 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 15 Nov 2016 16:18:37 +0000 (00:18 +0800)
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 <kchai@redhat.com>
src/common/buffer.cc
src/include/buffer.h

index ff687e2891897f74b6911b849e82ad21b22c1315..2ff974edea87a554d1aa1995b7017fdbeb60959e 100644 (file)
@@ -1082,7 +1082,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     : iterator_impl<is_const>(i.bl, i.off, i.p, i.p_off) {}
 
   template<bool is_const>
-  void buffer::list::iterator_impl<is_const>::advance(ssize_t o)
+  void buffer::list::iterator_impl<is_const>::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<bool is_const>
-  void buffer::list::iterator_impl<is_const>::seek(size_t o)
+  void buffer::list::iterator_impl<is_const>::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<false>::advance(o);
   }
 
-  void buffer::list::iterator::seek(size_t o)
+  void buffer::list::iterator::seek(unsigned o)
   {
     buffer::list::iterator_impl<false>::seek(o);
   }
index 7306b9906dd9dddc7c7af4d4d59e182718b19993..a69d866fe8a883b41b5636f1c06c893078dcc66c 100644 (file)
@@ -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();