Skip to content

Commit b83ca9c

Browse files
committed
Remove serialize_reads package
Will be replaced by go-fuse's new SyncRead flag. More info: hanwen/go-fuse#395 SyncRead commit: hanwen/go-fuse@15a8bb0
1 parent e69a857 commit b83ca9c

File tree

3 files changed

+1
-161
lines changed

3 files changed

+1
-161
lines changed

internal/fusefrontend/file.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
2121
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
2222
"github.com/rfjakob/gocryptfs/v2/internal/openfiletable"
23-
"github.com/rfjakob/gocryptfs/v2/internal/serialize_reads"
2423
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
2524
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
2625
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
@@ -252,13 +251,7 @@ func (f *File) Read(ctx context.Context, buf []byte, off int64) (resultData fuse
252251
defer f.fileTableEntry.ContentLock.RUnlock()
253252

254253
tlog.Debug.Printf("ino%d: FUSE Read: offset=%d length=%d", f.qIno.Ino, off, len(buf))
255-
if f.rootNode.args.SerializeReads {
256-
serialize_reads.Wait(off, len(buf))
257-
}
258254
out, errno := f.doRead(buf[:0], uint64(off), uint64(len(buf)))
259-
if f.rootNode.args.SerializeReads {
260-
serialize_reads.Done()
261-
}
262255
if errno != 0 {
263256
return nil, errno
264257
}
@@ -389,6 +382,7 @@ func (f *File) Write(ctx context.Context, data []byte, off int64) (uint32, sysca
389382
// But if the write directly follows an earlier write, it cannot create a
390383
// hole, and we can save one Stat() call.
391384
if !f.isConsecutiveWrite(off) {
385+
fmt.Printf("isConsecutiveWrite=false, off=%d\n", off)
392386
errno := f.writePadHole(off)
393387
if errno != 0 {
394388
return 0, errno

internal/fusefrontend/root_node.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
1212
"github.com/rfjakob/gocryptfs/v2/internal/inomap"
1313
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
14-
"github.com/rfjakob/gocryptfs/v2/internal/serialize_reads"
1514
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
1615
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
1716
)
@@ -63,9 +62,6 @@ type RootNode struct {
6362
}
6463

6564
func NewRootNode(args Args, c *contentenc.ContentEnc, n *nametransform.NameTransform) *RootNode {
66-
if args.SerializeReads {
67-
serialize_reads.InitSerializer()
68-
}
6965
if len(args.Exclude) > 0 {
7066
tlog.Warn.Printf("Forward mode does not support -exclude")
7167
}

internal/serialize_reads/sr.go

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)