@@ -133,11 +133,17 @@ func (s *fileSystemServer) InvalidateEntry(parent fuseops.InodeID, name string)
133133 Name : string (name ),
134134 }
135135 ctx , _ := c .SetNotifyContext (op )
136+ var key interface {} = contextKey
137+ foo := ctx .Value (key )
138+ opstate , ok := foo .(opState )
139+ if ! ok {
140+ panic (fmt .Sprintf ("notify op have invalid context: %#v" , ctx ))
141+ }
136142 s .opsInFlight .Add (1 )
137- go func (ctx context. Context ) {
143+ go func (opstate OpState ) {
138144 defer s .opsInFlight .Done ()
139- c .NotifyKernel (ctx )
140- }(ctx )
145+ c .NotifyKernel (opstate )
146+ }(opstate )
141147 return nil
142148}
143149func (s * fileSystemServer ) NotifyDelete (
@@ -151,11 +157,17 @@ func (s *fileSystemServer) NotifyDelete(
151157 Name : string (name ),
152158 }
153159 ctx , _ := c .SetNotifyContext (op )
160+ var key interface {} = contextKey
161+ foo := ctx .Value (key )
162+ opstate , ok := foo .(opState )
163+ if ! ok {
164+ panic (fmt .Sprintf ("notify op have invalid context: %#v" , ctx ))
165+ }
154166 s .opsInFlight .Add (1 )
155- go func (ctx context. Context ) {
167+ go func (opstate OpState ) {
156168 defer s .opsInFlight .Done ()
157- c .NotifyKernel (ctx )
158- }(ctx )
169+ c .NotifyKernel (opstate )
170+ }(opstate )
159171 return nil
160172
161173}
@@ -170,11 +182,17 @@ func (s *fileSystemServer) InvalidateInode(
170182 Len : len ,
171183 }
172184 ctx , _ := c .SetNotifyContext (op )
185+ var key interface {} = contextKey
186+ foo := ctx .Value (key )
187+ opstate , ok := foo .(opState )
188+ if ! ok {
189+ panic (fmt .Sprintf ("notify op have invalid context: %#v" , ctx ))
190+ }
173191 s .opsInFlight .Add (1 )
174- go func (ctx context. Context ) {
192+ go func (opstate OpState ) {
175193 defer s .opsInFlight .Done ()
176- c .NotifyKernel (ctx )
177- }(ctx )
194+ c .NotifyKernel (opstate )
195+ }(opstate )
178196 return nil
179197
180198}
0 commit comments