move sweep_used_chunks to chunk_store

This commit is contained in:
Dietmar Maurer 2018-12-18 11:18:55 +01:00
parent 3d5c11e5d2
commit 6ea3a0b7fc
2 changed files with 7 additions and 6 deletions

View File

@ -163,6 +163,11 @@ impl ChunkStore {
Ok(())
}
pub fn sweep_used_chunks(&mut self) -> Result<(), Error> {
Ok(())
}
pub fn insert_chunk(&mut self, chunk: &[u8]) -> Result<(bool, [u8; 32]), Error> {
self.hasher.reset();

View File

@ -61,11 +61,6 @@ impl DataStore {
Ok(list)
}
fn sweep_used_chunks(&mut self) -> Result<(), Error> {
Ok(())
}
fn mark_used_chunks(&mut self) -> Result<(), Error> {
let image_list = self.list_images()?;
@ -81,7 +76,8 @@ impl DataStore {
pub fn garbage_collection(&mut self) -> Result<(), Error> {
self.mark_used_chunks()?;
self.sweep_used_chunks()?;
self.chunk_store.sweep_used_chunks()?;
Ok(())
}