make ReadChunk not require mutable self.

That way we can reduce lock contentions because we lock for much shorter
times.
This commit is contained in:
Dietmar Maurer
2020-07-03 07:36:23 +02:00
parent 26f499b17b
commit e9764238df
4 changed files with 23 additions and 23 deletions

View File

@ -1119,7 +1119,7 @@ async fn dump_image<W: Write>(
let most_used = index.find_most_used_chunks(8);
let mut chunk_reader = RemoteChunkReader::new(client.clone(), crypt_config, most_used);
let chunk_reader = RemoteChunkReader::new(client.clone(), crypt_config, most_used);
// Note: we avoid using BufferedFixedReader, because that add an additional buffer/copy
// and thus slows down reading. Instead, directly use RemoteChunkReader