ext

package
v2.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ext probes extfs filesystems.

Index

Constants

View Source
const (
	EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER = 0x0001
	EXT2_FEATURE_RO_COMPAT_LARGE_FILE   = 0x0002
	EXT2_FEATURE_RO_COMPAT_BTREE_DIR    = 0x0004
	EXT2_FEATURE_INCOMPAT_FILETYPE      = 0x0002
	EXT2_FEATURE_INCOMPAT_META_BG       = 0x0010

	EXT3_FEATURE_INCOMPAT_RECOVER     = 0x0004
	EXT3_FEATURE_COMPAT_HAS_JOURNAL   = 0x0004
	EXT3_FEATURE_INCOMPAT_JOURNAL_DEV = 0x0008

	EXT2_FEATURE_RO_COMPAT_SUPP        = EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER | EXT2_FEATURE_RO_COMPAT_LARGE_FILE | EXT2_FEATURE_RO_COMPAT_BTREE_DIR
	EXT2_FEATURE_INCOMPAT_SUPP         = EXT2_FEATURE_INCOMPAT_FILETYPE | EXT2_FEATURE_INCOMPAT_META_BG
	EXT2_FEATURE_INCOMPAT_UNSUPPORTED  = ^uint32(EXT2_FEATURE_INCOMPAT_SUPP)
	EXT2_FEATURE_RO_COMPAT_UNSUPPORTED = ^uint32(EXT2_FEATURE_RO_COMPAT_SUPP)

	EXT3_FEATURE_RO_COMPAT_SUPP        = EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER | EXT2_FEATURE_RO_COMPAT_LARGE_FILE | EXT2_FEATURE_RO_COMPAT_BTREE_DIR
	EXT3_FEATURE_INCOMPAT_SUPP         = EXT2_FEATURE_INCOMPAT_FILETYPE | EXT3_FEATURE_INCOMPAT_RECOVER | EXT2_FEATURE_INCOMPAT_META_BG
	EXT3_FEATURE_INCOMPAT_UNSUPPORTED  = ^uint32(EXT3_FEATURE_INCOMPAT_SUPP)
	EXT3_FEATURE_RO_COMPAT_UNSUPPORTED = ^uint32(EXT3_FEATURE_RO_COMPAT_SUPP)

	EXT4_FEATURE_RO_COMPAT_METADATA_CSUM = 0x0400
)

Various extfs constants.

View Source
const SUPERBLOCK_SIZE = 1024

SUPERBLOCK_SIZE is the size of the SuperBlock struct.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe2 added in v2.0.6

type Probe2 struct {
	// contains filtered or unexported fields
}

Probe2 for ext2.

func (*Probe2) Magic added in v2.0.6

func (p *Probe2) Magic() []*magic.Magic

Magic returns the magic value for the filesystem.

func (*Probe2) Name added in v2.0.6

func (p *Probe2) Name() string

Name returns the name of the xfs filesystem.

func (*Probe2) Probe added in v2.0.6

func (p *Probe2) Probe(r probe.Reader, _ magic.Magic) (*probe.Result, error)

Probe runs the further inspection and returns the result if successful.

type Probe3 added in v2.0.6

type Probe3 struct {
	// contains filtered or unexported fields
}

Probe3 for ext3.

func (*Probe3) Magic added in v2.0.6

func (p *Probe3) Magic() []*magic.Magic

Magic returns the magic value for the filesystem.

func (*Probe3) Name added in v2.0.6

func (p *Probe3) Name() string

Name returns the name of the xfs filesystem.

func (*Probe3) Probe added in v2.0.6

func (p *Probe3) Probe(r probe.Reader, _ magic.Magic) (*probe.Result, error)

Probe runs the further inspection and returns the result if successful.

type Probe4 added in v2.0.6

type Probe4 struct {
	// contains filtered or unexported fields
}

Probe4 for ext4.

func (*Probe4) Magic added in v2.0.6

func (p *Probe4) Magic() []*magic.Magic

Magic returns the magic value for the filesystem.

func (*Probe4) Name added in v2.0.6

func (p *Probe4) Name() string

Name returns the name of the xfs filesystem.

func (*Probe4) Probe added in v2.0.6

func (p *Probe4) Probe(r probe.Reader, _ magic.Magic) (*probe.Result, error)

Probe runs the further inspection and returns the result if successful.

type SuperBlock

type SuperBlock []byte

SuperBlock is a byte slice representing the superblock.h C header.

func (SuperBlock) BlockSize

func (s SuperBlock) BlockSize() uint32

BlockSize returns the block size of the filesystem.

