Skip to content

Commit

Permalink
expose more inode fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tsatke committed Jul 3, 2024
1 parent cb88531 commit 82a1ff2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ext2/src/inode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,38 @@ impl Inode {
&mut self.num_disk_sectors
}

pub fn num_hard_links(&self) -> u16 {
self.num_hard_links
}

pub fn num_hard_links_mut(&mut self) -> &mut u16 {
&mut self.num_hard_links
}

pub fn last_access_time(&self) -> u32 {
self.last_access_time
}

pub fn last_access_time_mut(&mut self) -> &mut u32 {
&mut self.last_access_time
}

pub fn last_modification_time(&self) -> u32 {
self.last_modification_time
}

pub fn last_modification_time_mut(&mut self) -> &mut u32 {
&mut self.last_modification_time
}

pub fn creation_time(&self) -> u32 {
self.creation_time
}

pub fn creation_time_mut(&mut self) -> &mut u32 {
&mut self.creation_time
}

pub fn direct_ptrs(&self) -> impl Iterator<Item=Option<BlockAddress>> + '_ {
self.direct_block_ptr.iter().map(|&ptr| BlockAddress::new(ptr))
}
Expand Down

0 comments on commit 82a1ff2

Please sign in to comment.