aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-09-24 20:52:12 +0200
committerrfjakob2026-10-01 20:32:54 +0200
commitcbe7c2bb0a933b3f8ac0c27e283673929054f753 (patch)
treea0377f8c6c51a1b7431bc84ad50b52e576552fe5
parent22c187b49b033982950248a66ec4134946d62900 (diff)
fusefrontend: drop Node.Fsync, let File.Fsync handle itHEADmaster
Fixes #1023
-rw-r--r--internal/fusefrontend/file.go3
-rw-r--r--internal/fusefrontend/node.go19
2 files changed, 0 insertions, 22 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index 9195f00..353029c 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -455,9 +455,6 @@ func (f *File) Flush(ctx context.Context) syscall.Errno {
}
// Fsync: handles FUSE opcode FSYNC
-//
-// Unfortunately, as Node.Fsync is also defined and takes precedence,
-// File.Fsync is never called at the moment.
func (f *File) Fsync(ctx context.Context, flags uint32) (errno syscall.Errno) {
f.fdLock.RLock()
defer f.fdLock.RUnlock()
diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go
index 59f6b2f..c531876 100644
--- a/internal/fusefrontend/node.go
+++ b/internal/fusefrontend/node.go
@@ -516,22 +516,3 @@ func (n *Node) Rename(ctx context.Context, name string, newParent fs.InodeEmbedd
}
return 0
}
-
-// Fsync: handles FUSE opcodes FSYNC & FDIRSYNC
-//
-// Note: f is always set to nil by go-fuse
-func (n *Node) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno {
- dirfd, cName, errno := n.prepareAtSyscallMyself()
- if errno != 0 {
- return errno
- }
- defer syscall.Close(dirfd)
-
- fd, err := syscallcompat.Openat(dirfd, cName, syscall.O_RDONLY|syscall.O_NOFOLLOW, 0)
- if err != nil {
- return fs.ToErrno(err)
- }
- defer syscall.Close(fd)
-
- return fs.ToErrno(syscall.Fsync(fd))
-}