func (SuperBlock) FilesystemSize

func (s SuperBlock) FilesystemSize() uint64

FilesystemSize returns the size of the filesystem.

func (SuperBlock) Get_s_algorithm_usage_bitmap

func (s SuperBlock) Get_s_algorithm_usage_bitmap() uint32

Get_s_algorithm_usage_bitmap returns s_algorithm_usage_bitmap.

func (SuperBlock) Get_s_block_group_nr

func (s SuperBlock) Get_s_block_group_nr() uint16

Get_s_block_group_nr returns s_block_group_nr.

func (SuperBlock) Get_s_blocks_count

func (s SuperBlock) Get_s_blocks_count() uint32

Get_s_blocks_count returns s_blocks_count.

func (SuperBlock) Get_s_blocks_count_hi

func (s SuperBlock) Get_s_blocks_count_hi() uint32

Get_s_blocks_count_hi returns s_blocks_count_hi.

func (SuperBlock) Get_s_checkinterval

func (s SuperBlock) Get_s_checkinterval() uint32

Get_s_checkinterval returns s_checkinterval.

func (SuperBlock) Get_s_checksum

func (s SuperBlock) Get_s_checksum() uint32

Get_s_checksum returns s_checksum.

func (SuperBlock) Get_s_creator_os

func (s SuperBlock) Get_s_creator_os() uint32

Get_s_creator_os returns s_creator_os.

func (SuperBlock) Get_s_def_hash_version

func (s SuperBlock) Get_s_def_hash_version() byte

Get_s_def_hash_version returns s_def_hash_version.

func (SuperBlock) Get_s_def_resgid

func (s SuperBlock) Get_s_def_resgid() uint16

Get_s_def_resgid returns s_def_resgid.

func (SuperBlock) Get_s_def_resuid

func (s SuperBlock) Get_s_def_resuid() uint16

Get_s_def_resuid returns s_def_resuid.

func (SuperBlock) Get_s_default_mount_opts

func (s SuperBlock) Get_s_default_mount_opts() uint32

Get_s_default_mount_opts returns s_default_mount_opts.

func (SuperBlock) Get_s_errors

func (s SuperBlock) Get_s_errors() uint16

Get_s_errors returns s_errors.

func (SuperBlock) Get_s_feature_compat

func (s SuperBlock) Get_s_feature_compat() uint32

Get_s_feature_compat returns s_feature_compat.

func (SuperBlock) Get_s_feature_incompat

func (s SuperBlock) Get_s_feature_incompat() uint32

Get_s_feature_incompat returns s_feature_incompat.

func (SuperBlock) Get_s_feature_ro_compat

func (s SuperBlock) Get_s_feature_ro_compat() uint32

Get_s_feature_ro_compat returns s_feature_ro_compat.

func (SuperBlock) Get_s_first_data_block

func (s SuperBlock) Get_s_first_data_block() uint32

Get_s_first_data_block returns s_first_data_block.

func (SuperBlock) Get_s_first_ino

func (s SuperBlock) Get_s_first_ino() uint32

Get_s_first_ino returns s_first_ino.

func (SuperBlock) Get_s_first_meta_bg

func (s SuperBlock) Get_s_first_meta_bg() uint32

Get_s_first_meta_bg returns s_first_meta_bg.

func (SuperBlock) Get_s_flags

func (s SuperBlock) Get_s_flags() uint32

Get_s_flags returns s_flags.

func (SuperBlock) Get_s_free_blocks_count

func (s SuperBlock) Get_s_free_blocks_count() uint32

Get_s_free_blocks_count returns s_free_blocks_count.

func (SuperBlock) Get_s_free_blocks_hi

func (s SuperBlock) Get_s_free_blocks_hi() uint32

Get_s_free_blocks_hi returns s_free_blocks_hi.

func (SuperBlock) Get_s_free_inodes_count

func (s SuperBlock) Get_s_free_inodes_count() uint32

Get_s_free_inodes_count returns s_free_inodes_count.

func (SuperBlock) Get_s_inode_size

func (s SuperBlock) Get_s_inode_size() uint16

Get_s_inode_size returns s_inode_size.

func (SuperBlock) Get_s_inodes_count

func (s SuperBlock) Get_s_inodes_count() uint32

Get_s_inodes_count returns s_inodes_count.

func (SuperBlock) Get_s_jnl_backup_type

func (s SuperBlock) Get_s_jnl_backup_type() byte

Get_s_jnl_backup_type returns s_jnl_backup_type.

func (SuperBlock) Get_s_journal_dev

