From: Samuel Just Date: Tue, 26 May 2020 18:17:14 +0000 (-0700) Subject: crimson/os/seastore/root_block: fix copy constructor X-Git-Tag: wip-pdonnell-testing-20200918.022351~1104^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=854f8639500986be06afa81a82a7825107c21567;p=ceph-ci.git crimson/os/seastore/root_block: fix copy constructor Otherwise, we don't appropriately initialize root. Signed-off-by: Samuel Just --- 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)); };