From 854f8639500986be06afa81a82a7825107c21567 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 26 May 2020 11:17:14 -0700 Subject: [PATCH] crimson/os/seastore/root_block: fix copy constructor Otherwise, we don't appropriately initialize root. Signed-off-by: Samuel Just --- src/crimson/os/seastore/cached_extent.h | 6 +++--- src/crimson/os/seastore/root_block.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 4f40a3ecd28..6a464d3d907 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -305,9 +305,9 @@ protected: friend class Cache; - template - static TCachedExtentRef make_cached_extent_ref(Args&&... args) { - return new T(std::forward(args)...); + template + static TCachedExtentRef make_cached_extent_ref(bufferptr &&ptr) { + return new T(std::move(ptr)); } void set_paddr(paddr_t offset) { poffset = offset; } diff --git a/src/crimson/os/seastore/root_block.h b/src/crimson/os/seastore/root_block.h index 96fc14dfb6d..4ce8932c24e 100644 --- a/src/crimson/os/seastore/root_block.h +++ b/src/crimson/os/seastore/root_block.h @@ -47,6 +47,8 @@ struct RootBlock : CachedExtent { template RootBlock(T&&... t) : CachedExtent(std::forward(t)...) {} + RootBlock(const RootBlock &rhs) = default; + CachedExtentRef duplicate_for_write() final { return CachedExtentRef(new RootBlock(*this)); }; -- 2.39.5