Add rust lint CI job.
All checks were successful
Check / Check Rust (pull_request) Successful in 22s
All checks were successful
Check / Check Rust (pull_request) Successful in 22s
This commit is contained in:
parent
311755c812
commit
000c9403d5
30 changed files with 178 additions and 108 deletions
|
|
@ -94,7 +94,7 @@ impl Ext2Driver {
|
|||
/// Updates the cached inode tables to contain the inode table for
|
||||
/// a specific group.
|
||||
fn populate_inode_table_if_none(&mut self, block_group_num: usize) {
|
||||
if let None = self.inode_table_map[block_group_num] {
|
||||
if self.inode_table_map[block_group_num].is_none() {
|
||||
debug!(
|
||||
"Cache MISS on inode table for block_group {}",
|
||||
block_group_num
|
||||
|
|
@ -148,17 +148,15 @@ impl Ext2Driver {
|
|||
let dbl_indr_block_mem =
|
||||
MemoryRegion::from_cap(self.reader.read(block_num, 1).unwrap()).unwrap();
|
||||
|
||||
let dbl_indr_blocks: &[u32] = dbl_indr_block_mem.slice();
|
||||
let dbl_indr_blocks: &[u32] = &dbl_indr_block_mem.slice()[0..num_dbl_indr];
|
||||
|
||||
let mut blocks_to_read = Vec::new();
|
||||
|
||||
for i in 0..num_dbl_indr {
|
||||
for (i, dbl_indr_block) in dbl_indr_blocks.iter().enumerate() {
|
||||
let num_blocks_in_single = min(num_blocks - (256 * i), 256);
|
||||
blocks_to_read.append(
|
||||
&mut self.get_blocks_from_single_indirect(
|
||||
dbl_indr_blocks[i] as u64,
|
||||
num_blocks_in_single,
|
||||
),
|
||||
&mut self
|
||||
.get_blocks_from_single_indirect(*dbl_indr_block as u64, num_blocks_in_single),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +174,7 @@ impl Ext2Driver {
|
|||
|
||||
let mut blocks = Vec::new();
|
||||
|
||||
while let Some(block) = iter.next() {
|
||||
for block in iter {
|
||||
if block as u64 == (curr_block.lba + curr_block.size) {
|
||||
curr_block.size += 1;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,9 @@ pub struct Inode {
|
|||
|
||||
const _: () = assert!(size_of::<Inode>() == 128);
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub const EXT2_FT_FILE: u8 = 0x1;
|
||||
#[allow(dead_code)]
|
||||
pub const EXT2_FT_DIR: u8 = 0x2;
|
||||
|
||||
#[repr(C, packed)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue