Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 279f9d9

Browse files
committedJan 23, 2016
undo files pinning stuff
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent 8b432ab commit 279f9d9

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed
 

‎core/commands/files/files.go

-3
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,6 @@ are run with the '--flush=false'.
640640
return
641641
}
642642

643-
// take the lock and defer the unlock
644-
defer nd.Blockstore.PinLock().Unlock()
645-
646643
path := "/"
647644
if len(req.Arguments()) > 0 {
648645
path = req.Arguments()[0]

‎core/core.go

-24
Original file line numberDiff line numberDiff line change
@@ -474,30 +474,6 @@ func (n *IpfsNode) loadBootstrapPeers() ([]peer.PeerInfo, error) {
474474
func (n *IpfsNode) loadFilesRoot() error {
475475
dsk := ds.NewKey("/local/filesroot")
476476
pf := func(ctx context.Context, k key.Key) error {
477-
defer n.Blockstore.PinLock().Unlock()
478-
ds := n.Repo.Datastore()
479-
if old, err := ds.Get(dsk); err == nil && old != nil {
480-
err := n.Pinning.Unpin(ctx, key.Key(old.([]byte)), true)
481-
switch err {
482-
case nil, pin.ErrNotPinned:
483-
break
484-
default:
485-
return err
486-
}
487-
}
488-
nnd, err := n.DAG.Get(ctx, k)
489-
if err != nil {
490-
return err
491-
}
492-
493-
if err := n.Pinning.Pin(ctx, nnd, true); err != nil {
494-
return err
495-
}
496-
497-
if err := n.Pinning.Flush(); err != nil {
498-
return err
499-
}
500-
501477
return n.Repo.Datastore().Put(dsk, []byte(k))
502478
}
503479

0 commit comments

Comments
 (0)
Please sign in to comment.