Support indirect2 in easy-fs::layout::DiskInode

This commit is contained in:
Yifan Wu 2021-02-27 06:40:52 +08:00
parent c8d851fc2b
commit 28ef057fe3
4 changed files with 228 additions and 35 deletions

View file

@ -118,7 +118,8 @@ fn efs_test() -> std::io::Result<()> {
let filea = root_inode.find("filea").unwrap();
let greet_str = "Hello, world!";
filea.write_at(0, greet_str.as_bytes());
let mut buffer = [0u8; 512];
//let mut buffer = [0u8; 512];
let mut buffer = [0u8; 233];
let len = filea.read_at(0, &mut buffer);
assert_eq!(
greet_str,
@ -159,6 +160,9 @@ fn efs_test() -> std::io::Result<()> {
random_str_test(100 * BLOCK_SZ);
random_str_test(70 * BLOCK_SZ + BLOCK_SZ / 7);
random_str_test((12 + 128) * BLOCK_SZ);
random_str_test(400 * BLOCK_SZ);
random_str_test(1000 * BLOCK_SZ);
random_str_test(2000 * BLOCK_SZ);
Ok(())
}