Skip to content

Commit

Permalink
SDSTOR-11755. Make VChunk CopyAssignable and CopyConstructible (#167)
Browse files Browse the repository at this point in the history
* make VChunk CopyAssignable and CopyConstructible

* internalChunk -> m_internal_chunk
  • Loading branch information
JacksonYao287 authored Sep 16, 2023
1 parent 574c7df commit b6c6a89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/include/homestore/vchunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Chunk;
class VChunk {
public:
VChunk(cshared< Chunk > const&);

~VChunk() = default;

void set_user_private(const sisl::blob& data);
Expand All @@ -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
22 changes: 7 additions & 15 deletions src/lib/device/vchunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b6c6a89

Please sign in to comment.