xfs

package
v2.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package xfs probes XFS filesystems.

Index

Constants

View Source
const (
	XFS_MIN_BLOCKSIZE_LOG  = 9  /* i.e. 512 bytes */
	XFS_MAX_BLOCKSIZE_LOG  = 16 /* i.e. 65536 bytes */
	XFS_MIN_BLOCKSIZE      = (1 << XFS_MIN_BLOCKSIZE_LOG)
	XFS_MAX_BLOCKSIZE      = (1 << XFS_MAX_BLOCKSIZE_LOG)
	XFS_MIN_SECTORSIZE_LOG = 9  /* i.e. 512 bytes */
	XFS_MAX_SECTORSIZE_LOG = 15 /* i.e. 32768 bytes */
	XFS_MIN_SECTORSIZE     = (1 << XFS_MIN_SECTORSIZE_LOG)
	XFS_MAX_SECTORSIZE     = (1 << XFS_MAX_SECTORSIZE_LOG)

	XFS_DINODE_MIN_LOG  = 8
	XFS_DINODE_MAX_LOG  = 11
	XFS_DINODE_MIN_SIZE = (1 << XFS_DINODE_MIN_LOG)
	XFS_DINODE_MAX_SIZE = (1 << XFS_DINODE_MAX_LOG)

	XFS_MAX_RTEXTSIZE = (1024 * 1024 * 1024) /* 1GB */
	XFS_DFL_RTEXTSIZE = (64 * 1024)          /* 64kB */
	XFS_MIN_RTEXTSIZE = (4 * 1024)           /* 4kB */

	XFS_MIN_AG_BLOCKS = 64
)

XFS superblock structure constants.

View Source
const SUPERBLOCK_SIZE = 208

SUPERBLOCK_SIZE is the size of the SuperBlock struct.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

type Probe struct{}

Probe for the filesystem.

func (*Probe) Magic

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

Magic returns the magic value for the filesystem.

func (*Probe) Name

func (p *Probe) Name() string

Name returns the name of the filesystem.

func (*Probe) Probe

func (p *Probe) 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) FilesystemSize

func (s SuperBlock) FilesystemSize() uint64

FilesystemSize returns the size of the filesystem in bytes.

func (SuperBlock) Get_sb_agblklog

func (s SuperBlock) Get_sb_agblklog() byte

Get_sb_agblklog returns log2 of sb_agblocks (rounded up).

func (SuperBlock) Get_sb_agblocks

func (s SuperBlock) Get_sb_agblocks() uint32

Get_sb_agblocks returns size of an allocation group.

func (SuperBlock) Get_sb_agcount

func (s SuperBlock) Get_sb_agcount() uint32

Get_sb_agcount returns number of allocation groups.

func (SuperBlock) Get_sb_bad_features2

func (s SuperBlock) Get_sb_bad_features2() uint32

Get_sb_bad_features2 returns mirror of sb_features2.

func (SuperBlock) Get_sb_blocklog

func (s SuperBlock) Get_sb_blocklog() byte

Get_sb_blocklog returns log2 of sb_blocksize.

func (SuperBlock) Get_sb_blocksize

func (s SuperBlock) Get_sb_blocksize() uint32

Get_sb_blocksize returns logical block size, bytes.

func (SuperBlock) Get_sb_dblocks

func (s SuperBlock) Get_sb_dblocks() uint64

Get_sb_dblocks returns number of data blocks.

func (SuperBlock) Get_sb_dirblklog

func (s SuperBlock) Get_sb_dirblklog() byte

Get_sb_dirblklog returns directory block allocation granularity.

func (SuperBlock) Get_sb_fdblocks

func (s SuperBlock) Get_sb_fdblocks() uint64

Get_sb_fdblocks returns free data blocks.

func (SuperBlock) Get_sb_features2

func (s SuperBlock) Get_sb_features2() uint32

Get_sb_features2 returns additional version flags.

func (SuperBlock) Get_sb_flags

func (s SuperBlock) Get_sb_flags() byte

Get_sb_flags returns misc flags.

func (SuperBlock) Get_sb_fname

func (s SuperBlock) Get_sb_fname() []byte

Get_sb_fname returns file system name.

func (SuperBlock) Get_sb_frextents

func (s SuperBlock) Get_sb_frextents() uint64

Get_sb_frextents returns free realtime extents.

func (SuperBlock) Get_sb_gquotino

func (s SuperBlock) Get_sb_gquotino() uint64

