#[repr(C)]pub struct SuperBlock {Show 92 fields
pub e2fs_icount: U32,
pub e2fs_bcount: U32,
pub e2fs_rbcount: U32,
pub e2fs_fbcount: U32,
pub e2fs_ficount: U32,
pub e2fs_first_dblock: U32,
pub e2fs_log_bsize: U32,
pub e2fs_log_fsize: U32,
pub e2fs_bpg: U32,
pub e2fs_fpg: U32,
pub e2fs_ipg: U32,
pub e2fs_mtime: U32,
pub e2fs_wtime: U32,
pub e2fs_mnt_count: U16,
pub e2fs_max_mnt_count: U16,
pub e2fs_magic: U16,
pub e2fs_state: U16,
pub e2fs_beh: U16,
pub e2fs_minrev: U16,
pub e2fs_lastfsck: U32,
pub e2fs_fsckintv: U32,
pub e2fs_creator: U32,
pub e2fs_rev: U32,
pub e2fs_ruid: U16,
pub e2fs_rgid: U16,
pub e2fs_first_ino: U32,
pub e2fs_inode_size: U16,
pub e2fs_block_group_nr: U16,
pub e2fs_features_compat: U32,
pub e2fs_features_incompat: U32,
pub e2fs_features_rocompat: U32,
pub e2fs_uuid: [u8; 16],
pub e2fs_vname: [u8; 16],
pub e2fs_fsmnt: [u8; 64],
pub e2fs_algo: U32,
pub e2fs_prealloc: u8,
pub e2fs_dir_prealloc: u8,
pub e2fs_reserved_ngdb: U16,
pub e3fs_journal_uuid: [u8; 16],
pub e3fs_journal_inum: U32,
pub e3fs_journal_dev: U32,
pub e3fs_last_orphan: U32,
pub e3fs_hash_seed: [U32; 4],
pub e3fs_def_hash_version: u8,
pub e3fs_jnl_backup_type: u8,
pub e3fs_desc_size: U16,
pub e3fs_default_mount_opts: U32,
pub e3fs_first_meta_bg: U32,
pub e3fs_mkfs_time: U32,
pub e3fs_jnl_blks: [U32; 17],
pub e4fs_bcount_hi: U32,
pub e4fs_rbcount_hi: U32,
pub e4fs_fbcount_hi: U32,
pub e4fs_min_extra_isize: U16,
pub e4fs_want_extra_isize: U16,
pub e4fs_flags: U32,
pub e4fs_raid_stride: U16,
pub e4fs_mmpintv: U16,
pub e4fs_mmpblk: U64,
pub e4fs_raid_stripe_wid: U32,
pub e4fs_log_gpf: u8,
pub e4fs_chksum_type: u8,
pub e4fs_encrypt: u8,
pub e4fs_reserved_pad: u8,
pub e4fs_kbytes_written: U64,
pub e4fs_snapinum: U32,
pub e4fs_snapid: U32,
pub e4fs_snaprbcount: U64,
pub e4fs_snaplist: U32,
pub e4fs_errcount: U32,
pub e4fs_first_errtime: U32,
pub e4fs_first_errino: U32,
pub e4fs_first_errblk: U64,
pub e4fs_first_errfunc: [u8; 32],
pub e4fs_first_errline: U32,
pub e4fs_last_errtime: U32,
pub e4fs_last_errino: U32,
pub e4fs_last_errline: U32,
pub e4fs_last_errblk: U64,
pub e4fs_last_errfunc: [u8; 32],
pub e4fs_mount_opts: [u8; 64],
pub e4fs_usrquota_inum: U32,
pub e4fs_grpquota_inum: U32,
pub e4fs_overhead_clusters: U32,
pub e4fs_backup_bgs: [U32; 2],
pub e4fs_encrypt_algos: [u8; 4],
pub e4fs_encrypt_pw_salt: [u8; 16],
pub e4fs_lpf_ino: U32,
pub e4fs_proj_quota_inum: U32,
pub e4fs_chksum_seed: U32,
pub e4fs_reserved: [U32; 98],
pub e4fs_sbchksum: U32,
}
Fields§
§e2fs_icount: U32
INode count.
e2fs_bcount: U32
Block count.
e2fs_rbcount: U32
Reserved blocks count.
e2fs_fbcount: U32
Free blocks count.
e2fs_ficount: U32
Free INodes count.
e2fs_first_dblock: U32
First data block.
e2fs_log_bsize: U32
Block Size = 2^(e2fs_log_bsize+10).
e2fs_log_fsize: U32
Fragment size.
e2fs_bpg: U32
Blocks per group.
e2fs_fpg: U32
Fragments per group.
e2fs_ipg: U32
INodes per group.
e2fs_mtime: U32
Mount time.
e2fs_wtime: U32
Write time.
e2fs_mnt_count: U16
Mount count.
e2fs_max_mnt_count: U16
Max mount count.
e2fs_magic: U16
Magic number: 0xEF53
e2fs_state: U16
Filesystem state.
e2fs_beh: U16
Behavior on errors.
e2fs_minrev: U16
Minor revision level.
e2fs_lastfsck: U32
Time of last filesystem check.
e2fs_fsckintv: U32
Max time between filesystem checks.
e2fs_creator: U32
Creator OS.
e2fs_rev: U32
Revision level.
e2fs_ruid: U16
Default UID for reserved blocks.
e2fs_rgid: U16
Default GID for reserved blocks.
e2fs_first_ino: U32
First non-reserved inode.
e2fs_inode_size: U16
Size of INode structure.
e2fs_block_group_nr: U16
Block group number of this super block.
e2fs_features_compat: U32
Compatible feature set.
e2fs_features_incompat: U32
Incompatible feature set.
e2fs_features_rocompat: U32
RO-compatible feature set.
e2fs_uuid: [u8; 16]
128-bit uuid for volume.
e2fs_vname: [u8; 16]
Volume name.
e2fs_fsmnt: [u8; 64]
Name as mounted.
e2fs_algo: U32
Compression algorithm.
e2fs_prealloc: u8
§of blocks for old prealloc.
e2fs_dir_prealloc: u8
§of blocks for old prealloc dirs.
e2fs_reserved_ngdb: U16
§of reserved gd blocks for resize.
e3fs_journal_uuid: [u8; 16]
UUID of journal super block.
e3fs_journal_inum: U32
INode number of journal file.
e3fs_journal_dev: U32
Device number of journal file.
e3fs_last_orphan: U32
Start of list of inodes to delete.
e3fs_hash_seed: [U32; 4]
HTREE hash seed.
e3fs_def_hash_version: u8
Default hash version to use.
e3fs_jnl_backup_type: u8
Journal backup type.
e3fs_desc_size: U16
size of group descriptor.
e3fs_default_mount_opts: U32
Default mount options.
e3fs_first_meta_bg: U32
First metablock block group.
e3fs_mkfs_time: U32
When the filesystem was created.
e3fs_jnl_blks: [U32; 17]
Backup of the journal INode.
e4fs_bcount_hi: U32
High bits of block count.
e4fs_rbcount_hi: U32
High bits of reserved blocks count.
e4fs_fbcount_hi: U32
High bits of free blocks count.
e4fs_min_extra_isize: U16
All inodes have some bytes.
e4fs_want_extra_isize: U16
Inodes must reserve some bytes.
e4fs_flags: U32
Miscellaneous flags.
e4fs_raid_stride: U16
RAID stride.
e4fs_mmpintv: U16
Seconds to wait in MMP checking.
e4fs_mmpblk: U64
Block for multi-mount protection.
e4fs_raid_stripe_wid: U32
Blocks on data disks (N * stride).
e4fs_log_gpf: u8
FLEX_BG group size.
e4fs_chksum_type: u8
Metadata checksum algorithm used.
e4fs_encrypt: u8
Versioning level for encryption.
e4fs_reserved_pad: u8
§e4fs_kbytes_written: U64
Number of lifetime kilobytes.
e4fs_snapinum: U32
INode number of active snapshot.
e4fs_snapid: U32
Sequential ID of active snapshot.
e4fs_snaprbcount: U64
Reserved blocks for active snapshot.
e4fs_snaplist: U32
INode number for on-disk snapshot.
e4fs_errcount: U32
Number of filesystem errors.
e4fs_first_errtime: U32
First time an error happened.
e4fs_first_errino: U32
INode involved in first error.
e4fs_first_errblk: U64
Block involved of first error.
e4fs_first_errfunc: [u8; 32]
Function where error happened.
e4fs_first_errline: U32
Line number where error happened.
e4fs_last_errtime: U32
Most recent time of an error.
e4fs_last_errino: U32
INode involved in last error.
e4fs_last_errline: U32
Line number where error happened.
e4fs_last_errblk: U64
Block involved of last error.
e4fs_last_errfunc: [u8; 32]
Function where error happened.
e4fs_mount_opts: [u8; 64]
Mount options.
e4fs_usrquota_inum: U32
INode for tracking user quota.
e4fs_grpquota_inum: U32
INode for tracking group quota.
e4fs_overhead_clusters: U32
Overhead blocks/clusters.
e4fs_backup_bgs: [U32; 2]
Groups with sparse_super2 SBs.
e4fs_encrypt_algos: [u8; 4]
Encryption algorithms in use.
e4fs_encrypt_pw_salt: [u8; 16]
Salt used for string2key.
e4fs_lpf_ino: U32
Location of the lost+found inode.
e4fs_proj_quota_inum: U32
INode for tracking project quota.
e4fs_chksum_seed: U32
Checksum seed.
e4fs_reserved: [U32; 98]
Padding to the end of the block.
e4fs_sbchksum: U32
Super block checksum.
Implementations§
Source§impl SuperBlock
impl SuperBlock
Sourcepub fn parse(reader: &dyn Reader) -> Result<SuperBlock, ParsingError>
pub fn parse(reader: &dyn Reader) -> Result<SuperBlock, ParsingError>
Parse the Super Block at its default location.
pub fn check_magic(&self) -> Result<(), ParsingError>
pub fn check_inode_size(&self) -> Result<(), ParsingError>
Sourcepub fn block_size(&self) -> Result<u64, ParsingError>
pub fn block_size(&self) -> Result<u64, ParsingError>
Gets file system block size.
Per spec, the only valid block sizes are 1KiB, 2KiB, 4KiB, and 64KiB. We will only permit these values.
Sourcepub fn block_group_descriptor_size(&self) -> usize
pub fn block_group_descriptor_size(&self) -> usize
Returns the size of the block group descriptors
Trait Implementations§
Source§impl FromBytes for SuperBlock
impl FromBytes for SuperBlock
Source§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
&Self
. Read moreSource§fn ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
Source§fn ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
Source§fn ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
fn ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
Source§impl FromZeros for SuperBlock
impl FromZeros for SuperBlock
Source§impl KnownLayout for SuperBlockwhere
LEU32: KnownLayout,
impl KnownLayout for SuperBlockwhere
LEU32: KnownLayout,
Source§type PointerMetadata = <U32<LittleEndian> as KnownLayout>::PointerMetadata
type PointerMetadata = <U32<LittleEndian> as KnownLayout>::PointerMetadata
Self
. Read moreSource§fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
Self
with the given pointer
metadata. Read moreSource§impl TryFromBytes for SuperBlockwhere
U32: TryFromBytes,
U16: TryFromBytes,
[u8; 16]: TryFromBytes,
[u8; 64]: TryFromBytes,
u8: TryFromBytes,
[U32; 4]: TryFromBytes,
[U32; 17]: TryFromBytes,
U64: TryFromBytes,
[u8; 32]: TryFromBytes,
[U32; 2]: TryFromBytes,
[u8; 4]: TryFromBytes,
[U32; 98]: TryFromBytes,
impl TryFromBytes for SuperBlockwhere
U32: TryFromBytes,
U16: TryFromBytes,
[u8; 16]: TryFromBytes,
[u8; 64]: TryFromBytes,
u8: TryFromBytes,
[U32; 4]: TryFromBytes,
[U32; 17]: TryFromBytes,
U64: TryFromBytes,
[u8; 32]: TryFromBytes,
[U32; 2]: TryFromBytes,
[u8; 4]: TryFromBytes,
[U32; 98]: TryFromBytes,
Source§fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
Source§fn try_ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
source
as a &Self
with
a DST length equal to count
. Read moreSource§fn try_ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
source
as a &Self
with
a DST length equal to count
. Read more