]> git.proxmox.com Git - proxmox-backup.git/commitdiff
remote_chunk_reader.rs: use Arc for cache_hint to make clone faster
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 22 Sep 2020 07:51:19 +0000 (09:51 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 22 Sep 2020 09:39:31 +0000 (11:39 +0200)
src/client/remote_chunk_reader.rs

index 2670bf2210c2f261cf9a02be9bff60eaed022b4b..06f693a2b64b369455130a058254c1285e341365 100644 (file)
@@ -15,7 +15,7 @@ pub struct RemoteChunkReader {
     client: Arc<BackupReader>,
     crypt_config: Option<Arc<CryptConfig>>,
     crypt_mode: CryptMode,
-    cache_hint: HashMap<[u8; 32], usize>,
+    cache_hint: Arc<HashMap<[u8; 32], usize>>,
     cache: Arc<Mutex<HashMap<[u8; 32], Vec<u8>>>>,
 }
 
@@ -33,7 +33,7 @@ impl RemoteChunkReader {
             client,
             crypt_config,
             crypt_mode,
-            cache_hint,
+            cache_hint: Arc::new(cache_hint),
             cache: Arc::new(Mutex::new(HashMap::new())),
         }
     }