xfs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FSTypeXFS = "xfs"

Variables

View Source
var ErrNotXFS = errors.New("Not a xfs partition")
View Source
var XFSMagicNum = uint32(0x58465342)

Functions

This section is empty.

Types

type XFSQuota

type XFSQuota struct {
	Path      string
	ProjectID string
}

func (*XFSQuota) GetVolumeStats

func (xfsq *XFSQuota) GetVolumeStats(ctx context.Context) (XFSVolumeStats, error)

GetVolumeStats - Reads the xfs_quota report

func (*XFSQuota) SetQuota

func (xfsq *XFSQuota) SetQuota(ctx context.Context, limit int64) error

SetQuota creates a projectID and sets the hardlimit for the path

type XFSSuperBlock

type XFSSuperBlock struct {
	MagicNumber         uint32
	BlockSize           uint32
	TotalBlocks         uint64
	RBlocks             uint64
	RExtents            uint64
	UUID                [16]byte
	FirstBlock          uint64
	RootInode           uint64
	ExtentsBitmapInode  uint64
	BitmapSummaryInode  uint64
	ExtentSize          uint32
	AGSize              uint32
	AGCount             uint32
	BitmapBlocks        uint32
	JournalBlocks       uint32
	FilesystemVersion   uint16
	SectorSize          uint16
	InodeSize           uint16
	Inodes              uint16
	FilesystemName      [12]byte
	LogBlockSize        uint8
	LogSectorSize       uint8
	LogInodeSize        uint8
	LogInodeOrBlockSize uint8
	LogAGSize           uint8
	LogExtents          uint8
	InProgress          uint8
	MaxInodePercentage  uint8
	AllocatedInodes     uint64
	FreeInodes          uint64
	FreeBlocks          uint64
	FreeExtents         uint64
}

func (XFSSuperBlock) Is

func (x XFSSuperBlock) Is() bool

type XFSVolumeStats

type XFSVolumeStats struct {
	AvailableBytes int64
	TotalBytes     int64
	UsedBytes      int64
}

func ParseQuotaList

func ParseQuotaList(output, projectID string) (XFSVolumeStats, error)

ParseQuotaList - Parses the quota output and extracts the volume stats

Jump to

Keyboard shortcuts

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