Skip to content

Commit

Permalink
switching fuse lib to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
monthonk authored and kahing committed May 16, 2022
1 parent 08534b2 commit 829d8e5
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 38 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
19 changes: 9 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand All @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion internal/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion internal/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 5 additions & 4 deletions internal/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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()

Expand Down
35 changes: 18 additions & 17 deletions internal/goofys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -3719,15 +3720,15 @@ 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)

resp, err := cloud.GetBlob(&GetBlobInput{Key: "b/testfile"})
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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/handles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 829d8e5

Please sign in to comment.