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()
|
||||
select {
|
||||
case <-pp.doneCh:
|
||||
res := pp.resp.Load().(*pieceAcceptResp)
|
||||
res := pp.resp
|
||||
return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err
|
||||
case <-ctx.Done():
|
||||
return api.SectorOffset{}, ctx.Err()
|
||||
@ -331,7 +331,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec
|
||||
assigned: false,
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec
|
||||
|
||||
select {
|
||||
case <-doneCh:
|
||||
res := pp.resp.Load().(*pieceAcceptResp)
|
||||
res := pp.resp
|
||||
return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err
|
||||
case <-ctx.Done():
|
||||
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"
|
||||
"errors"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
@ -149,7 +148,7 @@ type pieceAcceptResp struct {
|
||||
|
||||
type pendingPiece struct {
|
||||
doneCh chan struct{}
|
||||
resp atomic.Value
|
||||
resp *pieceAcceptResp
|
||||
|
||||
size abi.UnpaddedPieceSize
|
||||
deal api.PieceDealInfo
|
||||
|
Loading…
Reference in New Issue
Block a user