Get_sb_gquotino returns inode for group or project quotas.

func (SuperBlock) Get_sb_icount

func (s SuperBlock) Get_sb_icount() uint64

Get_sb_icount returns allocated inodes.

func (SuperBlock) Get_sb_ifree

func (s SuperBlock) Get_sb_ifree() uint64

Get_sb_ifree returns free inodes.

func (SuperBlock) Get_sb_imax_pct

func (s SuperBlock) Get_sb_imax_pct() byte

Get_sb_imax_pct returns max % of fs for inode space.

func (SuperBlock) Get_sb_inoalignmt

func (s SuperBlock) Get_sb_inoalignmt() uint32

Get_sb_inoalignmt returns inode alignment.

func (SuperBlock) Get_sb_inodelog

func (s SuperBlock) Get_sb_inodelog() byte

Get_sb_inodelog returns log2 of sb_inodesize.

func (SuperBlock) Get_sb_inodesize

func (s SuperBlock) Get_sb_inodesize() uint16

Get_sb_inodesize returns inode size, bytes.

func (SuperBlock) Get_sb_inopblock

func (s SuperBlock) Get_sb_inopblock() uint16

Get_sb_inopblock returns inodes per block.

func (SuperBlock) Get_sb_inopblog

func (s SuperBlock) Get_sb_inopblog() byte

Get_sb_inopblog returns log2 of sb_inopblock.

func (SuperBlock) Get_sb_inprogress

func (s SuperBlock) Get_sb_inprogress() byte

Get_sb_inprogress returns mkfs is in progress, don't mount.

func (SuperBlock) Get_sb_logblocks

func (s SuperBlock) Get_sb_logblocks() uint32

Get_sb_logblocks returns number of log blocks.

func (SuperBlock) Get_sb_logsectlog

func (s SuperBlock) Get_sb_logsectlog() byte

Get_sb_logsectlog returns log sector sector size.

func (SuperBlock) Get_sb_logsectsize

func (s SuperBlock) Get_sb_logsectsize() uint16

Get_sb_logsectsize returns log sector size.

func (SuperBlock) Get_sb_logstart

func (s SuperBlock) Get_sb_logstart() uint64

Get_sb_logstart returns starting block of log if internal.

func (SuperBlock) Get_sb_logsunit

func (s SuperBlock) Get_sb_logsunit() uint32

Get_sb_logsunit returns log device stripe or raid unit.

func (SuperBlock) Get_sb_magicnum

func (s SuperBlock) Get_sb_magicnum() uint32

Get_sb_magicnum returns magic number == XFS_SB_MAGIC.

func (SuperBlock) Get_sb_qflags

func (s SuperBlock) Get_sb_qflags() uint16

Get_sb_qflags returns quota flags.

func (SuperBlock) Get_sb_rblocks

func (s SuperBlock) Get_sb_rblocks() uint64

Get_sb_rblocks returns number of realtime blocks.

func (SuperBlock) Get_sb_rbmblocks

func (s SuperBlock) Get_sb_rbmblocks() uint32

Get_sb_rbmblocks returns number of rt bitmap blocks.

func (SuperBlock) Get_sb_rbmino

func (s SuperBlock) Get_sb_rbmino() uint64

Get_sb_rbmino returns bitmap inode for realtime extents.

func (SuperBlock) Get_sb_rextents

func (s SuperBlock) Get_sb_rextents() uint64

Get_sb_rextents returns number of realtime extents.

func (SuperBlock) Get_sb_rextsize

func (s SuperBlock) Get_sb_rextsize() uint32

Get_sb_rextsize returns realtime extent size, blocks.

func (SuperBlock) Get_sb_rextslog

func (s SuperBlock) Get_sb_rextslog() byte

Get_sb_rextslog returns log2 of sb_rextents.

func (SuperBlock) Get_sb_rootino

func (s SuperBlock) Get_sb_rootino() uint64

Get_sb_rootino returns root inode number.

func (SuperBlock) Get_sb_rsumino

func (s SuperBlock) Get_sb_rsumino() uint64

Get_sb_rsumino returns summary inode for rt bitmap.

func (SuperBlock) Get_sb_sectlog

func (s SuperBlock) Get_sb_sectlog() byte

Get_sb_sectlog returns log2 of sb_sectsize.

func (SuperBlock) Get_sb_sectsize

func (s SuperBlock) Get_sb_sectsize() uint16

Get_sb_sectsize returns volume sector size, bytes.

