Skip to content

Commit

Permalink
Use the newer vectored read fuse library with backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Aug 31, 2021
1 parent 2edabe3 commit 8a91f33
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func Mount(
Options: flags.MountOptions,
ErrorLogger: GetStdLogger(NewLogger("fuse"), logrus.ErrorLevel),
DisableWritebackCaching: true,
UseVectoredRead: true,
}

if flags.DebugFuse {
Expand Down
4 changes: 4 additions & 0 deletions api/common/panic_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ func (fs FusePanicLogger) ReadFile(ctx context.Context, op *fuseops.ReadFileOp)
defer LogPanic(&err)
return fs.Fs.ReadFile(ctx, op)
}
func (fs FusePanicLogger) VectoredRead(ctx context.Context, op *fuseops.VectoredReadOp) (err error) {
defer LogPanic(&err)
return fs.Fs.VectoredRead(ctx, op)
}
func (fs FusePanicLogger) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) (err error) {
defer LogPanic(&err)
return fs.Fs.WriteFile(ctx, op)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ require (

replace github.com/aws/aws-sdk-go => ./s3ext

replace github.com/jacobsa/fuse => github.com/vitalif/fusego v0.0.0-20210827131224-604f0cac79eb
replace github.com/jacobsa/fuse => github.com/vitalif/fusego v0.0.0-20210831101748-5c1104f25356
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ github.com/urfave/cli v1.21.1-0.20190807111034-521735b7608a h1:Q372CokLjPoo4bx4q
github.com/urfave/cli v1.21.1-0.20190807111034-521735b7608a/go.mod h1:pLnliFgEwGWwRKy8217bLxXBDmG6pBQeZcIzf+m7U+k=
github.com/vitalif/fusego v0.0.0-20210827131224-604f0cac79eb h1:knaAaXtcWrH75aVO9UHSjjd81chemg/iA5aGCGSuEf8=
github.com/vitalif/fusego v0.0.0-20210827131224-604f0cac79eb/go.mod h1:xtZnnLxHY6QniCrfIpTwr5h8mH8zr+jsOFj0y9cfyp4=
github.com/vitalif/fusego v0.0.0-20210831101748-5c1104f25356 h1:Hkk91Dh5r5FobWTJ2e0Rj79oHbeHWRa7uNnUK4c4RHU=
github.com/vitalif/fusego v0.0.0-20210831101748-5c1104f25356/go.mod h1:xtZnnLxHY6QniCrfIpTwr5h8mH8zr+jsOFj0y9cfyp4=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
4 changes: 2 additions & 2 deletions internal/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -1146,9 +1146,9 @@ func (fs *Goofys) OpenFile(
return
}

func (fs *Goofys) ReadFile(
func (fs *Goofys) VectoredRead(
ctx context.Context,
op *fuseops.ReadFileOp) (err error) {
op *fuseops.VectoredReadOp) (err error) {

fs.mu.RLock()
fh := fs.fileHandles[op.Handle]
Expand Down
1 change: 1 addition & 0 deletions internal/goofys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,7 @@ func (s *GoofysTest) mountSame(t *C, mountPoint string, sameProc bool) {
Options: s.fs.flags.MountOptions,
ErrorLogger: GetStdLogger(NewLogger("fuse"), logrus.ErrorLevel),
DisableWritebackCaching: true,
UseVectoredRead: true,
}
mountCfg.DebugLogger = GetStdLogger(fuseLog, logrus.DebugLevel)

Expand Down

0 comments on commit 8a91f33

Please sign in to comment.