mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
remove unused parameter
This commit is contained in:
parent
df50afc642
commit
5b8b022985
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.FullPath, entryChan chan *filer.Entry) error {
|
func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.FullPath) error {
|
||||||
|
|
||||||
currentPath := dirPath
|
currentPath := dirPath
|
||||||
|
|
||||||
|
@ -22,14 +22,8 @@ func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.Full
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if entryChan != nil && dirPath == currentPath {
|
if err := doEnsureVisited(mc, client, currentPath); err != nil {
|
||||||
if err := doEnsureVisited(mc, client, currentPath, entryChan); err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if err := doEnsureVisited(mc, client, currentPath, nil); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// continue to parent directory
|
// continue to parent directory
|
||||||
|
@ -45,7 +39,7 @@ func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.Full
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func doEnsureVisited(mc *MetaCache, client filer_pb.FilerClient, path util.FullPath, entryChan chan *filer.Entry) error {
|
func doEnsureVisited(mc *MetaCache, client filer_pb.FilerClient, path util.FullPath) error {
|
||||||
|
|
||||||
glog.V(4).Infof("ReadDirAllEntries %s ...", path)
|
glog.V(4).Infof("ReadDirAllEntries %s ...", path)
|
||||||
|
|
||||||
|
@ -59,9 +53,6 @@ func doEnsureVisited(mc *MetaCache, client filer_pb.FilerClient, path util.FullP
|
||||||
glog.V(0).Infof("read %s: %v", entry.FullPath, err)
|
glog.V(0).Infof("read %s: %v", entry.FullPath, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if entryChan != nil {
|
|
||||||
entryChan <- entry
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -161,7 +161,7 @@ func (wfs *WFS) maybeLoadEntry(fullpath util.FullPath) (*filer_pb.Entry, fuse.St
|
||||||
}
|
}
|
||||||
|
|
||||||
// read from async meta cache
|
// read from async meta cache
|
||||||
meta_cache.EnsureVisited(wfs.metaCache, wfs, util.FullPath(dir), nil)
|
meta_cache.EnsureVisited(wfs.metaCache, wfs, util.FullPath(dir))
|
||||||
cachedEntry, cacheErr := wfs.metaCache.FindEntry(context.Background(), fullpath)
|
cachedEntry, cacheErr := wfs.metaCache.FindEntry(context.Background(), fullpath)
|
||||||
if cacheErr == filer_pb.ErrNotFound {
|
if cacheErr == filer_pb.ErrNotFound {
|
||||||
return nil, fuse.ENOENT
|
return nil, fuse.ENOENT
|
||||||
|
|
|
@ -27,7 +27,7 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
|
||||||
|
|
||||||
fullFilePath := dirPath.Child(name)
|
fullFilePath := dirPath.Child(name)
|
||||||
|
|
||||||
visitErr := meta_cache.EnsureVisited(wfs.metaCache, wfs, dirPath, nil)
|
visitErr := meta_cache.EnsureVisited(wfs.metaCache, wfs, dirPath)
|
||||||
if visitErr != nil {
|
if visitErr != nil {
|
||||||
glog.Errorf("dir Lookup %s: %v", dirPath, visitErr)
|
glog.Errorf("dir Lookup %s: %v", dirPath, visitErr)
|
||||||
return fuse.EIO
|
return fuse.EIO
|
||||||
|
|
|
@ -219,7 +219,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
if err = meta_cache.EnsureVisited(wfs.metaCache, wfs, dirPath, nil); err != nil {
|
if err = meta_cache.EnsureVisited(wfs.metaCache, wfs, dirPath); err != nil {
|
||||||
glog.Errorf("dir ReadDirAll %s: %v", dirPath, err)
|
glog.Errorf("dir ReadDirAll %s: %v", dirPath, err)
|
||||||
return fuse.EIO
|
return fuse.EIO
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue