]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: move buffer free functions to inline namespace 29244/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 20 May 2019 07:29:16 +0000 (09:29 +0200)
committerPrashant D <pdhange@redhat.com>
Wed, 24 Jul 2019 00:33:21 +0000 (20:33 -0400)
'buffer::raw' factory methods and similar methods are now
wrapped in the 'v14_2_0' inline namespace for export via the
public librados API.

Fixes: http://tracker.ceph.com/issues/39972
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 4ac8bc79e7fc128f10b38457c93b092b5c8060ad)

src/common/buffer_seastar.cc
src/include/buffer.h
src/include/buffer_raw.h

index 80af898b3dfbe518bf05ddc944e309834a6dd0e6..cd1e07df3d1203392d17e8adc34cb36cefa616c0 100644 (file)
@@ -31,10 +31,6 @@ class raw_seastar_foreign_ptr : public raw {
   }
 };
 
-raw* create_foreign(temporary_buffer&& buf) {
-  return new raw_seastar_foreign_ptr(std::move(buf));
-}
-
 class raw_seastar_local_ptr : public raw {
   temporary_buffer buf;
  public:
@@ -45,10 +41,18 @@ class raw_seastar_local_ptr : public raw {
   }
 };
 
+inline namespace v14_2_0 {
+
+raw* create_foreign(temporary_buffer&& buf) {
+  return new raw_seastar_foreign_ptr(std::move(buf));
+}
+
 raw* create(temporary_buffer&& buf) {
   return new raw_seastar_local_ptr(std::move(buf));
 }
 
+} // inline namespace v14_2_0
+
 // buffer::ptr conversions
 
 ptr::operator seastar::temporary_buffer<char>() &
index e5a581ca5b0b58fb52fb6829c3fdf455cb9245d4..b8c78210eae0e81057f0396f91c1678ae4716b8a 100644 (file)
@@ -104,6 +104,8 @@ struct unique_leakable_ptr : public std::unique_ptr<T, ceph::nop_delete<T>> {
 };
 
 namespace buffer CEPH_BUFFER_API {
+inline namespace v14_2_0 {
+
   /*
    * exceptions
    */
@@ -189,8 +191,6 @@ namespace buffer CEPH_BUFFER_API {
   raw* create_msg(unsigned len, char *buf, XioDispatchHook *m_hook);
 #endif
 
-inline namespace v14_2_0 {
-
   /*
    * a buffer pointer.  references (a subsequence of) a raw buffer.
    */
@@ -1308,7 +1308,7 @@ inline bool operator<=(bufferlist& l, bufferlist& r) {
 
 std::ostream& operator<<(std::ostream& out, const buffer::ptr& bp);
 
-std::ostream& operator<<(std::ostream& out, const raw &r);
+std::ostream& operator<<(std::ostream& out, const buffer::raw &r);
 
 std::ostream& operator<<(std::ostream& out, const buffer::list& bl);
 
index 73e6b465d214d3122e150b5d0e1ba185c02caade..7557795c83bc4bc5b04cba1323e258fee375f61d 100644 (file)
@@ -24,6 +24,8 @@
 #include "include/spinlock.h"
 
 namespace ceph::buffer {
+inline namespace v14_2_0 {
+
   class raw {
   public:
     // In the future we might want to have a slab allocator here with few
@@ -118,6 +120,8 @@ public:
       last_crc_offset.second = std::numeric_limits<size_t>::max();
     }
   };
+
+} // inline namespace v14_2_0
 } // namespace ceph::buffer
 
 #endif // CEPH_BUFFER_RAW_H