[thin/cache_restore (rust)] Build the metadata space map in-place

That avoids cloning the source space map
This commit is contained in:
Ming-Hung Tsai
2021-06-11 18:16:51 +08:00
parent 9ab8dfa283
commit 4b7b3658ff
6 changed files with 97 additions and 18 deletions

View File

@@ -114,6 +114,13 @@ impl WriteBatcher {
tmp
}
pub fn get_reserved_range(&self) -> std::ops::Range<u64> {
std::ops::Range {
start: self.reserved.start,
end: self.reserved.end,
}
}
pub fn write(&mut self, b: Block, kind: checksum::BT) -> Result<()> {
checksum::write_checksum(&mut b.get_data(), kind)?;