diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-06-28 10:14:17 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-06-28 10:14:17 -0700 |
| commit | 1bb8cae65d499dc48cc2d7db2dc5692482f3f305 (patch) | |
| tree | e467980c5973dc2e3aeb6a2f1586b79df02e3c9c /weed/filesys/file.go | |
| parent | b813fac4a39e9cec311a17706f70796d72a69bf2 (diff) | |
| download | seaweedfs-1bb8cae65d499dc48cc2d7db2dc5692482f3f305.tar.xz seaweedfs-1bb8cae65d499dc48cc2d7db2dc5692482f3f305.zip | |
reverting and working
Diffstat (limited to 'weed/filesys/file.go')
| -rw-r--r-- | weed/filesys/file.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 0f788a888..bafbd7cc8 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -150,6 +150,8 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f return nil } + file.wfs.cacheDelete(file.fullpath()) + return file.saveEntry() } @@ -166,6 +168,8 @@ func (file *File) Setxattr(ctx context.Context, req *fuse.SetxattrRequest) error return err } + file.wfs.cacheDelete(file.fullpath()) + return file.saveEntry() } @@ -182,6 +186,8 @@ func (file *File) Removexattr(ctx context.Context, req *fuse.RemovexattrRequest) return err } + file.wfs.cacheDelete(file.fullpath()) + return file.saveEntry() } @@ -212,7 +218,8 @@ func (file *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error { func (file *File) Forget() { t := util.NewFullPath(file.dir.FullPath(), file.Name) - glog.V(4).Infof("Forget file %s", t) + glog.V(3).Infof("Forget file %s", t) + file.wfs.fsNodeCache.DeleteFsNode(t) } func (file *File) maybeLoadEntry(ctx context.Context) error { @@ -271,7 +278,9 @@ func (file *File) saveEntry() error { return fuse.EIO } - file.wfs.metaCache.UpdateEntry(context.Background(), filer2.FromPbEntry(request.Directory, request.Entry)) + if file.wfs.option.AsyncMetaDataCaching { + file.wfs.metaCache.UpdateEntry(context.Background(), filer2.FromPbEntry(request.Directory, request.Entry)) + } return nil }) |
