Skip to content

Commit 2ef1aff

Browse files
committed
fix build
1 parent 7fd51d8 commit 2ef1aff

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

connection.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,12 @@ func (c *Connection) SetNotifyContext(op interface{}) (context.Context, error) {
433433
return nil, err
434434
}
435435

436-
var ctx context.Context
436+
// var ctx context.Context
437+
438+
ctx := context.Background()
437439

440+
// maybe no need this switch
441+
// why ctx is nil from beginOp?
438442
switch op.(type) {
439443
case *fuseops.NotifyInvalInodeOp:
440444
ctx = c.beginOp(100+uint32(fusekernel.NotifyCodeInvalInode), 0)
@@ -543,7 +547,7 @@ func (c *Connection) Reply(ctx context.Context, opErr error) {
543547

544548
// The NotifyKernel is same as Reply func of Connection.But the diff is
545549
// that the func only send to kernel.
546-
func (c *Connection) NotifyKernel(opstate opState) {
550+
func (c *Connection) NotifyKernel(opstate *opState) {
547551

548552
if opstate == nil {
549553
panic(fmt.Sprintf("must init notify op"))

fuseutil/file_system.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (s *fileSystemServer) InvalidateEntry(parent fuseops.InodeID, name string)
140140
panic(fmt.Sprintf("notify op have invalid context: %#v", ctx))
141141
}
142142
s.opsInFlight.Add(1)
143-
go func(opstate opState) {
143+
go func(opstate *opState) {
144144
defer s.opsInFlight.Done()
145145
c.NotifyKernel(opstate)
146146
}(opstate)
@@ -164,7 +164,7 @@ func (s *fileSystemServer) NotifyDelete(
164164
panic(fmt.Sprintf("notify op have invalid context: %#v", ctx))
165165
}
166166
s.opsInFlight.Add(1)
167-
go func(opstate opState) {
167+
go func(opstate *opState) {
168168
defer s.opsInFlight.Done()
169169
c.NotifyKernel(opstate)
170170
}(opstate)
@@ -189,7 +189,7 @@ func (s *fileSystemServer) InvalidateInode(
189189
panic(fmt.Sprintf("notify op have invalid context: %#v", ctx))
190190
}
191191
s.opsInFlight.Add(1)
192-
go func(opstate opState) {
192+
go func(opstate *opState) {
193193
defer s.opsInFlight.Done()
194194
c.NotifyKernel(opstate)
195195
}(opstate)

0 commit comments

Comments
 (0)