xref: /DragonOS/kernel/src/driver/block/cache/mod.rs (revision fae6e9ade46a52976ad5d099643d51cc20876448)
1 use alloc::vec::Vec;
2 
3 use self::cache_iter::FailData;
4 
5 mod cache_block;
6 mod cache_iter;
7 pub mod cached_block_device;
8 pub const BLOCK_SIZE_LOG: usize = 9;
9 ///块大小这里固定为512
10 pub const BLOCK_SIZE: usize = 1 << BLOCK_SIZE_LOG;
11 ///这里规定Cache的threshold大小,单位为:MB
12 pub const CACHE_THRESHOLD: usize = 64;
13 
14 pub enum BlockCacheError {
15     BlockSizeError,
16     InsufficientCacheSpace,
17     StaticParameterError,
18     BlockFaultError(Vec<FailData>),
19 }
20