Skip to content

Commit

Permalink
undo files pinning stuff
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <[email protected]>
  • Loading branch information
whyrusleeping committed Jan 23, 2016
1 parent 8b432ab commit 279f9d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions core/commands/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,6 @@ are run with the '--flush=false'.
return
}

// take the lock and defer the unlock
defer nd.Blockstore.PinLock().Unlock()

path := "/"
if len(req.Arguments()) > 0 {
path = req.Arguments()[0]
Expand Down
24 changes: 0 additions & 24 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,30 +474,6 @@ func (n *IpfsNode) loadBootstrapPeers() ([]peer.PeerInfo, error) {
func (n *IpfsNode) loadFilesRoot() error {
dsk := ds.NewKey("/local/filesroot")
pf := func(ctx context.Context, k key.Key) error {
defer n.Blockstore.PinLock().Unlock()
ds := n.Repo.Datastore()
if old, err := ds.Get(dsk); err == nil && old != nil {
err := n.Pinning.Unpin(ctx, key.Key(old.([]byte)), true)
switch err {
case nil, pin.ErrNotPinned:
break
default:
return err
}
}
nnd, err := n.DAG.Get(ctx, k)
if err != nil {
return err
}

if err := n.Pinning.Pin(ctx, nnd, true); err != nil {
return err
}

if err := n.Pinning.Flush(); err != nil {
return err
}

return n.Repo.Datastore().Put(dsk, []byte(k))
}

Expand Down

0 comments on commit 279f9d9

Please sign in to comment.