func (s SuperBlock) Get_s_journal_dev() uint32

Get_s_journal_dev returns s_journal_dev.

func (SuperBlock) Get_s_journal_inum

func (s SuperBlock) Get_s_journal_inum() uint32

Get_s_journal_inum returns s_journal_inum.

func (SuperBlock) Get_s_journal_uuid

func (s SuperBlock) Get_s_journal_uuid() []byte

Get_s_journal_uuid returns s_journal_uuid.

func (SuperBlock) Get_s_last_mounted

func (s SuperBlock) Get_s_last_mounted() []byte

Get_s_last_mounted returns s_last_mounted.

func (SuperBlock) Get_s_last_orphan

func (s SuperBlock) Get_s_last_orphan() uint32

Get_s_last_orphan returns s_last_orphan.

func (SuperBlock) Get_s_lastcheck

func (s SuperBlock) Get_s_lastcheck() uint32

Get_s_lastcheck returns s_lastcheck.

func (SuperBlock) Get_s_log_block_size

func (s SuperBlock) Get_s_log_block_size() uint32

Get_s_log_block_size returns s_log_block_size.

func (SuperBlock) Get_s_magic

func (s SuperBlock) Get_s_magic() []byte

Get_s_magic returns s_magic.

func (SuperBlock) Get_s_min_extra_isize

func (s SuperBlock) Get_s_min_extra_isize() uint16

Get_s_min_extra_isize returns s_min_extra_isize.

func (SuperBlock) Get_s_minor_rev_level

func (s SuperBlock) Get_s_minor_rev_level() uint16

Get_s_minor_rev_level returns s_minor_rev_level.

func (SuperBlock) Get_s_mkfs_time

func (s SuperBlock) Get_s_mkfs_time() uint32

Get_s_mkfs_time returns s_mkfs_time.

func (SuperBlock) Get_s_mmp_block

func (s SuperBlock) Get_s_mmp_block() uint64

Get_s_mmp_block returns s_mmp_block.

func (SuperBlock) Get_s_mmp_interval

func (s SuperBlock) Get_s_mmp_interval() uint16

Get_s_mmp_interval returns s_mmp_interval.

func (SuperBlock) Get_s_prealloc_blocks

func (s SuperBlock) Get_s_prealloc_blocks() byte

Get_s_prealloc_blocks returns s_prealloc_blocks.

func (SuperBlock) Get_s_prealloc_dir_blocks

func (s SuperBlock) Get_s_prealloc_dir_blocks() byte

Get_s_prealloc_dir_blocks returns s_prealloc_dir_blocks.

func (SuperBlock) Get_s_r_blocks_count

func (s SuperBlock) Get_s_r_blocks_count() uint32

Get_s_r_blocks_count returns s_r_blocks_count.

func (SuperBlock) Get_s_r_blocks_count_hi

func (s SuperBlock) Get_s_r_blocks_count_hi() uint32

Get_s_r_blocks_count_hi returns s_r_blocks_count_hi.

func (SuperBlock) Get_s_raid_stride

func (s SuperBlock) Get_s_raid_stride() uint16

Get_s_raid_stride returns s_raid_stride.

func (SuperBlock) Get_s_raid_stripe_width

func (s SuperBlock) Get_s_raid_stripe_width() uint32

Get_s_raid_stripe_width returns s_raid_stripe_width.

func (SuperBlock) Get_s_reserved_gdt_blocks

func (s SuperBlock) Get_s_reserved_gdt_blocks() uint16

Get_s_reserved_gdt_blocks returns s_reserved_gdt_blocks.

func (SuperBlock) Get_s_reserved_word_pad

func (s SuperBlock) Get_s_reserved_word_pad() uint16

Get_s_reserved_word_pad returns s_reserved_word_pad.

func (SuperBlock) Get_s_rev_level

func (s SuperBlock) Get_s_rev_level() uint32

Get_s_rev_level returns s_rev_level.

func (SuperBlock) Get_s_state

func (s SuperBlock) Get_s_state() uint16

Get_s_state returns s_state.

func (SuperBlock) Get_s_uuid

func (s SuperBlock) Get_s_uuid() []byte

Get_s_uuid returns s_uuid.

func (SuperBlock) Get_s_volume_name

func (s SuperBlock) Get_s_volume_name() []byte

Get_s_volume_name returns s_volume_name.

func (SuperBlock) Get_s_want_extra_isize

func (s SuperBlock) Get_s_want_extra_isize() uint16

Get_s_want_extra_isize returns s_want_extra_isize.

func (SuperBlock) Put_s_algorithm_usage_bitmap

