changes as per review
This commit is contained in:
parent
c2522e8ca9
commit
56926b349a
6
extern/storage-sealing/input.go
vendored
6
extern/storage-sealing/input.go
vendored
@ -315,7 +315,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec
|
|||||||
m.inputLk.Unlock()
|
m.inputLk.Unlock()
|
||||||
select {
|
select {
|
||||||
case <-pp.doneCh:
|
case <-pp.doneCh:
|
||||||
res := pp.resp.Load().(*pieceAcceptResp)
|
res := pp.resp
|
||||||
return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err
|
return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return api.SectorOffset{}, ctx.Err()
|
return api.SectorOffset{}, ctx.Err()
|
||||||
@ -331,7 +331,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec
|
|||||||
assigned: false,
|
assigned: false,
|
||||||
}
|
}
|
||||||
pp.accepted = func(sn abi.SectorNumber, offset abi.UnpaddedPieceSize, err error) {
|
pp.accepted = func(sn abi.SectorNumber, offset abi.UnpaddedPieceSize, err error) {
|
||||||
pp.resp.Store(&pieceAcceptResp{sn, offset, err})
|
pp.resp = &pieceAcceptResp{sn, offset, err}
|
||||||
close(pp.doneCh)
|
close(pp.doneCh)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-doneCh:
|
case <-doneCh:
|
||||||
res := pp.resp.Load().(*pieceAcceptResp)
|
res := pp.resp
|
||||||
return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err
|
return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return api.SectorOffset{}, ctx.Err()
|
return api.SectorOffset{}, ctx.Err()
|
||||||
|
3
extern/storage-sealing/sealing.go
vendored
3
extern/storage-sealing/sealing.go
vendored
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
@ -149,7 +148,7 @@ type pieceAcceptResp struct {
|
|||||||
|
|
||||||
type pendingPiece struct {
|
type pendingPiece struct {
|
||||||
doneCh chan struct{}
|
doneCh chan struct{}
|
||||||
resp atomic.Value
|
resp *pieceAcceptResp
|
||||||
|
|
||||||
size abi.UnpaddedPieceSize
|
size abi.UnpaddedPieceSize
|
||||||
deal api.PieceDealInfo
|
deal api.PieceDealInfo
|
||||||
|
Loading…
Reference in New Issue
Block a user