pub struct Inode {Show 20 fields
pub mode: u16,
pub uid: u32,
pub gid: u32,
pub size: u64,
pub atime: i64,
pub mtime: i64,
pub ctime: i64,
pub dtime: i64,
pub crtime: i64,
pub atime_nsec: u32,
pub mtime_nsec: u32,
pub ctime_nsec: u32,
pub crtime_nsec: u32,
pub links_count: u16,
pub blocks: u64,
pub flags: u32,
pub block: [u8; 60],
pub generation: u32,
pub file_acl: u64,
pub checksum: u32,
}Expand description
Parsed ext4 inode.
Combines hi+lo halves for uid, gid, size, file_acl, blocks, and checksum so
callers don’t have to reassemble them. Nanosecond timestamps come from the
*_extra fields when present (top 30 bits = nsec, low 2 bits = epoch).
Fields§
§mode: u16§uid: u32§gid: u32§size: u64§atime: i64Seconds since the Unix epoch, signed and 64-bit.
The on-disk base field is a signed 32-bit value, so dates before
1970 are representable and must not be read as far-future ones.
When i_extra_isize is large enough, the low two bits of the
matching *_extra field extend the seconds by << 32, widening
the range from 1901..2038 to roughly 1901..2446. Both are
applied here; see decode_extra_time.
mtime: i64§ctime: i64§dtime: i64§crtime: i64§atime_nsec: u32§mtime_nsec: u32§ctime_nsec: u32§crtime_nsec: u32§links_count: u16§blocks: u64§flags: u32§block: [u8; 60]Raw 60-byte i_block area — extent header / direct pointers / inline data. Parsed by the extent module.
generation: u32§file_acl: u64§checksum: u32Implementations§
Source§impl Inode
impl Inode
Sourcepub fn parse(raw: &[u8]) -> Result<Self>
pub fn parse(raw: &[u8]) -> Result<Self>
Parse an inode from its on-disk bytes. Accepts any length >= 128; if >= 160 and i_extra_isize >= 28, parses the extra (nsec + crtime + checksum_hi) section as well.
pub fn is_dir(&self) -> bool
pub fn is_file(&self) -> bool
pub fn is_symlink(&self) -> bool
Sourcepub fn has_extents(&self) -> bool
pub fn has_extents(&self) -> bool
True when EXT4_EXTENTS_FL is set in i_flags — i_block holds an extent tree rather than legacy direct/indirect block pointers.
Sourcepub fn has_inline_data(&self) -> bool
pub fn has_inline_data(&self) -> bool
True when INLINE_DATA flag is set — file contents live inside i_block.
Sourcepub fn flag_set(&self) -> InodeFlags
pub fn flag_set(&self) -> InodeFlags
Decode i_flags into a typed bitflags value (silently drops unknown bits).