bbolt/bolt_linux.go
Ben Johnson bfccbb2cb5 Avoid trashing page cache on Tx.Copy().
This commit change the database copy to use O_DIRECT so that the Linux page
cache is not trashed during a backup. This is only available on Linux.
2014-05-23 11:40:05 -06:00

13 lines
151 B
Go

package bolt
import (
"os"
"syscall"
)
var odirect = syscall.O_DIRECT
func fdatasync(f *os.File) error {
return syscall.Fdatasync(int(f.Fd()))
}