This commit is contained in:
2024-10-26 20:53:41 -05:00
parent eba242de7f
commit 468aba1399

View File

@@ -301,10 +301,14 @@ auto open_file::native_operation(
}
if (is_empty_file || (read_state_.size() != (last_chunk + 1U))) {
auto old_size = read_state_.size();
read_state_.resize(is_empty_file ? 0U : last_chunk + 1U);
if (not is_empty_file) {
read_state_[last_chunk] = true;
for (std::size_t chunk_index = old_size; chunk_index <= last_chunk;
++chunk_index) {
read_state_.set(chunk_index);
}
}
last_chunk_size_ = static_cast<std::size_t>(
@@ -570,11 +574,6 @@ auto open_file::write(std::uint64_t write_offset, const data_buffer &data,
return api_error::os_error;
}
for (std::size_t chunk_index = start_chunk_index;
chunk_index <= end_chunk_index; ++chunk_index) {
read_state_.set(chunk_idx);
}
reset_timeout();
return api_error::success;
});