aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'db.go')
-rw-r--r--db.go7
1 files changed, 0 insertions, 7 deletions
diff --git a/db.go b/db.go
index 5ae35cc..d1b722a 100644
--- a/db.go
+++ b/db.go
@@ -103,7 +103,6 @@ type DB struct {
ops struct {
writeAt func(b []byte, off int64) (n int, err error)
- Truncate func(size int64) error
}
readOnly bool // Read only mode. Update()/Begin(true) would return ErrDatabaseReadOnly immediately.
@@ -144,8 +143,6 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
if options.ReadOnly {
flag = os.O_RDONLY
db.readOnly = true
- // Ignore truncations.
- db.ops.Truncate = func(int64) error { return nil }
}
// Open data file and separate sync handler for metadata writes.
@@ -156,10 +153,6 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
return nil, err
}
- if !db.readOnly {
- db.ops.Truncate = db.file.Truncate
- }
-
// Lock file so that other processes using Bolt in read-write mode cannot
// use the database at the same time. This would cause corruption since
// the two processes would write meta pages and free pages separately.