Skip to content

Commit

Permalink
Let CRIU overwrite files
Browse files Browse the repository at this point in the history
  • Loading branch information
nviennot committed Sep 10, 2021
1 parent 54da6c6 commit 02c8c17
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/image_store/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ impl ImageStore for Store {
}

fn insert(&mut self, filename: impl Into<Box<str>>, file: File) {
let filename = filename.into();
assert!(!self.files.contains_key(&filename), "Image file {} is being overwritten", filename);

// We don't need to shrink our file. If it's a small one, then it's already small
// enough (we used reserve_exact()). For a large file, we could mremap() the last
// chunk, but that doesn't really help as we don't touch pages from the unused
// capacity, which thus remains unallocated.
self.files.insert(filename, file);
self.files.insert(filename.into(), file);
}
}

Expand Down

0 comments on commit 02c8c17

Please sign in to comment.