cloudinit/vendor/github.com/vtolstov/go-ioctl/ioctl_linux.go
Vasiliy Tolstov 30aa7a9acc use vendoring, build for netbsd/openbsd
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2015-11-09 07:23:54 +00:00

34 lines
672 B
Go

// +build linux
package ioctl
import "unsafe"
// BlkPart send blkpart ioctl to fd
func BlkRRPart(fd uintptr) error {
return IOCTL(fd, IO(0x12, 95), uintptr(0))
}
// BlkPg send blkpg ioctl to fd
func BlkPg(fd, data uintptr) error {
return IOCTL(fd, IO(0x12, 105), data)
return nil
}
type FsTrimRange struct {
Start uint64
Length uint64
MinLength uint64
}
// Fitrim send fitrim ioctl to fd
func Fitrim(fd, data uintptr) error {
r := FsTrimRange{}
return IOCTL(fd, IOWR('X', 121, uintptr(unsafe.Pointer(&r))), data)
}
// Firfreeze send firfreeze ioctl to fd
func Firfreeze(fd, data uintptr) error {
return IOCTL(fd, IOWR('X', 119, uintptr(0)), data)
}