state machine cacheflush

This commit is contained in:
Pere Diaz Bou 2024-11-05 15:27:07 +01:00
parent da7717edfb
commit a85d599c65
4 changed files with 90 additions and 59 deletions

View file

@ -14,6 +14,7 @@ pub trait DatabaseStorage {
buffer: Rc<RefCell<Buffer>>,
c: Rc<Completion>,
) -> Result<()>;
fn sync(&self, c: Rc<Completion>) -> Result<()>;
}
#[cfg(feature = "fs")]
@ -52,6 +53,10 @@ impl DatabaseStorage for FileStorage {
self.file.pwrite(pos, buffer, c)?;
Ok(())
}
fn sync(&self, c: Rc<Completion>) -> Result<()> {
self.file.sync(c)
}
}
#[cfg(feature = "fs")]