@@ -59,6 +59,9 @@ var FilesStatCmd = &cmds.Command{
59
59
return
60
60
}
61
61
62
+ // take the lock and defer the unlock
63
+ defer node .Blockstore .PinLock ()()
64
+
62
65
path , err := checkPath (req .Arguments ()[0 ])
63
66
if err != nil {
64
67
res .SetError (err , cmds .ErrNormal )
@@ -138,6 +141,9 @@ var FilesCpCmd = &cmds.Command{
138
141
return
139
142
}
140
143
144
+ // take the lock and defer the unlock
145
+ defer node .Blockstore .PinLock ()()
146
+
141
147
src , err := checkPath (req .Arguments ()[0 ])
142
148
if err != nil {
143
149
res .SetError (err , cmds .ErrNormal )
@@ -233,6 +239,9 @@ Examples:
233
239
return
234
240
}
235
241
242
+ // take the lock and defer the unlock
243
+ defer nd .Blockstore .PinLock ()()
244
+
236
245
fsn , err := mfs .Lookup (nd .FilesRoot , path )
237
246
if err != nil {
238
247
res .SetError (err , cmds .ErrNormal )
@@ -323,6 +332,9 @@ Examples:
323
332
return
324
333
}
325
334
335
+ // take the lock and defer the unlock
336
+ defer n .Blockstore .PinLock ()()
337
+
326
338
path , err := checkPath (req .Arguments ()[0 ])
327
339
if err != nil {
328
340
res .SetError (err , cmds .ErrNormal )
@@ -409,6 +421,9 @@ Example:
409
421
return
410
422
}
411
423
424
+ // take the lock and defer the unlock
425
+ defer n .Blockstore .PinLock ()()
426
+
412
427
src , err := checkPath (req .Arguments ()[0 ])
413
428
if err != nil {
414
429
res .SetError (err , cmds .ErrNormal )
@@ -484,6 +499,9 @@ Warning:
484
499
return
485
500
}
486
501
502
+ // take the lock and defer the unlock
503
+ defer nd .Blockstore .PinLock ()()
504
+
487
505
offset , _ , err := req .Option ("offset" ).Int ()
488
506
if err != nil {
489
507
res .SetError (err , cmds .ErrNormal )
@@ -579,6 +597,9 @@ Examples:
579
597
return
580
598
}
581
599
600
+ // take the lock and defer the unlock
601
+ defer n .Blockstore .PinLock ()()
602
+
582
603
dashp , _ , _ := req .Option ("parents" ).Bool ()
583
604
dirtomake , err := checkPath (req .Arguments ()[0 ])
584
605
if err != nil {
@@ -628,6 +649,9 @@ remove files or directories
628
649
return
629
650
}
630
651
652
+ // take the lock and defer the unlock
653
+ defer nd .Blockstore .PinLock ()()
654
+
631
655
path , err := checkPath (req .Arguments ()[0 ])
632
656
if err != nil {
633
657
res .SetError (err , cmds .ErrNormal )
0 commit comments