From d97579c39936dad5028a38ce05e4700bf91f82b2 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Sun, 8 Nov 2015 17:30:52 -0800 Subject: Add MmapFlags option for MAP_POPULATE (unix) This adds MmapFlags to DB.Options in case we need syscall.MAP_POPULATE flag in Linux 2.6.23+ to do the sequential read-ahead, as discussed in [1]. --- [1]: https://github.com/coreos/etcd/issues/3786 --- bolt_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bolt_unix.go') diff --git a/bolt_unix.go b/bolt_unix.go index 6eef6b2..251680b 100644 --- a/bolt_unix.go +++ b/bolt_unix.go @@ -58,7 +58,7 @@ func mmap(db *DB, sz int) error { } // Map the data file to memory. - b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED) + b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) if err != nil { return err } -- cgit v1.2.3