From bfccbb2cb5f6eb25981b8693ba8acc5e885c7cce Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Fri, 23 May 2014 11:40:05 -0600 Subject: 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. --- bolt_linux.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bolt_linux.go') diff --git a/bolt_linux.go b/bolt_linux.go index 351b65a..4351db5 100644 --- a/bolt_linux.go +++ b/bolt_linux.go @@ -5,6 +5,8 @@ import ( "syscall" ) +var odirect = syscall.O_DIRECT + func fdatasync(f *os.File) error { return syscall.Fdatasync(int(f.Fd())) } -- cgit v1.2.3