diff --git a/go.mod b/go.mod index 43fa0573..91120719 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,8 @@ require ( github.com/go-ole/go-ole v1.2.5 // indirect github.com/google/uuid v1.1.2 github.com/gopherjs/gopherjs v0.0.0-20210413103415-7d3cbed7d026 // indirect - github.com/jacobsa/fuse v0.0.0-20201216155545-e0296dec955f + github.com/jacobsa/fuse v0.0.0-20220303082815-1c9fe7bc84a5 github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 - github.com/kylelemons/godebug v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b github.com/sevlyar/go-daemon v0.1.5 @@ -35,5 +34,3 @@ require ( gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 gopkg.in/ini.v1 v1.51.0 ) - -replace github.com/jacobsa/fuse => github.com/kahing/fusego v0.0.0-20200327063725-ca77844c7bcc diff --git a/go.sum b/go.sum index fab56c98..ed8524a0 100644 --- a/go.sum +++ b/go.sum @@ -108,6 +108,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e/go.mod h1:3ZQK6DMPSz/QZ73jlWxBtUhNA8xZx7LzUFSq/OfP8vk= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= @@ -203,7 +204,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20210413103415-7d3cbed7d026 h1:VNVgNDgai+7LqdALaNTNKDD+EriKUN30tvQH6bgYjh8= github.com/gopherjs/gopherjs v0.0.0-20210413103415-7d3cbed7d026/go.mod h1:Opf9rtYVq0eTyX+aRVmRO9hE8ERAozcdrBxWG9Q6mkQ= @@ -214,7 +214,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= @@ -235,6 +234,14 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jacobsa/fuse v0.0.0-20220303082815-1c9fe7bc84a5 h1:LkLYmg9wdUlhXv9H31druPMUFPSrpN9sWMxPCTvu5dI= +github.com/jacobsa/fuse v0.0.0-20220303082815-1c9fe7bc84a5/go.mod h1:xtZnnLxHY6QniCrfIpTwr5h8mH8zr+jsOFj0y9cfyp4= +github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd/go.mod h1:TlmyIZDpGmwRoTWiakdr+HA1Tukze6C6XbRVidYq02M= +github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff/go.mod h1:gJWba/XXGl0UoOmBQKRWCJdHrr3nE0T65t6ioaj3mLI= +github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11/go.mod h1:+DBdDyfoO2McrOyDemRBq0q9CMEByef7sYl7JH5Q3BI= +github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb/go.mod h1:ivcmUvxXWjb27NsPEaiYK7AidlZXS7oQ5PowUS9z3I4= +github.com/jacobsa/syncutil v0.0.0-20180201203307-228ac8e5a6c3/go.mod h1:mPvulh9VKXvo+yOlrD4VYOOYuLdZJ36wa/5QIrtXvWs= +github.com/jacobsa/timeutil v0.0.0-20170205232429-577e5acbbcf6/go.mod h1:JEWKD6V8xETMW+DEv+IQVz++f8Cn8O/X0HPeDY3qNis= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -247,8 +254,6 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kahing/fusego v0.0.0-20200327063725-ca77844c7bcc h1:wNmVtupKbdEJcTkMIF2ah/nf3NzHEeNnpTR/1riaahQ= -github.com/kahing/fusego v0.0.0-20200327063725-ca77844c7bcc/go.mod h1:Qk5T6wYqwRWfKHhEKkRsIXwsAtQ0GK8rBJNYf5LVdwo= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -307,7 +312,6 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= @@ -321,13 +325,11 @@ github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+D github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.3-0.20190807103436-de736cf91b92 h1:cCFqi2EDJ/eRGFkhvqpkh/6t8dubmVVejQatc7BxG2A= github.com/sirupsen/logrus v1.4.3-0.20190807103436-de736cf91b92/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= @@ -379,7 +381,6 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -525,7 +526,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -710,7 +710,6 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/internal/dir.go b/internal/dir.go index 687674f0..64e838f2 100644 --- a/internal/dir.go +++ b/internal/dir.go @@ -899,7 +899,7 @@ func (parent *Inode) Unlink(name string) (err error) { } func (parent *Inode) Create( - name string, metadata fuseops.OpMetadata) (inode *Inode, fh *FileHandle) { + name string, metadata fuseops.OpContext) (inode *Inode, fh *FileHandle) { parent.logFuse("Create", name) diff --git a/internal/file.go b/internal/file.go index a2ccbaa7..33350dc0 100644 --- a/internal/file.go +++ b/internal/file.go @@ -71,7 +71,7 @@ const READAHEAD_CHUNK = uint32(20 * 1024 * 1024) // NewFileHandle returns a new file handle for the given `inode` triggered by fuse // operation with the given `opMetadata` -func NewFileHandle(inode *Inode, opMetadata fuseops.OpMetadata) *FileHandle { +func NewFileHandle(inode *Inode, opMetadata fuseops.OpContext) *FileHandle { tgid, err := GetTgid(opMetadata.Pid) if err != nil { log.Debugf( diff --git a/internal/goofys.go b/internal/goofys.go index b3321d4a..79e628ce 100644 --- a/internal/goofys.go +++ b/internal/goofys.go @@ -34,8 +34,9 @@ import ( "github.com/jacobsa/fuse/fuseops" "github.com/jacobsa/fuse/fuseutil" - "github.com/sirupsen/logrus" "net/http" + + "github.com/sirupsen/logrus" ) // goofys is a Filey System written in Go. All the backend data is @@ -882,7 +883,7 @@ func (fs *Goofys) OpenFile( in := fs.getInodeOrDie(op.Inode) fs.mu.RUnlock() - fh, err := in.OpenFile(op.Metadata) + fh, err := in.OpenFile(op.OpContext) if err != nil { return } @@ -955,7 +956,7 @@ func (fs *Goofys) FlushFile( // This check helps us with scenarios like https://github.com/kahing/goofys/issues/273 // Also see goofys_test.go:TestClientForkExec. if fh.Tgid != nil { - tgid, err := GetTgid(op.Metadata.Pid) + tgid, err := GetTgid(op.OpContext.Pid) if err != nil { fh.inode.logFuse("<-- FlushFile", fmt.Sprintf("Failed to retrieve tgid from op.Metadata.Pid. FlushFileOp:%#v, err:%v", @@ -1015,7 +1016,7 @@ func (fs *Goofys) CreateFile( parent := fs.getInodeOrDie(op.Parent) fs.mu.RUnlock() - inode, fh := parent.Create(op.Name, op.Metadata) + inode, fh := parent.Create(op.Name, op.OpContext) parent.mu.Lock() diff --git a/internal/goofys_test.go b/internal/goofys_test.go index 292ab557..f5b33284 100644 --- a/internal/goofys_test.go +++ b/internal/goofys_test.go @@ -57,8 +57,9 @@ import ( "github.com/sirupsen/logrus" - . "gopkg.in/check.v1" "runtime/debug" + + . "gopkg.in/check.v1" ) // so I don't get complains about unused imports @@ -914,7 +915,7 @@ func (s *GoofysTest) TestReadFiles(t *C) { in, err := parent.LookUp(en.Name) t.Assert(err, IsNil) - fh, err := in.OpenFile(fuseops.OpMetadata{uint32(os.Getpid())}) + fh, err := in.OpenFile(fuseops.OpContext{uint32(os.Getpid())}) t.Assert(err, IsNil) buf := make([]byte, 4096) @@ -940,7 +941,7 @@ func (s *GoofysTest) TestReadOffset(t *C) { in, err := root.LookUp(f) t.Assert(err, IsNil) - fh, err := in.OpenFile(fuseops.OpMetadata{uint32(os.Getpid())}) + fh, err := in.OpenFile(fuseops.OpContext{uint32(os.Getpid())}) t.Assert(err, IsNil) buf := make([]byte, 4096) @@ -964,7 +965,7 @@ func (s *GoofysTest) TestReadOffset(t *C) { func (s *GoofysTest) TestCreateFiles(t *C) { fileName := "testCreateFile" - _, fh := s.getRoot(t).Create(fileName, fuseops.OpMetadata{uint32(os.Getpid())}) + _, fh := s.getRoot(t).Create(fileName, fuseops.OpContext{uint32(os.Getpid())}) err := fh.FlushFile() t.Assert(err, IsNil) @@ -983,7 +984,7 @@ func (s *GoofysTest) TestCreateFiles(t *C) { inode, err := s.getRoot(t).LookUp(fileName) t.Assert(err, IsNil) - fh, err = inode.OpenFile(fuseops.OpMetadata{uint32(os.Getpid())}) + fh, err = inode.OpenFile(fuseops.OpContext{uint32(os.Getpid())}) t.Assert(err, IsNil) err = fh.FlushFile() @@ -1062,7 +1063,7 @@ func (s *GoofysTest) testWriteFileAt(t *C, fileName string, offset int64, size i } } else { in := s.fs.inodes[lookup.Entry.Child] - fh, err = in.OpenFile(fuseops.OpMetadata{uint32(os.Getpid())}) + fh, err = in.OpenFile(fuseops.OpContext{uint32(os.Getpid())}) t.Assert(err, IsNil) } @@ -1164,7 +1165,7 @@ func (s *GoofysTest) TestReadRandom(t *C) { in, err := s.LookUpInode(t, "testLargeFile") t.Assert(err, IsNil) - fh, err := in.OpenFile(fuseops.OpMetadata{uint32(os.Getpid())}) + fh, err := in.OpenFile(fuseops.OpContext{uint32(os.Getpid())}) t.Assert(err, IsNil) fr := &FileHandleReader{s.fs, fh, 0} @@ -1196,7 +1197,7 @@ func (s *GoofysTest) TestMkDir(t *C) { t.Assert(err, IsNil) fileName := "file" - _, fh := inode.Create(fileName, fuseops.OpMetadata{uint32(os.Getpid())}) + _, fh := inode.Create(fileName, fuseops.OpContext{uint32(os.Getpid())}) err = fh.FlushFile() t.Assert(err, IsNil) @@ -2874,7 +2875,7 @@ func (s *GoofysTest) TestDirMtimeCreate(t *C) { m1 := attr.Mtime time.Sleep(time.Second) - _, _ = root.Create("foo", fuseops.OpMetadata{uint32(os.Getpid())}) + _, _ = root.Create("foo", fuseops.OpContext{uint32(os.Getpid())}) attr2, _ := root.GetAttributes() m2 := attr2.Mtime @@ -2937,7 +2938,7 @@ func (s *GoofysTest) TestRead403(t *C) { in, err := s.LookUpInode(t, "file1") t.Assert(err, IsNil) - fh, err := in.OpenFile(fuseops.OpMetadata{uint32(os.Getpid())}) + fh, err := in.OpenFile(fuseops.OpContext{uint32(os.Getpid())}) t.Assert(err, IsNil) s3.awsConfig.Credentials = credentials.AnonymousCredentials @@ -3403,7 +3404,7 @@ func (s *GoofysTest) TestVFS(t *C) { _, err = in.LookUp("file5") t.Assert(err, Equals, fuse.ENOENT) - _, fh := in.Create("testfile", fuseops.OpMetadata{uint32(os.Getpid())}) + _, fh := in.Create("testfile", fuseops.OpContext{uint32(os.Getpid())}) err = fh.FlushFile() t.Assert(err, IsNil) @@ -3438,7 +3439,7 @@ func (s *GoofysTest) TestVFS(t *C) { // create another file inside subdir to make sure that our // mount check is correct for dir inside the root - _, fh = subdir.Create("testfile2", fuseops.OpMetadata{uint32(os.Getpid())}) + _, fh = subdir.Create("testfile2", fuseops.OpContext{uint32(os.Getpid())}) err = fh.FlushFile() t.Assert(err, IsNil) @@ -3719,7 +3720,7 @@ func (s *GoofysTest) testMountsNested(t *C, cloud StorageBackend, t.Assert(*dir_dir.Name, Equals, "dir") t.Assert(dir_dir.dir.cloud == cloud, Equals, true) - _, fh := dir_in.Create("testfile", fuseops.OpMetadata{uint32(os.Getpid())}) + _, fh := dir_in.Create("testfile", fuseops.OpContext{uint32(os.Getpid())}) err = fh.FlushFile() t.Assert(err, IsNil) @@ -3727,7 +3728,7 @@ func (s *GoofysTest) testMountsNested(t *C, cloud StorageBackend, t.Assert(err, IsNil) defer resp.Body.Close() - _, fh = dir_dir.Create("testfile", fuseops.OpMetadata{uint32(os.Getpid())}) + _, fh = dir_dir.Create("testfile", fuseops.OpContext{uint32(os.Getpid())}) err = fh.FlushFile() t.Assert(err, IsNil) @@ -3982,7 +3983,7 @@ func (s *GoofysTest) TestWriteListFlush(t *C) { t.Assert(err, IsNil) s.fs.insertInode(root, dir) - in, fh := dir.Create("file1", fuseops.OpMetadata{}) + in, fh := dir.Create("file1", fuseops.OpContext{}) t.Assert(in, NotNil) t.Assert(fh, NotNil) s.fs.insertInode(dir, in) @@ -4032,7 +4033,7 @@ func (s *GoofysTest) TestWriteUnlinkFlush(t *C) { t.Assert(err, IsNil) s.fs.insertInode(root, dir) - in, fh := dir.Create("deleted", fuseops.OpMetadata{}) + in, fh := dir.Create("deleted", fuseops.OpContext{}) t.Assert(in, NotNil) t.Assert(fh, NotNil) s.fs.insertInode(dir, in) @@ -4205,7 +4206,7 @@ func (s *GoofysTest) testReadMyOwnWriteFuse(t *C, externalUpdate bool) { // file is updated and not re-use cache _, adlv1 := s.cloud.(*ADLv1) _, isGCS := s.cloud.(*GCSBackend) - if !adlv1 && !isGCS { + if !adlv1 && !isGCS { cloud.err = fuse.EINVAL } } else { diff --git a/internal/handles.go b/internal/handles.go index 210f3b67..e8b308fb 100644 --- a/internal/handles.go +++ b/internal/handles.go @@ -518,7 +518,7 @@ func (inode *Inode) ListXattr() ([]string, error) { return xattrs, nil } -func (inode *Inode) OpenFile(metadata fuseops.OpMetadata) (fh *FileHandle, err error) { +func (inode *Inode) OpenFile(metadata fuseops.OpContext) (fh *FileHandle, err error) { inode.logFuse("OpenFile") inode.mu.Lock()