diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2016-01-11 15:42:16 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2016-01-11 15:42:16 -0700 |
commit | d8b06c0a7706affa05b729523827ebe9ba3d9def (patch) | |
tree | 721e66a191a587a3177e1880e48def6e475c88d3 /bolt_unix.go | |
parent | Merge pull request #479 from azazeal/master (diff) | |
parent | add AllocSize, minor grow() refactor (diff) | |
download | dedo-d8b06c0a7706affa05b729523827ebe9ba3d9def.tar.gz dedo-d8b06c0a7706affa05b729523827ebe9ba3d9def.tar.xz |
Merge branch 'xiang90-grow'
Diffstat (limited to 'bolt_unix.go')
-rw-r--r-- | bolt_unix.go | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/bolt_unix.go b/bolt_unix.go index 251680b..4b0723a 100644 --- a/bolt_unix.go +++ b/bolt_unix.go @@ -46,17 +46,6 @@ func funlock(f *os.File) error { // mmap memory maps a DB's data file. func mmap(db *DB, sz int) error { - // Truncate and fsync to ensure file size metadata is flushed. - // https://github.com/boltdb/bolt/issues/284 - if !db.NoGrowSync && !db.readOnly { - if err := db.file.Truncate(int64(sz)); err != nil { - return fmt.Errorf("file resize error: %s", err) - } - if err := db.file.Sync(); err != nil { - return fmt.Errorf("file sync error: %s", err) - } - } - // Map the data file to memory. b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) if err != nil { |