]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include: Update denc.h to work without using namespace
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 29 Mar 2019 01:04:25 +0000 (21:04 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 29 Mar 2019 14:30:37 +0000 (10:30 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/include/denc.h

index cc2b906bf02e7166408985edd7333a3de5d80f13..c9a86cfb0d9d1031b8abb95d691f77d2660d8c29 100644 (file)
@@ -117,16 +117,16 @@ inline constexpr bool denc_supported = denc_traits<T>::supported;
   ======================================
 
     inline void denc(const T& o, size_t& p, uint64_t features=0);
-    inline void denc(const T& o, buffer::list::contiguous_appender& p,
+    inline void denc(const T& o, ceph::buffer::list::contiguous_appender& p,
                      uint64_t features=0);
-    inline void denc(T& o, buffer::ptr::const_iterator& p, uint64_t features=0);
+    inline void denc(T& o, ceph::buffer::ptr::const_iterator& p, uint64_t features=0);
 
   or (for featured objects)
 
     inline void denc(const T& o, size_t& p, uint64_t features);
-    inline void denc(const T& o, buffer::list::contiguous_appender& p,
+    inline void denc(const T& o, ceph::buffer::list::contiguous_appender& p,
                      uint64_t features);
-    inline void denc(T& o, buffer::ptr::const_iterator& p, uint64_t features);
+    inline void denc(T& o, ceph::buffer::ptr::const_iterator& p, uint64_t features);
 
   - These are symmetrical, so that they can be used from the magic DENC
   method of writing the bound_encode/encode/decode methods all in one go;
@@ -147,9 +147,9 @@ inline constexpr bool denc_supported = denc_traits<T>::supported;
       static constexpr bool featured = false;
       static constexpr bool need_contiguous = true;
       static void bound_encode(const T &o, size_t& p, uint64_t f=0);
-      static void encode(const T &o, buffer::list::contiguous_appender& p,
+      static void encode(const T &o, ceph::buffer::list::contiguous_appender& p,
                         uint64_t f=0);
-      static void decode(T& o, buffer::ptr::const_iterator &p, uint64_t f=0);
+      static void decode(T& o, ceph::buffer::ptr::const_iterator &p, uint64_t f=0);
     };
 
   or (for featured objects)
@@ -161,9 +161,9 @@ inline constexpr bool denc_supported = denc_traits<T>::supported;
       static constexpr bool featured = true;
       static constexpr bool need_contiguous = true;
       static void bound_encode(const T &o, size_t& p, uint64_t f);
-      static void encode(const T &o, buffer::list::contiguous_appender& p,
+      static void encode(const T &o, ceph::buffer::list::contiguous_appender& p,
                         uint64_t f);
-      static void decode(T& o, buffer::ptr::const_iterator &p, uint64_t f=0);
+      static void decode(T& o, ceph::buffer::ptr::const_iterator &p, uint64_t f=0);
     };
 
   - denc_traits<T> is normally declared via the WRITE_CLASS_DENC(type) macro,
@@ -175,8 +175,8 @@ inline constexpr bool denc_supported = denc_traits<T>::supported;
   how it should be encoded.  This is the "source of truth" for how a type
   is encoded.
 
-  - denc_traits<T> are declared for the base integer types, string, bufferptr,
-  and bufferlist base types.
+  - denc_traits<T> are declared for the base integer types, string, ceph::buffer::ptr,
+  and ceph::buffer::list base types.
 
   - denc_traits<std::foo<T>>-like traits are declared for standard container
   types.
@@ -186,24 +186,24 @@ inline constexpr bool denc_supported = denc_traits<T>::supported;
   ==========================
 
     void bound_encode(size_t& p) const;
-    void encode(buffer::list::contiguous_appender& p) const;
-    void decode(buffer::ptr::const_iterator &p);
+    void encode(ceph::buffer::list::contiguous_appender& p) const;
+    void decode(ceph::buffer::ptr::const_iterator &p);
 
   or (for featured objects)
 
     void bound_encode(size_t& p, uint64_t f) const;
-    void encode(buffer::list::contiguous_appender& p, uint64_t f) const;
-    void decode(buffer::ptr::const_iterator &p);
+    void encode(ceph::buffer::list::contiguous_appender& p, uint64_t f) const;
+    void decode(ceph::buffer::ptr::const_iterator &p);
 
   - These are normally invoked by the denc_traits<> methods that are
   declared via WRITE_CLASS_DENC, although you can also invoke them explicitly
   in your code.
 
   - These methods are optimised for contiguous buffer, but denc() will try
-    rebuild a contigous one if the decoded bufferlist is segmented. If you are
+    rebuild a contigous one if the decoded ceph::buffer::list is segmented. If you are
     concerned about the cost, you might want to define yet another method:
 
-    void decode(buffer::list::iterator &p);
+    void decode(ceph::buffer::list::iterator &p);
 
   - These can be defined either explicitly (as above), or can be "magically"
   defined all in one go using the DENC macro and DENC_{START,FINISH} helpers
@@ -250,7 +250,7 @@ struct is_const_iterator
 template<>
 struct is_const_iterator<size_t> : std::false_type {};
 template<>
-struct is_const_iterator<buffer::list::contiguous_appender> : std::false_type {
+struct is_const_iterator<ceph::buffer::list::contiguous_appender> : std::false_type {
   // appender is used for *changing* the buffer
 };
 template<class It>
@@ -295,7 +295,7 @@ struct denc_traits<
   decode(T& o, It& p, uint64_t f=0) {
     o = get_pos_add<T>(p);
   }
-  static void decode(T& o, buffer::list::const_iterator &p) {
+  static void decode(T& o, ceph::buffer::list::const_iterator &p) {
     p.copy(sizeof(T), reinterpret_cast<char*>(&o));
   }
 };
@@ -365,7 +365,7 @@ struct denc_traits<T, std::enable_if_t<!std::is_void_v<_denc::ExtType_t<T>>>>
   decode(T& o, It &p, uint64_t f=0) {
     o = get_pos_add<etype>(p);
   }
-  static void decode(T& o, buffer::list::const_iterator &p) {
+  static void decode(T& o, ceph::buffer::list::const_iterator &p) {
     etype e;
     p.copy(sizeof(etype), reinterpret_cast<char*>(&e));
     o = e;
@@ -381,7 +381,7 @@ inline void denc_varint(T v, size_t& p) {
 }
 
 template<typename T>
-inline void denc_varint(T v, bufferlist::contiguous_appender& p) {
+inline void denc_varint(T v, ceph::buffer::list::contiguous_appender& p) {
   uint8_t byte = v & 0x7f;
   v >>= 7;
   while (v) {
@@ -394,7 +394,7 @@ inline void denc_varint(T v, bufferlist::contiguous_appender& p) {
 }
 
 template<typename T>
-inline void denc_varint(T& v, bufferptr::const_iterator& p) {
+inline void denc_varint(T& v, ceph::buffer::ptr::const_iterator& p) {
   uint8_t byte = *(__u8*)p.get_pos_add(1);
   v = byte & 0x7f;
   int shift = 7;
@@ -445,7 +445,8 @@ denc_signed_varint(T& v, It& p)
 inline void denc_varint_lowz(uint64_t v, size_t& p) {
   p += sizeof(v) + 2;
 }
-inline void denc_varint_lowz(uint64_t v, bufferlist::contiguous_appender& p) {
+inline void denc_varint_lowz(uint64_t v,
+                            ceph::buffer::list::contiguous_appender& p) {
   int lowznib = v ? (ctz(v) / 4) : 0;
   if (lowznib > 3)
     lowznib = 3;
@@ -456,7 +457,7 @@ inline void denc_varint_lowz(uint64_t v, bufferlist::contiguous_appender& p) {
 }
 
 template<typename T>
-inline void denc_varint_lowz(T& v, bufferptr::const_iterator& p)
+inline void denc_varint_lowz(T& v, ceph::buffer::ptr::const_iterator& p)
 {
   uint64_t i = 0;
   denc_varint(i, p);
@@ -647,9 +648,9 @@ struct has_legacy_denc : std::false_type {};
 template<typename T>
 struct has_legacy_denc<T, decltype(std::declval<T&>()
                                   .decode(std::declval<
-                                          bufferlist::const_iterator&>()))>
+                                          ceph::buffer::list::const_iterator&>()))>
   : std::true_type {
-  static void decode(T& v, bufferlist::const_iterator& p) {
+  static void decode(T& v, ceph::buffer::list::const_iterator& p) {
     v.decode(p);
   }
 };
@@ -657,7 +658,7 @@ template<typename T>
 struct has_legacy_denc<T,
                       std::enable_if_t<
                         !denc_traits<T>::need_contiguous>> : std::true_type {
-  static void decode(T& v, bufferlist::const_iterator& p) {
+  static void decode(T& v, ceph::buffer::list::const_iterator& p) {
     denc_traits<T>::decode(v, p);
   }
 };
@@ -669,7 +670,7 @@ template<typename T,
 inline std::enable_if_t<traits::supported &&
                        has_legacy_denc::value> denc(
   T& o,
-  buffer::list::const_iterator& p)
+  ceph::buffer::list::const_iterator& p)
 {
   has_legacy_denc::decode(o, p);
 }
@@ -709,7 +710,7 @@ public:
     denc(len, p);
     decode_nohead(len, s, p);
   }
-  static void decode(value_type& s, buffer::list::const_iterator& p)
+  static void decode(value_type& s, ceph::buffer::list::const_iterator& p)
   {
     uint32_t len;
     denc(len, p);
@@ -723,7 +724,7 @@ public:
     }
   }
   static void decode_nohead(size_t len, value_type& s,
-                            buffer::list::const_iterator& p) {
+                            ceph::buffer::list::const_iterator& p) {
     if (len) {
       if constexpr (std::is_same_v<value_type, std::string>) {
         s.clear();
@@ -745,86 +746,86 @@ public:
 };
 
 //
-// bufferptr
+// ceph::buffer::ptr
 //
 template<>
-struct denc_traits<bufferptr> {
+struct denc_traits<ceph::buffer::ptr> {
   static constexpr bool supported = true;
   static constexpr bool featured = false;
   static constexpr bool bounded = false;
   static constexpr bool need_contiguous = false;
-  static void bound_encode(const bufferptr& v, size_t& p, uint64_t f=0) {
+  static void bound_encode(const ceph::buffer::ptr& v, size_t& p, uint64_t f=0) {
     p += sizeof(uint32_t) + v.length();
   }
   template <class It>
   static std::enable_if_t<!is_const_iterator_v<It>>
-  encode(const bufferptr& v, It& p, uint64_t f=0) {
+  encode(const ceph::buffer::ptr& v, It& p, uint64_t f=0) {
     denc((uint32_t)v.length(), p);
     p.append(v);
   }
   template <class It>
   static std::enable_if_t<is_const_iterator_v<It>>
-  decode(bufferptr& v, It& p, uint64_t f=0) {
+  decode(ceph::buffer::ptr& v, It& p, uint64_t f=0) {
     uint32_t len;
     denc(len, p);
     v = p.get_ptr(len);
   }
-  static void decode(bufferptr& v, buffer::list::const_iterator& p) {
+  static void decode(ceph::buffer::ptr& v, ceph::buffer::list::const_iterator& p) {
     uint32_t len;
     denc(len, p);
-    bufferlist s;
+    ceph::buffer::list s;
     p.copy(len, s);
     if (len) {
       if (s.get_num_buffers() == 1)
        v = s.front();
       else
-       v = buffer::copy(s.c_str(), s.length());
+       v = ceph::buffer::copy(s.c_str(), s.length());
     }
   }
 };
 
 //
-// bufferlist
+// ceph::buffer::list
 //
 template<>
-struct denc_traits<bufferlist> {
+struct denc_traits<ceph::buffer::list> {
   static constexpr bool supported = true;
   static constexpr bool featured = false;
   static constexpr bool bounded = false;
   static constexpr bool need_contiguous = false;
-  static void bound_encode(const bufferlist& v, size_t& p, uint64_t f=0) {
+  static void bound_encode(const ceph::buffer::list& v, size_t& p, uint64_t f=0) {
     p += sizeof(uint32_t) + v.length();
   }
-  static void encode(const bufferlist& v, buffer::list::contiguous_appender& p,
+  static void encode(const ceph::buffer::list& v, ceph::buffer::list::contiguous_appender& p,
              uint64_t f=0) {
     denc((uint32_t)v.length(), p);
     p.append(v);
   }
-  static void decode(bufferlist& v, buffer::ptr::const_iterator& p, uint64_t f=0) {
+  static void decode(ceph::buffer::list& v, ceph::buffer::ptr::const_iterator& p, uint64_t f=0) {
     uint32_t len;
     denc(len, p);
     v.clear();
     v.push_back(p.get_ptr(len));
   }
-  static void decode(bufferlist& v, buffer::list::const_iterator& p) {
+  static void decode(ceph::buffer::list& v, ceph::buffer::list::const_iterator& p) {
     uint32_t len;
     denc(len, p);
     v.clear();
     p.copy(len, v);
   }
-  static void encode_nohead(const bufferlist& v,
-                           buffer::list::contiguous_appender& p) {
+  static void encode_nohead(const ceph::buffer::list& v,
+                           ceph::buffer::list::contiguous_appender& p) {
     p.append(v);
   }
-  static void decode_nohead(size_t len, bufferlist& v,
-                           buffer::ptr::const_iterator& p) {
+  static void decode_nohead(size_t len, ceph::buffer::list& v,
+                           ceph::buffer::ptr::const_iterator& p) {
     v.clear();
     if (len) {
       v.append(p.get_ptr(len));
     }
   }
-  static void decode_nohead(size_t len, bufferlist& v,
-                           buffer::list::const_iterator& p) {
+  static void decode_nohead(size_t len, ceph::buffer::list& v,
+                           ceph::buffer::list::const_iterator& p) {
     v.clear();
     p.copy(len, v);
   }
@@ -856,7 +857,7 @@ struct denc_traits<
     }
   }
 
-  static void encode(const std::pair<A,B>& v, bufferlist::contiguous_appender& p,
+  static void encode(const std::pair<A,B>& v, ceph::buffer::list::contiguous_appender& p,
                     uint64_t f = 0) {
     if constexpr (featured) {
       denc(v.first, p, f);
@@ -867,14 +868,14 @@ struct denc_traits<
     }
   }
 
-  static void decode(std::pair<A,B>& v, buffer::ptr::const_iterator& p, uint64_t f=0) {
+  static void decode(std::pair<A,B>& v, ceph::buffer::ptr::const_iterator& p, uint64_t f=0) {
     denc(v.first, p, f);
     denc(v.second, p, f);
   }
   template<typename AA=A>
   static std::enable_if_t<!!sizeof(AA) && !need_contiguous>
-    decode(std::pair<A,B>& v, buffer::list::const_iterator& p,
-           uint64_t f = 0) {
+  decode(std::pair<A,B>& v, ceph::buffer::list::const_iterator& p,
+        uint64_t f = 0) {
     denc(v.first, p);
     denc(v.second, p);
   }
@@ -922,8 +923,9 @@ namespace _denc {
     }
 
     template<typename U=T>
-    static void encode(const container& s, buffer::list::contiguous_appender& p,
-          uint64_t f = 0) {
+    static void encode(const container& s,
+                      ceph::buffer::list::contiguous_appender& p,
+                      uint64_t f = 0) {
       denc((uint32_t)s.size(), p);
       if constexpr (traits::featured) {
         encode_nohead(s, p, f);
@@ -931,21 +933,22 @@ namespace _denc {
         encode_nohead(s, p);
       }
     }
-    static void decode(container& s, buffer::ptr::const_iterator& p, uint64_t f = 0) {
+    static void decode(container& s, ceph::buffer::ptr::const_iterator& p,
+                      uint64_t f = 0) {
       uint32_t num;
       denc(num, p);
       decode_nohead(num, s, p, f);
     }
     template<typename U=T>
     static std::enable_if_t<!!sizeof(U) && !need_contiguous>
-    decode(container& s, buffer::list::const_iterator& p) {
+    decode(container& s, ceph::buffer::list::const_iterator& p) {
       uint32_t num;
       denc(num, p);
       decode_nohead(num, s, p);
     }
 
     // nohead
-    static void encode_nohead(const container& s, buffer::list::contiguous_appender& p,
+    static void encode_nohead(const container& s, ceph::buffer::list::contiguous_appender& p,
                              uint64_t f = 0) {
       for (const T& e : s) {
         if constexpr (traits::featured) {
@@ -956,7 +959,8 @@ namespace _denc {
       }
     }
     static void decode_nohead(size_t num, container& s,
-                             buffer::ptr::const_iterator& p, uint64_t f=0) {
+                             ceph::buffer::ptr::const_iterator& p,
+                             uint64_t f=0) {
       s.clear();
       Details::reserve(s, num);
       while (num--) {
@@ -968,7 +972,7 @@ namespace _denc {
     template<typename U=T>
     static std::enable_if_t<!!sizeof(U) && !need_contiguous>
     decode_nohead(size_t num, container& s,
-                 buffer::list::const_iterator& p) {
+                 ceph::buffer::list::const_iterator& p) {
       s.clear();
       Details::reserve(s, num);
       while (num--) {
@@ -1131,8 +1135,8 @@ public:
     }
   }
 
-  static void encode(const container& s, buffer::list::contiguous_appender& p,
-        uint64_t f = 0) {
+  static void encode(const container& s, ceph::buffer::list::contiguous_appender& p,
+                    uint64_t f = 0) {
     for (const auto& e : s) {
       if constexpr (traits::featured) {
         denc(e, p, f);
@@ -1141,14 +1145,15 @@ public:
       }
     }
   }
-  static void decode(container& s, buffer::ptr::const_iterator& p, uint64_t f = 0) {
+  static void decode(container& s, ceph::buffer::ptr::const_iterator& p,
+                    uint64_t f = 0) {
     for (auto& e : s)
       denc(e, p, f);
   }
   template<typename U=T>
   static std::enable_if_t<!!sizeof(U) &&
                          !need_contiguous>
-  decode(container& s, buffer::list::const_iterator& p) {
+  decode(container& s, ceph::buffer::list::const_iterator& p) {
     for (auto& e : s) {
       denc(e, p);
     }
@@ -1194,7 +1199,8 @@ public:
 
   template<typename U = container>
   static std::enable_if_t<denc_traits<U>::featured>
-  encode(const container& s, buffer::list::contiguous_appender& p, uint64_t f) {
+  encode(const container& s, ceph::buffer::list::contiguous_appender& p,
+        uint64_t f) {
     ceph::for_each(s, [&p, f] (const auto& e) {
        if constexpr (denc_traits<std::decay_t<decltype(e)>>::featured) {
          denc(e, p, f);
@@ -1205,13 +1211,14 @@ public:
   }
   template<typename U = container>
   static std::enable_if_t<!denc_traits<U>::featured>
-  encode(const container& s, buffer::list::contiguous_appender& p) {
+  encode(const container& s, ceph::buffer::list::contiguous_appender& p) {
     ceph::for_each(s, [&p] (const auto& e) {
        denc(e, p);
       });
   }
 
-  static void decode(container& s, buffer::ptr::const_iterator& p, uint64_t f = 0) {
+  static void decode(container& s, ceph::buffer::ptr::const_iterator& p,
+                    uint64_t f = 0) {
     ceph::for_each(s, [&p] (auto& e) {
        denc(e, p);
       });
@@ -1219,7 +1226,7 @@ public:
 
   template<typename U = container>
   static std::enable_if_t<!denc_traits<U>::need_contiguous>
-  decode(container& s, buffer::list::const_iterator& p, uint64_t f = 0) {
+  decode(container& s, ceph::buffer::list::const_iterator& p, uint64_t f = 0) {
     ceph::for_each(s, [&p] (auto& e) {
        denc(e, p);
       });
@@ -1253,7 +1260,7 @@ struct denc_traits<
   }
 
   static void encode(const boost::optional<T>& v,
-                    bufferlist::contiguous_appender& p,
+                    ceph::buffer::list::contiguous_appender& p,
                     uint64_t f = 0) {
     denc((bool)v, p);
     if (v) {
@@ -1265,7 +1272,7 @@ struct denc_traits<
     }
   }
 
-  static void decode(boost::optional<T>& v, buffer::ptr::const_iterator& p,
+  static void decode(boost::optional<T>& v, ceph::buffer::ptr::const_iterator& p,
                     uint64_t f = 0) {
     bool x;
     denc(x, p, f);
@@ -1279,7 +1286,7 @@ struct denc_traits<
 
   template<typename U = T>
   static std::enable_if_t<!!sizeof(U) && !need_contiguous>
-  decode(boost::optional<T>& v, buffer::list::const_iterator& p) {
+  decode(boost::optional<T>& v, ceph::buffer::list::const_iterator& p) {
     bool x;
     denc(x, p);
     if (x) {
@@ -1292,7 +1299,7 @@ struct denc_traits<
 
   template<typename U = T>
   static void encode_nohead(const boost::optional<T>& v,
-                           bufferlist::contiguous_appender& p,
+                           ceph::buffer::list::contiguous_appender& p,
                            uint64_t f = 0) {
     if (v) {
       if constexpr (featured) {
@@ -1304,7 +1311,7 @@ struct denc_traits<
   }
 
   static void decode_nohead(bool num, boost::optional<T>& v,
-                           buffer::ptr::const_iterator& p, uint64_t f = 0) {
+                           ceph::buffer::ptr::const_iterator& p, uint64_t f = 0) {
     if (num) {
       v = T();
       denc(*v, p, f);
@@ -1326,7 +1333,7 @@ struct denc_traits<boost::none_t> {
   }
 
   static void encode(const boost::none_t& v,
-                    bufferlist::contiguous_appender& p) {
+                    ceph::buffer::list::contiguous_appender& p) {
     denc(false, p);
   }
 };
@@ -1358,7 +1365,7 @@ struct denc_traits<
   }
 
   static void encode(const std::optional<T>& v,
-                    bufferlist::contiguous_appender& p,
+                    ceph::buffer::list::contiguous_appender& p,
                     uint64_t f = 0) {
     denc((bool)v, p);
     if (v) {
@@ -1370,7 +1377,7 @@ struct denc_traits<
     }
   }
 
-  static void decode(std::optional<T>& v, buffer::ptr::const_iterator& p,
+  static void decode(std::optional<T>& v, ceph::buffer::ptr::const_iterator& p,
                     uint64_t f = 0) {
     bool x;
     denc(x, p, f);
@@ -1384,7 +1391,7 @@ struct denc_traits<
 
   template<typename U = T>
   static std::enable_if_t<!!sizeof(U) && !need_contiguous>
-  decode(std::optional<T>& v, buffer::list::const_iterator& p) {
+  decode(std::optional<T>& v, ceph::buffer::list::const_iterator& p) {
     bool x;
     denc(x, p);
     if (x) {
@@ -1396,7 +1403,7 @@ struct denc_traits<
   }
 
   static void encode_nohead(const std::optional<T>& v,
-                           bufferlist::contiguous_appender& p,
+                           ceph::buffer::list::contiguous_appender& p,
                            uint64_t f = 0) {
     if (v) {
       if constexpr (featured) {
@@ -1408,7 +1415,7 @@ struct denc_traits<
   }
 
   static void decode_nohead(bool num, std::optional<T>& v,
-                           buffer::ptr::const_iterator& p, uint64_t f = 0) {
+                           ceph::buffer::ptr::const_iterator& p, uint64_t f = 0) {
     if (num) {
       v = T();
       denc(*v, p, f);
@@ -1430,7 +1437,7 @@ struct denc_traits<std::nullopt_t> {
   }
 
   static void encode(const std::nullopt_t& v,
-                    bufferlist::contiguous_appender& p) {
+                    ceph::buffer::list::contiguous_appender& p) {
     denc(false, p);
   }
 };
@@ -1452,11 +1459,11 @@ struct denc_traits<std::nullopt_t> {
     static void bound_encode(const T& v, size_t& p, uint64_t f=0) {    \
       v.bound_encode(p);                                               \
     }                                                                  \
-    static void encode(const T& v, buffer::list::contiguous_appender& p, \
+    static void encode(const T& v, ::ceph::buffer::list::contiguous_appender& p, \
                       uint64_t f=0) {                                  \
       v.encode(p);                                                     \
     }                                                                  \
-    static void decode(T& v, buffer::ptr::const_iterator& p, uint64_t f=0) {   \
+    static void decode(T& v, ::ceph::buffer::ptr::const_iterator& p, uint64_t f=0) { \
       v.decode(p);                                                     \
     }                                                                  \
   };
@@ -1472,11 +1479,11 @@ struct denc_traits<std::nullopt_t> {
     static void bound_encode(const T& v, size_t& p, uint64_t f) {      \
       v.bound_encode(p, f);                                            \
     }                                                                  \
-    static void encode(const T& v, buffer::list::contiguous_appender& p, \
+    static void encode(const T& v, ::ceph::buffer::list::contiguous_appender& p, \
                       uint64_t f) {                                    \
       v.encode(p, f);                                                  \
     }                                                                  \
-    static void decode(T& v, buffer::ptr::const_iterator& p, uint64_t f=0) {   \
+    static void decode(T& v, ::ceph::buffer::ptr::const_iterator& p, uint64_t f=0) { \
       v.decode(p, f);                                                  \
     }                                                                  \
   };
@@ -1492,7 +1499,7 @@ namespace ceph {
 template<typename T, typename traits=denc_traits<T>>
 inline std::enable_if_t<traits::supported && !traits::featured> encode(
   const T& o,
-  bufferlist& bl,
+  ceph::buffer::list& bl,
   uint64_t features_unused=0)
 {
   size_t len = 0;
@@ -1503,7 +1510,7 @@ inline std::enable_if_t<traits::supported && !traits::featured> encode(
 
 template<typename T, typename traits=denc_traits<T>>
 inline std::enable_if_t<traits::supported && traits::featured> encode(
-  const T& o, bufferlist& bl,
+  const T& o, ::ceph::buffer::list& bl,
   uint64_t features)
 {
   size_t len = 0;
@@ -1516,10 +1523,10 @@ template<typename T,
         typename traits=denc_traits<T>>
 inline std::enable_if_t<traits::supported && !traits::need_contiguous> decode(
   T& o,
-  bufferlist::const_iterator& p)
+  ::ceph::buffer::list::const_iterator& p)
 {
   if (p.end())
-    throw buffer::end_of_buffer();
+    throw ::ceph::buffer::end_of_buffer();
   const auto& bl = p.get_bl();
   const auto remaining = bl.length() - p.get_off();
   // it is expensive to rebuild a contigous buffer and drop it, so avoid this.
@@ -1527,10 +1534,10 @@ inline std::enable_if_t<traits::supported && !traits::need_contiguous> decode(
     traits::decode(o, p);
   } else {
     // ensure we get a contigous buffer... until the end of the
-    // bufferlist.  we don't really know how much we'll need here,
+    // ceph::buffer::list.  we don't really know how much we'll need here,
     // unfortunately.  hopefully it is already contiguous and we're just
     // bumping the raw ref and initializing the ptr tmp fields.
-    bufferptr tmp;
+    ceph::buffer::ptr tmp;
     auto t = p;
     t.copy_shallow(remaining, tmp);
     auto cp = std::cbegin(tmp);
@@ -1543,15 +1550,15 @@ template<typename T,
         typename traits=denc_traits<T>>
 inline std::enable_if_t<traits::supported && traits::need_contiguous> decode(
   T& o,
-  bufferlist::const_iterator& p)
+  ceph::buffer::list::const_iterator& p)
 {
   if (p.end())
-    throw buffer::end_of_buffer();
+    throw ceph::buffer::end_of_buffer();
   // ensure we get a contigous buffer... until the end of the
-  // bufferlist.  we don't really know how much we'll need here,
+  // ceph::buffer::list.  we don't really know how much we'll need here,
   // unfortunately.  hopefully it is already contiguous and we're just
   // bumping the raw ref and initializing the ptr tmp fields.
-  bufferptr tmp;
+  ceph::buffer::ptr tmp;
   auto t = p;
   t.copy_shallow(p.get_bl().length() - p.get_off(), tmp);
   auto cp = std::cbegin(tmp);
@@ -1564,7 +1571,7 @@ template<typename T, typename traits=denc_traits<T>>
 inline std::enable_if_t<traits::supported &&
                        !traits::featured> encode_nohead(
   const T& o,
-  bufferlist& bl)
+  ceph::buffer::list& bl)
 {
   size_t len = 0;
   traits::bound_encode(o, len);
@@ -1576,14 +1583,14 @@ template<typename T, typename traits=denc_traits<T>>
 inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
   size_t num,
   T& o,
-  bufferlist::const_iterator& p)
+  ceph::buffer::list::const_iterator& p)
 {
   if (!num)
     return;
   if (p.end())
-    throw buffer::end_of_buffer();
+    throw ceph::buffer::end_of_buffer();
   if constexpr (traits::need_contiguous) {
-    bufferptr tmp;
+    ceph::buffer::ptr tmp;
     auto t = p;
     if constexpr (denc_traits<typename T::value_type>::bounded) {
       size_t element_size = 0;
@@ -1623,7 +1630,7 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
                           __u8 *struct_compat,                         \
                           char **, uint32_t *) { }                     \
   /* encode */                                                         \
-  static void _denc_start(bufferlist::contiguous_appender& p,          \
+  static void _denc_start(::ceph::buffer::list::contiguous_appender& p,        \
                          __u8 *struct_v,                               \
                          __u8 *struct_compat,                          \
                          char **len_pos,                               \
@@ -1633,7 +1640,7 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
     *len_pos = p.get_pos_add(4);                                       \
     *start_oob_off = p.get_out_of_band_offset();                       \
   }                                                                    \
-  static void _denc_finish(bufferlist::contiguous_appender& p,         \
+  static void _denc_finish(::ceph::buffer::list::contiguous_appender& p, \
                           __u8 *struct_v,                              \
                           __u8 *struct_compat,                         \
                           char **len_pos,                              \
@@ -1642,7 +1649,7 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
       p.get_out_of_band_offset() - *start_oob_off;                     \
   }                                                                    \
   /* decode */                                                         \
-  static void _denc_start(buffer::ptr::const_iterator& p,              \
+  static void _denc_start(::ceph::buffer::ptr::const_iterator& p,      \
                          __u8 *struct_v,                               \
                          __u8 *struct_compat,                          \
                          char **start_pos,                             \
@@ -1652,7 +1659,7 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
     denc(*struct_len, p);                                              \
     *start_pos = const_cast<char*>(p.get_pos());                       \
   }                                                                    \
-  static void _denc_finish(buffer::ptr::const_iterator& p,             \
+  static void _denc_finish(::ceph::buffer::ptr::const_iterator& p,     \
                           __u8 *struct_v, __u8 *struct_compat,         \
                           char **start_pos,                            \
                           uint32_t *struct_len) {                      \
@@ -1690,12 +1697,12 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
   void bound_encode(size_t& p) const {                                 \
     _denc_friend(*this, p);                                            \
   }                                                                    \
-  void encode(bufferlist::contiguous_appender& p) const {              \
+  void encode(::ceph::buffer::list::contiguous_appender& p) const {    \
     DENC_DUMP_PRE(Type);                                               \
     _denc_friend(*this, p);                                            \
     DENC_DUMP_POST(Type);                                              \
   }                                                                    \
-  void decode(buffer::ptr::const_iterator& p) {                                \
+  void decode(::ceph::buffer::ptr::const_iterator& p) {                        \
     _denc_friend(*this, p);                                            \
   }                                                                    \
   template<typename T, typename P>                                     \
@@ -1708,12 +1715,12 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
   void bound_encode(size_t& p, uint64_t f) const {                     \
     _denc_friend(*this, p, f);                                         \
   }                                                                    \
-  void encode(bufferlist::contiguous_appender& p, uint64_t f) const {  \
+  void encode(::ceph::buffer::list::contiguous_appender& p, uint64_t f) const { \
     DENC_DUMP_PRE(Type);                                               \
     _denc_friend(*this, p, f);                                         \
     DENC_DUMP_POST(Type);                                              \
   }                                                                    \
-  void decode(buffer::ptr::const_iterator& p, uint64_t f=0) {          \
+  void decode(::ceph::buffer::ptr::const_iterator& p, uint64_t f=0) {  \
     _denc_friend(*this, p, f);                                         \
   }                                                                    \
   template<typename T, typename P>                                     \