tree structured fs cache

FsCache for FsNode, wrapping fs.Node
This commit is contained in:
Chris Lu
2020-03-26 00:08:14 -07:00
parent 2e4fadd10a
commit 7f0d87b206
10 changed files with 150 additions and 69 deletions

View File

@@ -60,9 +60,6 @@ type WFS struct {
stats statsCache
// nodes, protected by nodesLock
nodesLock sync.Mutex
nodes map[uint64]fs.Node
root fs.Node
fsNodeCache *FsCache
}
@@ -81,10 +78,9 @@ func NewSeaweedFileSystem(option *Option) *WFS {
return make([]byte, option.ChunkSizeLimit)
},
},
nodes: make(map[uint64]fs.Node),
}
wfs.root = &Dir{Path: wfs.option.FilerMountRootPath, wfs: wfs}
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}
wfs.fsNodeCache = newFsCache(wfs.root)
return wfs