mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-05-31 11:42:30 +00:00
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.
13 lines
151 B
Go
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()))
|
|
}
|