]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/cached_extent: add buffer sharing constructor
authorSamuel Just <sjust@redhat.com>
Mon, 1 Jun 2020 19:02:35 +0000 (12:02 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 2 Jun 2020 23:56:41 +0000 (16:56 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cached_extent.h

index 83d54c77ead5b038c1bca50cf7d7536ae97335cf..463f5eeae595f77603565a7c6b6df0acf53fc243 100644 (file)
@@ -278,6 +278,7 @@ private:
   }
 
 protected:
+  CachedExtent(CachedExtent &&other) = default;
   CachedExtent(ceph::bufferptr &&ptr) : ptr(std::move(ptr)) {}
   CachedExtent(const CachedExtent &other)
     : state(other.state),
@@ -285,6 +286,14 @@ protected:
       version(other.version),
       poffset(other.poffset) {}
 
+  struct share_buffer_t {};
+  CachedExtent(const CachedExtent &other, share_buffer_t) :
+    state(other.state),
+    ptr(other.ptr),
+    version(other.version),
+    poffset(other.poffset) {}
+
+
   friend class Cache;
   template <typename T, typename... Args>
   static TCachedExtentRef<T> make_cached_extent_ref(Args&&... args) {