diff options
| author | Ben Johnson <benbjohnson@yahoo.com> | 2014-05-23 11:40:05 -0600 |
|---|---|---|
| committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-05-23 11:40:05 -0600 |
| commit | bfccbb2cb5f6eb25981b8693ba8acc5e885c7cce (patch) | |
| tree | 4aa0e72ebbcef5018fd77dc1e9e4d66f2fd6da41 /tx.go | |
| parent | Merge pull request #169 from benbjohnson/allocation (diff) | |
| download | dedo-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 'tx.go')
| -rw-r--r-- | tx.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -240,7 +240,7 @@ func (tx *Tx) close() { // Copy will write exactly tx.Size() bytes into the writer. func (tx *Tx) Copy(w io.Writer) error { // Open reader on the database. - f, err := os.Open(tx.db.path) + f, err := os.OpenFile(tx.db.path, os.O_RDONLY|odirect, 0) if err != nil { _ = tx.Rollback() return err |
