sys

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FALLOC_FL_DEFAULT    = uint32(0x0) /* default is extend size */
	FALLOC_FL_KEEP_SIZE  = uint32(C.FALLOC_FL_KEEP_SIZE)
	FALLOC_FL_PUNCH_HOLE = uint32(C.FALLOC_FL_PUNCH_HOLE)
)

Variables

View Source
var (
	ErrDiskNotFound = errors.New("sys: disk not found")
	ErrPathInvalid  = errors.New("sys: path invalid")
)

Functions

func Fallocate

func Fallocate(fd uintptr, mode uint32, off int64, size int64) error

func Fstat

func Fstat(fd uintptr, stat *syscall.Stat_t) error

func IsMountPoint

func IsMountPoint(path string) bool

func PreAllocate

func PreAllocate(fd uintptr, offset int64, size int64) error

pre allocate phy space, and scale size

func PunchHole

func PunchHole(fd uintptr, offset int64, size int64) error

punch hole physize, and keep size

Types

type DiskInfo

type DiskInfo struct {
	Total  uint64 // total size of the disk
	Free   uint64 // free size of the disk
	Files  uint64 // total inodes available
	Ffree  uint64 // free inodes available
	FSType string // file system type
}

func GetDiskInfo

func GetDiskInfo(diskPath string) (di DiskInfo, err error)

func GetInfo

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

Jump to

Keyboard shortcuts

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