Skip to content

Commit

Permalink
Remove serialize_reads package
Browse files Browse the repository at this point in the history
Will be replaced by go-fuse's new SyncRead flag.

More info: hanwen/go-fuse#395
SyncRead commit: hanwen/go-fuse@15a8bb0
  • Loading branch information
rfjakob committed Aug 30, 2021
1 parent e69a857 commit b83ca9c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 161 deletions.
8 changes: 1 addition & 7 deletions internal/fusefrontend/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions internal/fusefrontend/root_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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")
}
Expand Down
150 changes: 0 additions & 150 deletions internal/serialize_reads/sr.go

This file was deleted.

0 comments on commit b83ca9c

Please sign in to comment.