diff options
Diffstat (limited to 'weed/storage/volume_loading.go')
| -rw-r--r-- | weed/storage/volume_loading.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go index 7bc65a4a3..c4f1aae9b 100644 --- a/weed/storage/volume_loading.go +++ b/weed/storage/volume_loading.go @@ -12,11 +12,11 @@ func loadVolumeWithoutIndex(dirname string, collection string, id VolumeId, need v = &Volume{dir: dirname, Collection: collection, Id: id} v.SuperBlock = SuperBlock{} v.needleMapKind = needleMapKind - e = v.load(false, false, needleMapKind) + e = v.load(false, false, needleMapKind, 0) return } -func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind NeedleMapType) error { +func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind NeedleMapType, preallocate int64) error { var e error fileName := v.FileName() @@ -34,7 +34,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind } } else { if createDatIfMissing { - v.dataFile, e = os.OpenFile(fileName+".dat", os.O_RDWR|os.O_CREATE, 0644) + v.dataFile, e = createVolumeFile(fileName+".dat", preallocate) } else { return fmt.Errorf("Volume Data file %s.dat does not exist.", fileName) } |