func (s SuperBlock) Put_s_algorithm_usage_bitmap(v uint32)

Put_s_algorithm_usage_bitmap sets s_algorithm_usage_bitmap.

func (SuperBlock) Put_s_block_group_nr

func (s SuperBlock) Put_s_block_group_nr(v uint16)

Put_s_block_group_nr sets s_block_group_nr.

func (SuperBlock) Put_s_blocks_count

func (s SuperBlock) Put_s_blocks_count(v uint32)

Put_s_blocks_count sets s_blocks_count.

func (SuperBlock) Put_s_blocks_count_hi

func (s SuperBlock) Put_s_blocks_count_hi(v uint32)

Put_s_blocks_count_hi sets s_blocks_count_hi.

func (SuperBlock) Put_s_checkinterval

func (s SuperBlock) Put_s_checkinterval(v uint32)

Put_s_checkinterval sets s_checkinterval.

func (SuperBlock) Put_s_checksum

func (s SuperBlock) Put_s_checksum(v uint32)

Put_s_checksum sets s_checksum.

func (SuperBlock) Put_s_creator_os

func (s SuperBlock) Put_s_creator_os(v uint32)

Put_s_creator_os sets s_creator_os.

func (SuperBlock) Put_s_def_hash_version

func (s SuperBlock) Put_s_def_hash_version(v byte)

Put_s_def_hash_version sets s_def_hash_version.

func (SuperBlock) Put_s_def_resgid

func (s SuperBlock) Put_s_def_resgid(v uint16)

Put_s_def_resgid sets s_def_resgid.

func (SuperBlock) Put_s_def_resuid

func (s SuperBlock) Put_s_def_resuid(v uint16)

Put_s_def_resuid sets s_def_resuid.

func (SuperBlock) Put_s_default_mount_opts

func (s SuperBlock) Put_s_default_mount_opts(v uint32)

Put_s_default_mount_opts sets s_default_mount_opts.

func (SuperBlock) Put_s_errors

func (s SuperBlock) Put_s_errors(v uint16)

Put_s_errors sets s_errors.

func (SuperBlock) Put_s_feature_compat

func (s SuperBlock) Put_s_feature_compat(v uint32)

Put_s_feature_compat sets s_feature_compat.

func (SuperBlock) Put_s_feature_incompat

func (s SuperBlock) Put_s_feature_incompat(v uint32)

Put_s_feature_incompat sets s_feature_incompat.

func (SuperBlock) Put_s_feature_ro_compat

func (s SuperBlock) Put_s_feature_ro_compat(v uint32)

Put_s_feature_ro_compat sets s_feature_ro_compat.

func (SuperBlock) Put_s_first_data_block

func (s SuperBlock) Put_s_first_data_block(v uint32)

Put_s_first_data_block sets s_first_data_block.

func (SuperBlock) Put_s_first_ino

func (s SuperBlock) Put_s_first_ino(v uint32)

Put_s_first_ino sets s_first_ino.

func (SuperBlock) Put_s_first_meta_bg

func (s SuperBlock) Put_s_first_meta_bg(v uint32)

Put_s_first_meta_bg sets s_first_meta_bg.

func (SuperBlock) Put_s_flags

func (s SuperBlock) Put_s_flags(v uint32)

Put_s_flags sets s_flags.

func (SuperBlock) Put_s_free_blocks_count

func (s SuperBlock) Put_s_free_blocks_count(v uint32)

Put_s_free_blocks_count sets s_free_blocks_count.

func (SuperBlock) Put_s_free_blocks_hi

func (s SuperBlock) Put_s_free_blocks_hi(v uint32)

Put_s_free_blocks_hi sets s_free_blocks_hi.

func (SuperBlock) Put_s_free_inodes_count

func (s SuperBlock) Put_s_free_inodes_count(v uint32)

Put_s_free_inodes_count sets s_free_inodes_count.

func (SuperBlock) Put_s_inode_size

func (s SuperBlock) Put_s_inode_size(v uint16)

Put_s_inode_size sets s_inode_size.

func (SuperBlock) Put_s_inodes_count

func (s SuperBlock) Put_s_inodes_count(v uint32)

Put_s_inodes_count sets s_inodes_count.

func (SuperBlock) Put_s_jnl_backup_type

func (s SuperBlock) Put_s_jnl_backup_type(v byte)

Put_s_jnl_backup_type sets s_jnl_backup_type.

func (SuperBlock) Put_s_journal_dev

func (s SuperBlock) Put_s_journal_dev(v uint32)

Put_s_journal_dev sets s_journal_dev.

