aboutsummaryrefslogtreecommitdiff
path: root/bolt.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-05-23 11:40:05 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-05-23 11:40:05 -0600
commitbfccbb2cb5f6eb25981b8693ba8acc5e885c7cce (patch)
tree4aa0e72ebbcef5018fd77dc1e9e4d66f2fd6da41 /bolt.go
parentMerge pull request #169 from benbjohnson/allocation (diff)
downloaddedo-bfccbb2cb5f6eb25981b8693ba8acc5e885c7cce.tar.gz
dedo-bfccbb2cb5f6eb25981b8693ba8acc5e885c7cce.tar.xz
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.
Diffstat (limited to 'bolt.go')
-rw-r--r--bolt.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/bolt.go b/bolt.go
index c3a1bb5..a3f1eac 100644
--- a/bolt.go
+++ b/bolt.go
@@ -2,7 +2,11 @@
package bolt
-import "os"
+import (
+ "os"
+)
+
+var odirect int
func fdatasync(f *os.File) error {
return f.Sync()