aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/fs.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-02 22:32:21 +0100
committerJakob Unterwurzacher2019-01-03 15:31:13 +0100
commit4f66d66755da63c78b09201c6c72353009251cf2 (patch)
tree9eb4e937419e7255c56df04d3c30d36185e1a337 /internal/fusefrontend/fs.go
parentf6dad8d0fae25b5d88ad036b841fea10b7296ccb (diff)
fusefrontend: add dirCache
Diffstat (limited to 'internal/fusefrontend/fs.go')
-rw-r--r--internal/fusefrontend/fs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index 5adade6..c0a275f 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -53,6 +53,8 @@ type FS struct {
// which is called as part of every filesystem operation.
// (This flag uses a uint32 so that it can be reset with CompareAndSwapUint32.)
AccessedSinceLastCheck uint32
+
+ dirCache dirCacheStruct
}
var _ pathfs.FileSystem = &FS{} // Verify that interface is implemented.
@@ -533,6 +535,7 @@ func (fs *FS) Symlink(target string, linkName string, context *fuse.Context) (co
//
// Symlink-safe through Renameat().
func (fs *FS) Rename(oldPath string, newPath string, context *fuse.Context) (code fuse.Status) {
+ defer fs.dirCache.Clear()
if fs.isFiltered(newPath) {
return fuse.EPERM
}
@@ -546,9 +549,6 @@ func (fs *FS) Rename(oldPath string, newPath string, context *fuse.Context) (cod
return fuse.ToStatus(err)
}
defer syscall.Close(newDirfd)
- // The Rename may cause a directory to take the place of another directory.
- // That directory may still be in the DirIV cache, clear it.
- fs.nameTransform.DirIVCache.Clear()
// Easy case.
if fs.args.PlaintextNames {
return fuse.ToStatus(syscallcompat.Renameat(oldDirfd, oldCName, newDirfd, newCName))