[pbs-devel] [PATCH v8 proxmox-backup 43/69] chunker: add method to reset chunker state
Christian Ebner
c.ebner at proxmox.com
Tue May 28 11:42:37 CEST 2024
When forcing a boundary, the internal chunker state is not in sync
with the chunk stream anymore. The reset method therefore allows
to reset the internal state.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 7:
- no changes
changes since version 6:
- no changes
pbs-datastore/src/chunker.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pbs-datastore/src/chunker.rs b/pbs-datastore/src/chunker.rs
index 712751829..253d2cf4c 100644
--- a/pbs-datastore/src/chunker.rs
+++ b/pbs-datastore/src/chunker.rs
@@ -167,6 +167,12 @@ impl Chunker {
0
}
+ pub fn reset(&mut self) {
+ self.h = 0;
+ self.chunk_size = 0;
+ self.window_size = 0;
+ }
+
// fast implementation avoiding modulo
// #[inline(always)]
fn shall_break(&self) -> bool {
--
2.39.2
More information about the pbs-devel
mailing list