summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-05-29 13:46:47 +0200
committerJakob Unterwurzacher2016-05-29 13:46:47 +0200
commit4c0cb37c50c66b03be43063d77a52b74f24ec9f7 (patch)
tree310f2781c7cede4598fbc53e2c78212f6689d4fc /internal/fusefrontend/file.go
parentb5ae3dcc4e1a67ac1be24be1b84133c9bd78e7d4 (diff)
fusefrontend: remove unused "forgotten" variable
The functionality has long been replaced by the fd < 0 check.
Diffstat (limited to 'internal/fusefrontend/file.go')
-rw-r--r--internal/fusefrontend/file.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index ac00b1d..ce806b6 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -39,8 +39,6 @@ type file struct {
// File header
header *contentenc.FileHeader
-
- forgotten bool
}
func NewFile(fd *os.File, writeOnly bool, contentEnc *contentenc.ContentEnc) nodefs.File {
@@ -310,7 +308,6 @@ func (f *file) Release() {
f.fdLock.Unlock()
wlock.unregister(f.ino)
- f.forgotten = true
}
// Flush - FUSE call
@@ -343,15 +340,12 @@ func (f *file) Truncate(newSize uint64) fuse.Status {
defer f.fdLock.RUnlock()
if f.fd.Fd() < 0 {
// The file descriptor has been closed concurrently.
+ toggledlog.Warn.Printf("ino%d fh%d: Truncate on forgotten file", f.ino, f.intFd())
return fuse.EBADF
}
wlock.lock(f.ino)
defer wlock.unlock(f.ino)
- if f.forgotten {
- toggledlog.Warn.Printf("ino%d fh%d: Truncate on forgotten file", f.ino, f.intFd())
- }
-
// Common case first: Truncate to zero
if newSize == 0 {
err := syscall.Ftruncate(int(f.fd.Fd()), 0)