From 1cb50c00bad2352fe3ab437c3c3bcf6ae95677c4 Mon Sep 17 00:00:00 2001 From: WangRunji Date: Sun, 15 Jul 2018 16:44:21 +0800 Subject: [PATCH] Fit for SFS --- kernel/src/fs.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/src/fs.rs b/kernel/src/fs.rs index a2075ab..361d308 100644 --- a/kernel/src/fs.rs +++ b/kernel/src/fs.rs @@ -57,10 +57,7 @@ use core::slice; #[cfg(target_arch = "x86_64")] impl BlockedDevice for &'static ide::DISK0 { - fn block_size_log2(&self) -> u8 { - debug_assert_eq!(ide::BLOCK_SIZE, 512); - 9 - } + const BLOCK_SIZE_LOG2: u8 = 9; fn read_at(&mut self, block_id: usize, buf: &mut [u8]) -> bool { assert!(buf.len() >= ide::BLOCK_SIZE); let buf = unsafe { slice::from_raw_parts_mut(buf.as_ptr() as *mut u32, ide::BLOCK_SIZE / 4) };