aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-30 09:39:57 +0200
committerJakob Unterwurzacher2021-08-30 09:41:38 +0200
commitb83ca9c921019fc3b790dabb6198bb77ef2f9a34 (patch)
tree28a66f76f73e67819bc120274b36c09676ab369c /internal/fusefrontend
parente69a85769f008a33119eda85d3face948afe7636 (diff)
Remove serialize_reads package
Will be replaced by go-fuse's new SyncRead flag. More info: https://github.com/hanwen/go-fuse/issues/395 SyncRead commit: https://github.com/hanwen/go-fuse/commit/15a8bb029a4e1a51e10043c370970596b1fbb737
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/file.go8
-rw-r--r--internal/fusefrontend/root_node.go4
2 files changed, 1 insertions, 11 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index 9481abf..6f33a60 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -20,7 +20,6 @@ import (
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/openfiletable"
- "github.com/rfjakob/gocryptfs/v2/internal/serialize_reads"
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
@@ -252,13 +251,7 @@ func (f *File) Read(ctx context.Context, buf []byte, off int64) (resultData fuse
defer f.fileTableEntry.ContentLock.RUnlock()
tlog.Debug.Printf("ino%d: FUSE Read: offset=%d length=%d", f.qIno.Ino, off, len(buf))
- if f.rootNode.args.SerializeReads {
- serialize_reads.Wait(off, len(buf))
- }
out, errno := f.doRead(buf[:0], uint64(off), uint64(len(buf)))
- if f.rootNode.args.SerializeReads {
- serialize_reads.Done()
- }
if errno != 0 {
return nil, errno
}
@@ -389,6 +382,7 @@ func (f *File) Write(ctx context.Context, data []byte, off int64) (uint32, sysca
// But if the write directly follows an earlier write, it cannot create a
// hole, and we can save one Stat() call.
if !f.isConsecutiveWrite(off) {
+ fmt.Printf("isConsecutiveWrite=false, off=%d\n", off)
errno := f.writePadHole(off)
if errno != 0 {
return 0, errno
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go
index 34b084b..7d37520 100644
--- a/internal/fusefrontend/root_node.go
+++ b/internal/fusefrontend/root_node.go
@@ -11,7 +11,6 @@ import (
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
- "github.com/rfjakob/gocryptfs/v2/internal/serialize_reads"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
@@ -63,9 +62,6 @@ type RootNode struct {
}
func NewRootNode(args Args, c *contentenc.ContentEnc, n *nametransform.NameTransform) *RootNode {
- if args.SerializeReads {
- serialize_reads.InitSerializer()
- }
if len(args.Exclude) > 0 {
tlog.Warn.Printf("Forward mode does not support -exclude")
}