Skip to content

Commit

Permalink
Update FUSE binding to rebased version
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Oct 24, 2024
1 parent c620de7 commit 8198a6a
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 57 deletions.
44 changes: 26 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/yandex-cloud/geesefs

go 1.18
go 1.21

toolchain go1.22.2

require (
cloud.google.com/go/storage v1.16.0
Expand All @@ -12,25 +14,26 @@ require (
github.com/Azure/go-autorest/autorest/azure/auth v0.5.7
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2
github.com/aws/aws-sdk-go v1.38.7
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.4
github.com/google/uuid v1.1.2
github.com/jacobsa/fuse v0.0.0-20230810134708-ab21db1af836
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/xattr v0.4.9
github.com/prometheus/client_golang v1.20.5
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/sevlyar/go-daemon v0.1.6
github.com/shirou/gopsutil v0.0.0-20190731134726-d80c43f9c984
github.com/sirupsen/logrus v1.8.1
github.com/tidwall/btree v1.7.0
github.com/urfave/cli v1.21.1-0.20190807111034-521735b7608a
github.com/winfsp/cgofuse v1.5.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
golang.org/x/sync v0.7.0
golang.org/x/sys v0.22.0
google.golang.org/api v0.49.0
google.golang.org/grpc v1.38.0
google.golang.org/protobuf v1.26.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
google.golang.org/protobuf v1.35.1
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/ini.v1 v1.46.0
)

Expand All @@ -43,6 +46,8 @@ require (
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
Expand All @@ -52,28 +57,31 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/jtolds/gls v4.2.0+incompatible // indirect
github.com/kr/pretty v0.1.1-0.20190720101428-71e7e4993750 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-ieproxy v0.0.0-20190805055040-f9202b1cfdeb // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/smartystreets/assertions v0.0.0-20160201214316-443d812296a8 // indirect
github.com/smartystreets/goconvey v1.6.1-0.20160119221636-995f5b2e021c // indirect
github.com/stretchr/testify v1.7.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.3 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210624174822-c5cf32407d0a // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

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

replace github.com/winfsp/cgofuse => github.com/vitalif/cgofuse v0.0.0-20230609211427-22e8fa44f6b8

replace github.com/jacobsa/fuse => github.com/vitalif/fusego v0.0.0-20230810211941-8d4d89b65d93
replace github.com/jacobsa/fuse => github.com/vitalif/fusego v0.0.0-20241023174951-7a12c251bb93
86 changes: 59 additions & 27 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ func (fs *Goofys) completeInflightListing(id int) map[string]bool {
return m
}

func (fs *Goofys) SyncFS(parent *Inode) (err error) {
func (fs *Goofys) SyncTree(parent *Inode) (err error) {
if parent == nil || parent.Id == fuseops.RootInodeID {
log.Infof("Flushing all changes")
parent = nil
Expand Down
2 changes: 1 addition & 1 deletion internal/goofys_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func (s *GoofysTest) TearDownTest(t *C) {
}

if s.fs != nil {
s.fs.SyncFS(nil)
s.fs.SyncTree(nil)
s.fs.Shutdown()
}

Expand Down
4 changes: 2 additions & 2 deletions internal/goofys_fuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ func (fs *GoofysFuse) SyncFile(
in := fs.getInodeOrDie(op.Inode)

if in.Id == fuseops.RootInodeID {
err = fs.SyncFS(nil)
err = fs.SyncTree(nil)
} else if in.isDir() {
err = fs.SyncFS(in)
err = fs.SyncTree(in)
} else {
err = in.SyncFile()
}
Expand Down
2 changes: 1 addition & 1 deletion internal/goofys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ func (s *GoofysTest) TestRenameOpenedUnmodified(t *C) {

fh.Release()

err = s.fs.SyncFS(nil)
err = s.fs.SyncTree(nil)
t.Assert(err, IsNil)

// Check that the file is actually renamed
Expand Down
8 changes: 4 additions & 4 deletions internal/goofys_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (fs *GoofysWin) Create(path string, flags int, mode uint32) (ret int, fhId
}

if fs.flags.FlushFilename != "" && child == fs.flags.FlushFilename {
err = fs.SyncFS(parent)
err = fs.SyncTree(parent)
if err == nil {
err = syscall.ENOENT
}
Expand Down Expand Up @@ -473,7 +473,7 @@ func (fs *GoofysWin) Open(path string, flags int) (ret int, fhId uint64) {
return mapWinError(err), 0
}
if err == nil {
err = fs.SyncFS(parent)
err = fs.SyncTree(parent)
}
if err == nil {
err = syscall.ENOENT
Expand Down Expand Up @@ -693,9 +693,9 @@ func (fs *GoofysWin) Fsync(path string, datasync bool, fhId uint64) (ret int) {
}
}
if inode.Id == fuseops.RootInodeID {
err = fs.SyncFS(nil)
err = fs.SyncTree(nil)
} else if inode.isDir() {
err = fs.SyncFS(inode)
err = fs.SyncTree(inode)
} else {
err = inode.SyncFile()
}
Expand Down
4 changes: 2 additions & 2 deletions internal/handles.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ func (inode *Inode) setFileMode(newMode os.FileMode) (changed bool, err error) {
}
}
if inode.Attributes.Mode != defaultMode {
err = inode.setUserMeta(inode.fs.flags.FileModeAttr, []byte(fmt.Sprintf("%d", fuseops.ConvertGolangMode(inode.Attributes.Mode))))
err = inode.setUserMeta(inode.fs.flags.FileModeAttr, []byte(fmt.Sprintf("%d", fuseops.ConvertGoMode(inode.Attributes.Mode))))
} else {
err = inode.setUserMeta(inode.fs.flags.FileModeAttr, nil)
}
Expand Down Expand Up @@ -892,7 +892,7 @@ func (inode *Inode) DumpThis(withBuffers bool) (children []*Inode) {
}
if inode.isDir() && inode.Attributes.Mode != (os.ModeDir | fs.flags.DirMode) ||
!inode.isDir() && inode.Attributes.Mode != fs.flags.FileMode {
dataMap["mode"] = fuseops.ConvertGolangMode(inode.Attributes.Mode)
dataMap["mode"] = fuseops.ConvertGoMode(inode.Attributes.Mode)
}

dataMap["attrTime"] = inode.AttrTime.Unix()
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func main() {
err = fmt.Errorf("MountedFileSystem.Join: %v", err)
return
}
fs.SyncFS(nil)
fs.SyncTree(nil)

log.Println("Successfully exiting.")
}
Expand Down

0 comments on commit 8198a6a

Please sign in to comment.