summaryrefslogtreecommitdiff
path: root/src/block_device
diff options
context:
space:
mode:
Diffstat (limited to 'src/block_device')
-rw-r--r--src/block_device/memory_disk.rs4
-rw-r--r--src/block_device/mod.rs1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/block_device/memory_disk.rs b/src/block_device/memory_disk.rs
index 3876736..0639d3e 100644
--- a/src/block_device/memory_disk.rs
+++ b/src/block_device/memory_disk.rs
@@ -9,9 +9,9 @@ pub struct MemoryDisk {
}
impl MemoryDisk {
- pub fn new() -> Self {
+ pub fn new(block_number: usize) -> Self {
Self {
- arena: RefCell::new(vec![0u8; BLOCK_SIZE * 16384]),
+ arena: RefCell::new(vec![0u8; BLOCK_SIZE * block_number]),
}
}
}
diff --git a/src/block_device/mod.rs b/src/block_device/mod.rs
index c7e1362..a8fd8b7 100644
--- a/src/block_device/mod.rs
+++ b/src/block_device/mod.rs
@@ -1,6 +1,5 @@
/// Abstracts for block devices.
/// Currently only a mock memory disk.
-
pub mod memory_disk;
pub const BLOCK_SIZE: usize = 4096;
pub trait BlockDevice {