diff --git a/weed-fs/src/pkg/storage/needle_map.go b/weed-fs/src/pkg/storage/needle_map.go index b173eb47f..c1b84358c 100644 --- a/weed-fs/src/pkg/storage/needle_map.go +++ b/weed-fs/src/pkg/storage/needle_map.go @@ -178,11 +178,7 @@ func (nm *NeedleMap) Put(key uint64, offset uint32, size uint32) (int, error) { return nm.indexFile.Write(nm.bytes) } func (nm *NeedleMap) Get(key uint64) (element *NeedleValue, ok bool) { - if nm.m != nil { - element, ok = nm.m.Get(Key(key)) - } else { - element, ok = nm.fm.Get(Key(key)) - } + element, ok = nm.m.Get(Key(key)) return } func (nm *NeedleMap) Delete(key uint64) error { @@ -206,8 +202,5 @@ func (nm *NeedleMap) ContentSize() uint64 { // iterate through all needles using the iterator function func (nm *NeedleMap) Walk(pedestrian func(*NeedleValue) error) (err error) { - if nm.m != nil { - return nm.m.Walk(pedestrian) - } - return nm.fm.Walk(pedestrian) + return nm.m.Walk(pedestrian) } diff --git a/weed-fs/src/pkg/storage/store.go b/weed-fs/src/pkg/storage/store.go index d9e94ee56..161b855e3 100644 --- a/weed-fs/src/pkg/storage/store.go +++ b/weed-fs/src/pkg/storage/store.go @@ -118,9 +118,7 @@ func (s *Store) loadExistingVolumes() { if s.volumes[vid] == nil { if v, e := NewVolume(s.dir, vid, CopyNil); e == nil { s.volumes[vid] = v - log.Println("In dir", s.dir, "read volume =", vid, "replicationType =", v.replicaType, "version =", v.version, "size =", v.Size(), "frozen?", !v.IsWritable()) - } else { - log.Println("ERROR loading volume", vid, "in dir", s.dir, ":", e.Error()) + log.Println("In dir", s.dir, "read volume =", vid, "replicationType =", v.replicaType, "version =", v.version, "size =", v.Size()) } } } diff --git a/weed-fs/src/pkg/storage/volume.go b/weed-fs/src/pkg/storage/volume.go index 9a7c33a42..d694f27ba 100644 --- a/weed-fs/src/pkg/storage/volume.go +++ b/weed-fs/src/pkg/storage/volume.go @@ -36,14 +36,7 @@ func (v *Volume) load() error { fileName := path.Join(v.dir, v.Id.String()) v.dataFile, e = os.OpenFile(fileName+".dat", os.O_RDWR|os.O_CREATE, 0644) if e != nil { - if os.IsPermission(e) { - if util.FileExists(fileName + ".cdb") { - v.dataFile, e = os.Open(fileName + ".dat") - } - } - if e != nil { - return fmt.Errorf("cannot create Volume Data %s.dat: %s", fileName, e) - } + return fmt.Errorf("cannot create Volume Data %s.dat: %s", fileName, e) } if v.replicaType == CopyNil { if e = v.readSuperBlock(); e != nil {