aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/dir.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-07-24 09:25:54 -0700
committerChris Lu <chris.lu@gmail.com>2020-07-24 09:25:54 -0700
commit5788f1f6bf16f42ab31f762441c4bcdf2da3bbb9 (patch)
tree84301a97f4f921b4aec532c638ce8ca12e645b08 /weed/filesys/dir.go
parent6962ca48d35a7b215dea63549a969b7c9ffce861 (diff)
downloadseaweedfs-5788f1f6bf16f42ab31f762441c4bcdf2da3bbb9.tar.xz
seaweedfs-5788f1f6bf16f42ab31f762441c4bcdf2da3bbb9.zip
remove fsnode cache
fix https://github.com/chrislusf/seaweedfs/issues/1400
Diffstat (limited to 'weed/filesys/dir.go')
-rw-r--r--weed/filesys/dir.go25
1 files changed, 8 insertions, 17 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go
index 8454e51aa..77d01d463 100644
--- a/weed/filesys/dir.go
+++ b/weed/filesys/dir.go
@@ -100,22 +100,18 @@ func (dir *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) error {
}
func (dir *Dir) newFile(name string, entry *filer_pb.Entry) fs.Node {
- return dir.wfs.fsNodeCache.EnsureFsNode(util.NewFullPath(dir.FullPath(), name), func() fs.Node {
- return &File{
- Name: name,
- dir: dir,
- wfs: dir.wfs,
- entry: entry,
- entryViewCache: nil,
- }
- })
+ return &File{
+ Name: name,
+ dir: dir,
+ wfs: dir.wfs,
+ entry: entry,
+ entryViewCache: nil,
+ }
}
func (dir *Dir) newDirectory(fullpath util.FullPath, entry *filer_pb.Entry) fs.Node {
- return dir.wfs.fsNodeCache.EnsureFsNode(fullpath, func() fs.Node {
- return &Dir{name: entry.Name, wfs: dir.wfs, entry: entry, parent: dir}
- })
+ return &Dir{name: entry.Name, wfs: dir.wfs, entry: entry, parent: dir}
}
@@ -315,8 +311,6 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
dir.wfs.deleteFileChunks(entry.Chunks)
- dir.wfs.fsNodeCache.DeleteFsNode(filePath)
-
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
glog.V(3).Infof("remove file: %v", req)
@@ -333,7 +327,6 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
func (dir *Dir) removeFolder(req *fuse.RemoveRequest) error {
t := util.NewFullPath(dir.FullPath(), req.Name)
- dir.wfs.fsNodeCache.DeleteFsNode(t)
dir.wfs.metaCache.DeleteEntry(context.Background(), t)
@@ -426,8 +419,6 @@ func (dir *Dir) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp
func (dir *Dir) Forget() {
glog.V(3).Infof("Forget dir %s", dir.FullPath())
-
- dir.wfs.fsNodeCache.DeleteFsNode(util.FullPath(dir.FullPath()))
}
func (dir *Dir) maybeLoadEntry() error {