From b6c6a893c001e98600aaeeb9e3833224f5182f58 Mon Sep 17 00:00:00 2001 From: Jie Yao Date: Sat, 16 Sep 2023 19:55:20 +0800 Subject: [PATCH] SDSTOR-11755. Make VChunk CopyAssignable and CopyConstructible (#167) * make VChunk CopyAssignable and CopyConstructible * internalChunk -> m_internal_chunk --- src/include/homestore/vchunk.h | 6 +++--- src/lib/device/vchunk.cpp | 22 +++++++--------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/include/homestore/vchunk.h b/src/include/homestore/vchunk.h index ed58a99a3..6f09786f1 100644 --- a/src/include/homestore/vchunk.h +++ b/src/include/homestore/vchunk.h @@ -24,7 +24,7 @@ class Chunk; class VChunk { public: VChunk(cshared< Chunk > const&); - + ~VChunk() = default; void set_user_private(const sisl::blob& data); @@ -34,6 +34,6 @@ class VChunk { cshared< Chunk > get_internal_chunk() const; private: - cshared< Chunk > internalChunk; + shared< Chunk > m_internal_chunk; }; -}// namespace homestore +} // namespace homestore diff --git a/src/lib/device/vchunk.cpp b/src/lib/device/vchunk.cpp index 31860b446..f47c372ee 100644 --- a/src/lib/device/vchunk.cpp +++ b/src/lib/device/vchunk.cpp @@ -17,23 +17,15 @@ #include "device/chunk.h" namespace homestore { - VChunk::VChunk(cshared< Chunk >& chunk) : internalChunk(chunk){} +VChunk::VChunk(cshared< Chunk >& chunk) : m_internal_chunk(chunk) {} - void VChunk::set_user_private(const sisl::blob& data){ - internalChunk->set_user_private(data); - } +void VChunk::set_user_private(const sisl::blob& data) { m_internal_chunk->set_user_private(data); } - const uint8_t* VChunk::get_user_private() const { - return internalChunk->user_private(); - }; +const uint8_t* VChunk::get_user_private() const { return m_internal_chunk->user_private(); }; - blk_cap_t VChunk::available_blks() const { - return internalChunk->blk_allocator()->available_blks(); - } +blk_cap_t VChunk::available_blks() const { return m_internal_chunk->blk_allocator()->available_blks(); } - uint32_t VChunk::get_pdev_id() const { - return internalChunk->physical_dev()->pdev_id(); - } +uint32_t VChunk::get_pdev_id() const { return m_internal_chunk->physical_dev()->pdev_id(); } - cshared< Chunk > VChunk::get_internal_chunk() const {return internalChunk;} -}// namespace homestore +cshared< Chunk > VChunk::get_internal_chunk() const { return m_internal_chunk; } +} // namespace homestore