diff options
Diffstat (limited to 'src/dedo.go')
-rw-r--r-- | src/dedo.go | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/dedo.go b/src/dedo.go index 437d04f..73b6604 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -1314,14 +1314,6 @@ type DB struct { // debugging purposes. StrictMode bool - // When true, skips the truncate call when growing the database. - // Setting this to true is only safe on non-ext3/ext4 systems. - // Skipping truncation avoids preallocation of hard drive space and - // bypasses a truncate() and fsync() syscall on remapping. - // - // https://github.com/boltdb/bolt/issues/284 - NoGrowSync bool - // If you want to read the entire database fast, you can set MmapFlag to // syscall.MAP_POPULATE on Linux 2.6.23+ for sequential read-ahead. MmapFlags int @@ -1407,7 +1399,6 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) { if options == nil { options = DefaultOptions } - db.NoGrowSync = options.NoGrowSync db.MmapFlags = options.MmapFlags // Set default values for later DB operations. @@ -2119,7 +2110,7 @@ func (db *DB) grow(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 !db.readOnly { if runtime.GOOS != "windows" { if err := db.file.Truncate(int64(sz)); err != nil { return fmt.Errorf("file resize error: %s", err) @@ -2145,9 +2136,6 @@ type Options struct { // available on Darwin and Linux. Timeout time.Duration - // Sets the DB.NoGrowSync flag before memory mapping the file. - NoGrowSync bool - // Open database in read-only mode. Uses flock(..., LOCK_SH |LOCK_NB) to // grab a shared lock (UNIX). ReadOnly bool @@ -2170,7 +2158,6 @@ type Options struct { // No timeout is used which will cause Bolt to wait indefinitely for a lock. var DefaultOptions = &Options{ Timeout: 0, - NoGrowSync: false, } // Stats represents statistics about the database. |