func (SuperBlock) Get_sb_shared_vn

func (s SuperBlock) Get_sb_shared_vn() byte

Get_sb_shared_vn returns reserved, zeroed.

func (SuperBlock) Get_sb_unit

func (s SuperBlock) Get_sb_unit() uint32

Get_sb_unit returns stripe or raid unit.

func (SuperBlock) Get_sb_uquotino

func (s SuperBlock) Get_sb_uquotino() uint64

Get_sb_uquotino returns inode for user quotas.

func (SuperBlock) Get_sb_uuid

func (s SuperBlock) Get_sb_uuid() []byte

Get_sb_uuid returns file system unique id.

func (SuperBlock) Get_sb_versionnum

func (s SuperBlock) Get_sb_versionnum() uint16

Get_sb_versionnum returns header version == XFS_SB_VERSION.

func (SuperBlock) Get_sb_width

func (s SuperBlock) Get_sb_width() uint32

Get_sb_width returns stripe or raid width.

func (SuperBlock) Put_sb_agblklog

func (s SuperBlock) Put_sb_agblklog(v byte)

Put_sb_agblklog sets log2 of sb_agblocks (rounded up).

func (SuperBlock) Put_sb_agblocks

func (s SuperBlock) Put_sb_agblocks(v uint32)

Put_sb_agblocks sets size of an allocation group.

func (SuperBlock) Put_sb_agcount

func (s SuperBlock) Put_sb_agcount(v uint32)

Put_sb_agcount sets number of allocation groups.

func (SuperBlock) Put_sb_bad_features2

func (s SuperBlock) Put_sb_bad_features2(v uint32)

Put_sb_bad_features2 sets mirror of sb_features2.

func (SuperBlock) Put_sb_blocklog

func (s SuperBlock) Put_sb_blocklog(v byte)

Put_sb_blocklog sets log2 of sb_blocksize.

func (SuperBlock) Put_sb_blocksize

func (s SuperBlock) Put_sb_blocksize(v uint32)

Put_sb_blocksize sets logical block size, bytes.

func (SuperBlock) Put_sb_dblocks

func (s SuperBlock) Put_sb_dblocks(v uint64)

Put_sb_dblocks sets number of data blocks.

func (SuperBlock) Put_sb_dirblklog

func (s SuperBlock) Put_sb_dirblklog(v byte)

Put_sb_dirblklog sets directory block allocation granularity.

func (SuperBlock) Put_sb_fdblocks

func (s SuperBlock) Put_sb_fdblocks(v uint64)

Put_sb_fdblocks sets free data blocks.

func (SuperBlock) Put_sb_features2

func (s SuperBlock) Put_sb_features2(v uint32)

Put_sb_features2 sets additional version flags.

func (SuperBlock) Put_sb_flags

func (s SuperBlock) Put_sb_flags(v byte)

Put_sb_flags sets misc flags.

func (SuperBlock) Put_sb_fname

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

Put_sb_fname sets file system name.

func (SuperBlock) Put_sb_frextents

func (s SuperBlock) Put_sb_frextents(v uint64)

Put_sb_frextents sets free realtime extents.

func (SuperBlock) Put_sb_gquotino

func (s SuperBlock) Put_sb_gquotino(v uint64)

Put_sb_gquotino sets inode for group or project quotas.

func (SuperBlock) Put_sb_icount

func (s SuperBlock) Put_sb_icount(v uint64)

Put_sb_icount sets allocated inodes.

func (SuperBlock) Put_sb_ifree

func (s SuperBlock) Put_sb_ifree(v uint64)

Put_sb_ifree sets free inodes.

func (SuperBlock) Put_sb_imax_pct

func (s SuperBlock) Put_sb_imax_pct(v byte)

Put_sb_imax_pct sets max % of fs for inode space.

func (SuperBlock) Put_sb_inoalignmt

func (s SuperBlock) Put_sb_inoalignmt(v uint32)

Put_sb_inoalignmt sets inode alignment.

func (SuperBlock) Put_sb_inodelog

func (s SuperBlock) Put_sb_inodelog(v byte)

Put_sb_inodelog sets log2 of sb_inodesize.

func (SuperBlock) Put_sb_inodesize

func (s SuperBlock) Put_sb_inodesize(v uint16)

Put_sb_inodesize sets inode size, bytes.

func (SuperBlock) Put_sb_inopblock

func (s SuperBlock) Put_sb_inopblock(v uint16)

Put_sb_inopblock sets inodes per block.

