]> git.proxmox.com Git - proxmox-backup.git/commitdiff
gc: remove duplicate variable
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 30 Nov 2020 15:22:19 +0000 (16:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 1 Dec 2020 05:06:51 +0000 (06:06 +0100)
list_images already returns absolute paths, we don't need to prepend
anything.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/backup/datastore.rs

index 2700d6e99b7335da834c7028e4f728ec38868b3a..8ea0a7531f9e2dbeb018b9bc66bf11fc317d4249 100644 (file)
@@ -491,26 +491,24 @@ impl DataStore {
                 }
             }
 
-            let path = self.chunk_store.relative_path(&img);
-
-            match std::fs::File::open(&path) {
+            match std::fs::File::open(&img) {
                 Ok(file) => {
                     if let Ok(archive_type) = archive_type(&img) {
                         if archive_type == ArchiveType::FixedIndex {
                             let index = FixedIndexReader::new(file).map_err(|e| {
-                                format_err!("can't read index '{}' - {}", path.to_string_lossy(), e)
+                                format_err!("can't read index '{}' - {}", img.to_string_lossy(), e)
                             })?;
                             self.index_mark_used_chunks(index, &img, status, worker)?;
                         } else if archive_type == ArchiveType::DynamicIndex {
                             let index = DynamicIndexReader::new(file).map_err(|e| {
-                                format_err!("can't read index '{}' - {}", path.to_string_lossy(), e)
+                                format_err!("can't read index '{}' - {}", img.to_string_lossy(), e)
                             })?;
                             self.index_mark_used_chunks(index, &img, status, worker)?;
                         }
                     }
                 }
                 Err(err) if err.kind() == io::ErrorKind::NotFound => (), // ignore vanished files
-                Err(err) => bail!("can't open index {} - {}", path.to_string_lossy(), err),
+                Err(err) => bail!("can't open index {} - {}", img.to_string_lossy(), err),
             }
             done += 1;