disk

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignedBlock

func AlignedBlock(BlockSize int) []byte

AlignedBlock - pass through to directio implementation.

func DisableDirectIO

func DisableDirectIO(f *os.File) error

DisableDirectIO - disables directio mode.

func FadviseDontNeed

func FadviseDontNeed(f *os.File) error

FadviseDontNeed is a no-op

func Fdatasync

func Fdatasync(f *os.File) error

Fdatasync is fsync on freebsd/darwin

func GetHealthInfo

func GetHealthInfo(ctx context.Context, drive, fsPath string) (madmin.DiskLatency, madmin.DiskThroughput, error)

GetHealthInfo about the drive

func IsRootDisk

func IsRootDisk(diskPath string, rootDisk string) (bool, error)

IsRootDisk returns if diskPath belongs to root-disk, i.e the disk mounted at "/"

func OpenFileDirectIO

func OpenFileDirectIO(filePath string, flag int, perm os.FileMode) (*os.File, error)

OpenFileDirectIO - bypass kernel cache.

func SameDisk

func SameDisk(disk1, disk2 string) (bool, error)

SameDisk reports whether di1 and di2 describe the same disk.

Types

type Info

type Info struct {
	Total  uint64
	Free   uint64
	Used   uint64
	Files  uint64
	Ffree  uint64
	FSType string
}

Info stat fs struct is container which holds following values Total - total size of the volume / disk Free - free size of the volume / disk Files - total inodes available Ffree - free inodes available FSType - file system type

func GetInfo

func GetInfo(path string) (info Info, err error)

GetInfo returns total and free bytes available in a directory, e.g. `/`.

Jump to

Keyboard shortcuts

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