Revise the BlockDevice trait

This commit is contained in:
Shaowei Song
2024-07-18 11:45:38 +00:00
committed by Tate, Hongliang Tian
parent e83e1fc01b
commit ff525112d0
5 changed files with 71 additions and 8 deletions

View File

@ -19,7 +19,7 @@ mod test {
use aster_block::{
bio::{BioEnqueueError, BioStatus, BioType, SubmittedBio},
BlockDevice,
BlockDevice, BlockDeviceMeta,
};
use ostd::{
mm::{FrameAllocOptions, Segment, VmIo},
@ -99,8 +99,11 @@ mod test {
Ok(())
}
fn max_nr_segments_per_bio(&self) -> usize {
usize::MAX
fn metadata(&self) -> BlockDeviceMeta {
BlockDeviceMeta {
max_nr_segments_per_bio: usize::MAX,
nr_sectors: self.sectors_count(),
}
}
}
/// Exfat disk image