diff --git a/src/include/homestore/vchunk.h b/src/include/homestore/vchunk.h index 8064d922b..a6ff0eb48 100644 --- a/src/include/homestore/vchunk.h +++ b/src/include/homestore/vchunk.h @@ -27,8 +27,8 @@ class VChunk { ~VChunk() = default; - void set_user_private(const sisl::blob& data) const; - uint8_t* get_user_private() const; + void set_user_private(const sisl::blob& data); + const uint8_t* get_user_private() const; blk_cap_t available_blks() const; uint32_t get_pdev_id() const; cshared< Chunk > get_internal_chunk () const; diff --git a/src/lib/device/chunk.h b/src/lib/device/chunk.h index 133245f8b..edb3ad6d2 100644 --- a/src/lib/device/chunk.h +++ b/src/lib/device/chunk.h @@ -53,7 +53,7 @@ class Chunk { uint16_t chunk_id() const { return static_cast< uint16_t >(m_chunk_info.chunk_id); } uint64_t end_of_chunk() const { return m_chunk_info.end_of_chunk_size; } uint32_t pdev_ordinal() const { return m_chunk_info.chunk_ordinal; } - uint8_t* user_private() { return &m_chunk_info.user_private[0]; } + const uint8_t* user_private() { return &m_chunk_info.user_private[0]; } uint32_t stream_id() const { return m_stream_id; } uint32_t slot_number() const { return m_chunk_slot; } uint32_t vdev_ordinal() const { return m_vdev_ordinal; } diff --git a/src/lib/device/vchunk.cpp b/src/lib/device/vchunk.cpp index fbd50c7aa..31860b446 100644 --- a/src/lib/device/vchunk.cpp +++ b/src/lib/device/vchunk.cpp @@ -19,11 +19,11 @@ namespace homestore { VChunk::VChunk(cshared< Chunk >& chunk) : internalChunk(chunk){} - void VChunk::set_user_private(const sisl::blob& data) const{ + void VChunk::set_user_private(const sisl::blob& data){ internalChunk->set_user_private(data); } - uint8_t* VChunk::get_user_private() const { + const uint8_t* VChunk::get_user_private() const { return internalChunk->user_private(); };