func (SuperBlock) Put_s_journal_inum

func (s SuperBlock) Put_s_journal_inum(v uint32)

Put_s_journal_inum sets s_journal_inum.

func (SuperBlock) Put_s_journal_uuid

func (s SuperBlock) Put_s_journal_uuid(v []byte)

Put_s_journal_uuid sets s_journal_uuid.

func (SuperBlock) Put_s_last_mounted

func (s SuperBlock) Put_s_last_mounted(v []byte)

Put_s_last_mounted sets s_last_mounted.

func (SuperBlock) Put_s_last_orphan

func (s SuperBlock) Put_s_last_orphan(v uint32)

Put_s_last_orphan sets s_last_orphan.

func (SuperBlock) Put_s_lastcheck

func (s SuperBlock) Put_s_lastcheck(v uint32)

Put_s_lastcheck sets s_lastcheck.

func (SuperBlock) Put_s_log_block_size

func (s SuperBlock) Put_s_log_block_size(v uint32)

Put_s_log_block_size sets s_log_block_size.

func (SuperBlock) Put_s_magic

func (s SuperBlock) Put_s_magic(v []byte)

Put_s_magic sets s_magic.

func (SuperBlock) Put_s_min_extra_isize

func (s SuperBlock) Put_s_min_extra_isize(v uint16)

Put_s_min_extra_isize sets s_min_extra_isize.

func (SuperBlock) Put_s_minor_rev_level

func (s SuperBlock) Put_s_minor_rev_level(v uint16)

Put_s_minor_rev_level sets s_minor_rev_level.

func (SuperBlock) Put_s_mkfs_time

func (s SuperBlock) Put_s_mkfs_time(v uint32)

Put_s_mkfs_time sets s_mkfs_time.

func (SuperBlock) Put_s_mmp_block

func (s SuperBlock) Put_s_mmp_block(v uint64)

Put_s_mmp_block sets s_mmp_block.

func (SuperBlock) Put_s_mmp_interval

func (s SuperBlock) Put_s_mmp_interval(v uint16)

Put_s_mmp_interval sets s_mmp_interval.

func (SuperBlock) Put_s_prealloc_blocks

func (s SuperBlock) Put_s_prealloc_blocks(v byte)

Put_s_prealloc_blocks sets s_prealloc_blocks.

func (SuperBlock) Put_s_prealloc_dir_blocks

func (s SuperBlock) Put_s_prealloc_dir_blocks(v byte)

Put_s_prealloc_dir_blocks sets s_prealloc_dir_blocks.

func (SuperBlock) Put_s_r_blocks_count

func (s SuperBlock) Put_s_r_blocks_count(v uint32)

Put_s_r_blocks_count sets s_r_blocks_count.

func (SuperBlock) Put_s_r_blocks_count_hi

func (s SuperBlock) Put_s_r_blocks_count_hi(v uint32)

Put_s_r_blocks_count_hi sets s_r_blocks_count_hi.

func (SuperBlock) Put_s_raid_stride

func (s SuperBlock) Put_s_raid_stride(v uint16)

Put_s_raid_stride sets s_raid_stride.

func (SuperBlock) Put_s_raid_stripe_width

func (s SuperBlock) Put_s_raid_stripe_width(v uint32)

Put_s_raid_stripe_width sets s_raid_stripe_width.

func (SuperBlock) Put_s_reserved_gdt_blocks

func (s SuperBlock) Put_s_reserved_gdt_blocks(v uint16)

Put_s_reserved_gdt_blocks sets s_reserved_gdt_blocks.

func (SuperBlock) Put_s_reserved_word_pad

func (s SuperBlock) Put_s_reserved_word_pad(v uint16)

Put_s_reserved_word_pad sets s_reserved_word_pad.

func (SuperBlock) Put_s_rev_level

func (s SuperBlock) Put_s_rev_level(v uint32)

Put_s_rev_level sets s_rev_level.

func (SuperBlock) Put_s_state

func (s SuperBlock) Put_s_state(v uint16)

Put_s_state sets s_state.

func (SuperBlock) Put_s_uuid

func (s SuperBlock) Put_s_uuid(v []byte)

Put_s_uuid sets s_uuid.

func (SuperBlock) Put_s_volume_name

func (s SuperBlock) Put_s_volume_name(v []byte)

Put_s_volume_name sets s_volume_name.

func (SuperBlock) Put_s_want_extra_isize

func (s SuperBlock) Put_s_want_extra_isize(v uint16)

Put_s_want_extra_isize sets s_want_extra_isize.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL