mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-18 03:56:42 +00:00
Implement flush for virtio-blk
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
197d53c0ab
commit
32572e22d9
@ -83,6 +83,18 @@ impl dyn BlockDevice {
|
||||
let bio = create_bio_from_frame(BioType::Write, bid, frame);
|
||||
bio.submit(self)
|
||||
}
|
||||
|
||||
/// Issues a sync request
|
||||
pub fn sync(&self) -> Result<BioStatus, BioEnqueueError> {
|
||||
let bio = Bio::new(
|
||||
BioType::Flush,
|
||||
Sid::from(Bid::from_offset(0)),
|
||||
vec![],
|
||||
Some(general_complete_fn),
|
||||
);
|
||||
let status = bio.submit_and_wait(self)?;
|
||||
Ok(status)
|
||||
}
|
||||
}
|
||||
|
||||
impl VmIo for dyn BlockDevice {
|
||||
|
Reference in New Issue
Block a user