Fix doubly and triply indirect blocks
This commit is contained in:
parent
c3fe557045
commit
04bb2e97c6
@ -194,7 +194,7 @@ impl Inode {
|
||||
Some(block)
|
||||
}
|
||||
} else if block < (12 + num_sing_indir + num_doub_indir) as u32 {
|
||||
let base_block = 12 - num_sing_indir;
|
||||
let base_block = 12 + num_sing_indir;
|
||||
let doub_indir_offset = (block as usize - base_block) / num_sing_indir;
|
||||
let sing_indir_offset = (block as usize - base_block) % num_sing_indir;
|
||||
let sing_indir_blocks = self
|
||||
@ -210,7 +210,7 @@ impl Inode {
|
||||
Some(block)
|
||||
}
|
||||
} else if block < (12 + num_sing_indir + num_doub_indir + num_trip_indir) as u32 {
|
||||
let base_block = 12 - num_sing_indir;
|
||||
let base_block = 12 + num_sing_indir + num_doub_indir;
|
||||
let trip_indir_offset = (block as usize - base_block) / num_doub_indir;
|
||||
let doub_indir_offset =
|
||||
((block as usize - base_block) % num_doub_indir) / num_sing_indir;
|
||||
|
Loading…
Reference in New Issue
Block a user