diff --git a/src/lib/homestore/CMakeLists.txt b/src/lib/homestore/CMakeLists.txt index 04e495c2..8401e27f 100644 --- a/src/lib/homestore/CMakeLists.txt +++ b/src/lib/homestore/CMakeLists.txt @@ -6,7 +6,7 @@ target_sources("${PROJECT_NAME}_homestore" PRIVATE homeobject.cpp blob_manager.cpp shard_manager.cpp - heap_chunk_selector.cpp + heap_chunk_selector.cpp $ ) target_link_libraries("${PROJECT_NAME}_homestore" diff --git a/src/lib/homestore/heap_chunk_selector.cpp b/src/lib/homestore/heap_chunk_selector.cpp index d3853d6b..ed28cfa6 100644 --- a/src/lib/homestore/heap_chunk_selector.cpp +++ b/src/lib/homestore/heap_chunk_selector.cpp @@ -62,7 +62,12 @@ csharedChunk HeapChunkSelector::select_chunk(homestore::blk_count_t count, const void HeapChunkSelector::foreach_chunks(std::function< void(csharedChunk&) >&& cb) { //we should call `cb` on all the chunks, selected or not - std::lock_guard l(lock); + + //actually, after vdev is initialized, no more new chunks will be added again, + //so we can make this assumption and disable this lock. + + //if we support dynamiclly add new chunks to vdev in the future, we need to enable this lock + //std::lock_guard l(lock); std::for_each(std::execution::par_unseq, m_chunks.begin(), m_chunks.end(), [cb = std::move(cb)](const VChunk& p){ cb(p.get_internal_chunk()); }); }