Refactor to pass memory maps by reference instead of value, fix memory maps not being created properly or written to properly

This commit is contained in:
j.laycock
2019-08-30 12:15:17 +01:00
parent dc50701e7d
commit 840ccdc35d
5 changed files with 39 additions and 39 deletions

View File

@@ -8,10 +8,10 @@ import (
"os"
"time"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/joeslay/seaweedfs/weed/glog"
"github.com/joeslay/seaweedfs/weed/storage/memory_map"
"github.com/joeslay/seaweedfs/weed/storage/needle"
. "github.com/joeslay/seaweedfs/weed/storage/types"
)
var ErrorNotFound = errors.New("not found")
@@ -51,7 +51,7 @@ func (v *Volume) Destroy() (err error) {
}
mem_map, exists := memory_map.FileMemoryMap[v.FileName()]
if exists {
memory_map.DeleteFileAndMemoryMap(mem_map)
mem_map.DeleteFileAndMemoryMap()
delete(memory_map.FileMemoryMap, v.FileName())
}