]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/cas/cls_cas_internal: add chunk_refs_t operator=, copy ctor wip-cas
authorSage Weil <sage@newdream.net>
Tue, 26 May 2020 14:48:28 +0000 (09:48 -0500)
committerSage Weil <sage@newdream.net>
Wed, 27 May 2020 16:30:35 +0000 (11:30 -0500)
For ceph-dencoder's benefit

Signed-off-by: Sage Weil <sage@newdream.net>
src/cls/cas/cls_cas_internal.cc
src/cls/cas/cls_cas_internal.h

index 65ab38023d336f43b3a6b6a9cea611903da6b941..c5179488a522830eef88415393f0cd3e4217f2c1 100644 (file)
@@ -298,6 +298,21 @@ WRITE_CLASS_ENCODER(refs_count)
 
 //
 
+chunk_refs_t::chunk_refs_t(const chunk_refs_t& other)
+{
+  *this = other;
+}
+
+chunk_refs_t& chunk_refs_t::operator=(const chunk_refs_t& other)
+{
+  // this is inefficient, but easy.
+  bufferlist bl;
+  other.encode(bl);
+  auto p = bl.cbegin();
+  decode(p);
+  return *this;
+}
+
 void chunk_refs_t::clear()
 {
   // default to most precise impl
index 2831ae0cc71405e3e1a7a01ce2559899c562115b..26de45196908c0e1d70eba9a8d4417ecb8d7f132 100644 (file)
@@ -49,6 +49,9 @@ struct chunk_refs_t {
   chunk_refs_t() {
     clear();
   }
+  chunk_refs_t(const chunk_refs_t& other);
+
+  chunk_refs_t& operator=(const chunk_refs_t&);
 
   void clear();