From: Jason Dillaman Date: Mon, 20 May 2019 07:29:16 +0000 (+0200) Subject: librados: move buffer free functions to inline namespace X-Git-Tag: v14.2.3~102^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29244%2Fhead;p=ceph.git librados: move buffer free functions to inline namespace '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 (cherry picked from commit 4ac8bc79e7fc128f10b38457c93b092b5c8060ad) --- diff --git a/src/common/buffer_seastar.cc b/src/common/buffer_seastar.cc index 80af898b3dfb..cd1e07df3d12 100644 --- a/src/common/buffer_seastar.cc +++ b/src/common/buffer_seastar.cc @@ -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() & diff --git a/src/include/buffer.h b/src/include/buffer.h index e5a581ca5b0b..b8c78210eae0 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -104,6 +104,8 @@ struct unique_leakable_ptr : public std::unique_ptr> { }; 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); diff --git a/src/include/buffer_raw.h b/src/include/buffer_raw.h index 73e6b465d214..7557795c83bc 100644 --- a/src/include/buffer_raw.h +++ b/src/include/buffer_raw.h @@ -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::max(); } }; + +} // inline namespace v14_2_0 } // namespace ceph::buffer #endif // CEPH_BUFFER_RAW_H