VictoriaMetrics/app/vmselect/netstorage/fadvise_freebsd.go

16 lines
373 B
Go
Raw Normal View History

2019-08-27 22:04:44 +00:00
package netstorage
import (
"os"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
"golang.org/x/sys/unix"
)
func mustFadviseSequentialRead(f *os.File) {
2019-08-27 22:04:44 +00:00
fd := int(f.Fd())
if err := unix.Fadvise(int(fd), 0, 0, unix.FADV_SEQUENTIAL|unix.FADV_WILLNEED); err != nil {
logger.Panicf("FATAL: error returned from unix.Fadvise(SEQUENTIAL|WILLNEED): %s", err)
2019-08-27 22:04:44 +00:00
}
}