func (SuperBlock) Put_sb_inopblog

func (s SuperBlock) Put_sb_inopblog(v byte)

Put_sb_inopblog sets log2 of sb_inopblock.

func (SuperBlock) Put_sb_inprogress

func (s SuperBlock) Put_sb_inprogress(v byte)

Put_sb_inprogress sets mkfs is in progress, don't mount.

func (SuperBlock) Put_sb_logblocks

func (s SuperBlock) Put_sb_logblocks(v uint32)

Put_sb_logblocks sets number of log blocks.

func (SuperBlock) Put_sb_logsectlog

func (s SuperBlock) Put_sb_logsectlog(v byte)

Put_sb_logsectlog sets log sector sector size.

func (SuperBlock) Put_sb_logsectsize

func (s SuperBlock) Put_sb_logsectsize(v uint16)

Put_sb_logsectsize sets log sector size.

func (SuperBlock) Put_sb_logstart

func (s SuperBlock) Put_sb_logstart(v uint64)

Put_sb_logstart sets starting block of log if internal.

func (SuperBlock) Put_sb_logsunit

func (s SuperBlock) Put_sb_logsunit(v uint32)

Put_sb_logsunit sets log device stripe or raid unit.

func (SuperBlock) Put_sb_magicnum

func (s SuperBlock) Put_sb_magicnum(v uint32)

Put_sb_magicnum sets magic number == XFS_SB_MAGIC.

func (SuperBlock) Put_sb_qflags

func (s SuperBlock) Put_sb_qflags(v uint16)

Put_sb_qflags sets quota flags.

func (SuperBlock) Put_sb_rblocks

func (s SuperBlock) Put_sb_rblocks(v uint64)

Put_sb_rblocks sets number of realtime blocks.

func (SuperBlock) Put_sb_rbmblocks

func (s SuperBlock) Put_sb_rbmblocks(v uint32)

Put_sb_rbmblocks sets number of rt bitmap blocks.

func (SuperBlock) Put_sb_rbmino

func (s SuperBlock) Put_sb_rbmino(v uint64)

Put_sb_rbmino sets bitmap inode for realtime extents.

func (SuperBlock) Put_sb_rextents

func (s SuperBlock) Put_sb_rextents(v uint64)

Put_sb_rextents sets number of realtime extents.

func (SuperBlock) Put_sb_rextsize

func (s SuperBlock) Put_sb_rextsize(v uint32)

Put_sb_rextsize sets realtime extent size, blocks.

func (SuperBlock) Put_sb_rextslog

func (s SuperBlock) Put_sb_rextslog(v byte)

Put_sb_rextslog sets log2 of sb_rextents.

func (SuperBlock) Put_sb_rootino

func (s SuperBlock) Put_sb_rootino(v uint64)

Put_sb_rootino sets root inode number.

func (SuperBlock) Put_sb_rsumino

func (s SuperBlock) Put_sb_rsumino(v uint64)

Put_sb_rsumino sets summary inode for rt bitmap.

func (SuperBlock) Put_sb_sectlog

func (s SuperBlock) Put_sb_sectlog(v byte)

Put_sb_sectlog sets log2 of sb_sectsize.

func (SuperBlock) Put_sb_sectsize

func (s SuperBlock) Put_sb_sectsize(v uint16)

Put_sb_sectsize sets volume sector size, bytes.

func (SuperBlock) Put_sb_shared_vn

func (s SuperBlock) Put_sb_shared_vn(v byte)

Put_sb_shared_vn sets reserved, zeroed.

func (SuperBlock) Put_sb_unit

func (s SuperBlock) Put_sb_unit(v uint32)

Put_sb_unit sets stripe or raid unit.

func (SuperBlock) Put_sb_uquotino

func (s SuperBlock) Put_sb_uquotino(v uint64)

Put_sb_uquotino sets inode for user quotas.

func (SuperBlock) Put_sb_uuid

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

Put_sb_uuid sets file system unique id.

func (SuperBlock) Put_sb_versionnum

func (s SuperBlock) Put_sb_versionnum(v uint16)

Put_sb_versionnum sets header version == XFS_SB_VERSION.

func (SuperBlock) Put_sb_width

func (s SuperBlock) Put_sb_width(v uint32)

Put_sb_width sets stripe or raid width.

func (SuperBlock) Valid

func (s SuperBlock) Valid() bool

Valid returns true if the superblock is valid.

Jump to

Keyboard shortcuts

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