#[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: U32INode count.
e2fs_bcount: U32Block count.
e2fs_rbcount: U32Reserved blocks count.
e2fs_fbcount: U32Free blocks count.
e2fs_ficount: U32Free INodes count.
e2fs_first_dblock: U32First data block.
e2fs_log_bsize: U32Block Size = 2^(e2fs_log_bsize+10).
e2fs_log_fsize: U32Fragment size.
e2fs_bpg: U32Blocks per group.
e2fs_fpg: U32Fragments per group.
e2fs_ipg: U32INodes per group.
e2fs_mtime: U32Mount time.
e2fs_wtime: U32Write time.
e2fs_mnt_count: U16Mount count.
e2fs_max_mnt_count: U16Max mount count.
e2fs_magic: U16Magic number: 0xEF53
e2fs_state: U16Filesystem state.
e2fs_beh: U16Behavior on errors.
e2fs_minrev: U16Minor revision level.
e2fs_lastfsck: U32Time of last filesystem check.
e2fs_fsckintv: U32Max time between filesystem checks.
e2fs_creator: U32Creator OS.
e2fs_rev: U32Revision level.
e2fs_ruid: U16Default UID for reserved blocks.
e2fs_rgid: U16Default GID for reserved blocks.
e2fs_first_ino: U32First non-reserved inode.
e2fs_inode_size: U16Size of INode structure.
e2fs_block_group_nr: U16Block group number of this super block.
e2fs_features_compat: U32Compatible feature set.
e2fs_features_incompat: U32Incompatible feature set.
e2fs_features_rocompat: U32RO-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: U32Compression 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: U32INode number of journal file.
e3fs_journal_dev: U32Device number of journal file.
e3fs_last_orphan: U32Start of list of inodes to delete.
e3fs_hash_seed: [U32; 4]HTREE hash seed.
e3fs_def_hash_version: u8Default hash version to use.
e3fs_jnl_backup_type: u8Journal backup type.
e3fs_desc_size: U16size of group descriptor.
e3fs_default_mount_opts: U32Default mount options.
e3fs_first_meta_bg: U32First metablock block group.
e3fs_mkfs_time: U32When the filesystem was created.
e3fs_jnl_blks: [U32; 17]Backup of the journal INode.
e4fs_bcount_hi: U32High bits of block count.
e4fs_rbcount_hi: U32High bits of reserved blocks count.
e4fs_fbcount_hi: U32High bits of free blocks count.
e4fs_min_extra_isize: U16All inodes have some bytes.
e4fs_want_extra_isize: U16Inodes must reserve some bytes.
e4fs_flags: U32Miscellaneous flags.
e4fs_raid_stride: U16RAID stride.
e4fs_mmpintv: U16Seconds to wait in MMP checking.
e4fs_mmpblk: U64Block for multi-mount protection.
e4fs_raid_stripe_wid: U32Blocks on data disks (N * stride).
e4fs_log_gpf: u8FLEX_BG group size.
e4fs_chksum_type: u8Metadata checksum algorithm used.
e4fs_encrypt: u8Versioning level for encryption.
e4fs_reserved_pad: u8§e4fs_kbytes_written: U64Number of lifetime kilobytes.
e4fs_snapinum: U32INode number of active snapshot.
e4fs_snapid: U32Sequential ID of active snapshot.
e4fs_snaprbcount: U64Reserved blocks for active snapshot.
e4fs_snaplist: U32INode number for on-disk snapshot.
e4fs_errcount: U32Number of filesystem errors.
e4fs_first_errtime: U32First time an error happened.
e4fs_first_errino: U32INode involved in first error.
e4fs_first_errblk: U64Block involved of first error.
e4fs_first_errfunc: [u8; 32]Function where error happened.
e4fs_first_errline: U32Line number where error happened.
e4fs_last_errtime: U32Most recent time of an error.
e4fs_last_errino: U32INode involved in last error.
e4fs_last_errline: U32Line number where error happened.
e4fs_last_errblk: U64Block involved of last error.
e4fs_last_errfunc: [u8; 32]Function where error happened.
e4fs_mount_opts: [u8; 64]Mount options.
e4fs_usrquota_inum: U32INode for tracking user quota.
e4fs_grpquota_inum: U32INode for tracking group quota.
e4fs_overhead_clusters: U32Overhead 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: U32Location of the lost+found inode.
e4fs_proj_quota_inum: U32INode for tracking project quota.
e4fs_chksum_seed: U32Checksum seed.
e4fs_reserved: [U32; 98]Padding to the end of the block.
e4fs_sbchksum: U32Super 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 Debug for SuperBlock
impl Debug for SuperBlock
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§fn new_zeroed() -> Selfwhere
Self: Sized,
fn new_zeroed() -> Selfwhere
Self: Sized,
Self from zeroed bytes. Read moreSource§fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
Box<Self> from zeroed bytes. Read moreSource§fn new_box_zeroed_with_elems(count: usize) -> Result<Box<Self>, AllocError>where
Self: KnownLayout<PointerMetadata = usize>,
fn new_box_zeroed_with_elems(count: usize) -> Result<Box<Self>, AllocError>where
Self: KnownLayout<PointerMetadata = usize>,
Box<[Self]> (a boxed slice) from zeroed bytes. Read moreSource§fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
Vec<Self> from zeroed bytes. Read moreSource§fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
Vec<Self> by pushing additional new items onto the end of
the vector. The new items are initialized with zeros.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
LEU32: TryFromBytes,
LEU16: TryFromBytes,
[u8; 16]: TryFromBytes,
[u8; 64]: TryFromBytes,
u8: TryFromBytes,
[LEU32; 4]: TryFromBytes,
[LEU32; 17]: TryFromBytes,
LEU64: TryFromBytes,
[u8; 32]: TryFromBytes,
[LEU32; 2]: TryFromBytes,
[u8; 4]: TryFromBytes,
[LEU32; 98]: TryFromBytes,
impl TryFromBytes for SuperBlockwhere
LEU32: TryFromBytes,
LEU16: TryFromBytes,
[u8; 16]: TryFromBytes,
[u8; 64]: TryFromBytes,
u8: TryFromBytes,
[LEU32; 4]: TryFromBytes,
[LEU32; 17]: TryFromBytes,
LEU64: TryFromBytes,
[u8; 32]: TryFromBytes,
[LEU32; 2]: TryFromBytes,
[u8; 4]: TryFromBytes,
[LEU32; 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 moreSource§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl Immutable for SuperBlock
impl Unaligned for SuperBlock
Auto Trait Implementations§
impl Freeze for SuperBlock
impl RefUnwindSafe for SuperBlock
impl Send for SuperBlock
impl Sync for SuperBlock
impl Unpin for SuperBlock
impl UnsafeUnpin for SuperBlock
impl UnwindSafe for SuperBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more