fix: curio: Pass taskID to WritePiece

This commit is contained in:
Łukasz Magiera 2024-04-03 15:22:42 +02:00 committed by Łukasz Magiera
parent 6997162c71
commit 416d7ef860
2 changed files with 4 additions and 3 deletions

View File

@ -8,13 +8,14 @@ import (
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/lotus/lib/harmony/harmonytask"
"github.com/filecoin-project/lotus/storage/sealer/storiface" "github.com/filecoin-project/lotus/storage/sealer/storiface"
) )
func (sb *SealCalls) WritePiece(ctx context.Context, pieceID storiface.PieceNumber, size int64, data io.Reader) error { func (sb *SealCalls) WritePiece(ctx context.Context, taskID *harmonytask.TaskID, pieceID storiface.PieceNumber, size int64, data io.Reader) error {
// todo: config(?): allow setting PathStorage for this // todo: config(?): allow setting PathStorage for this
// todo storage reservations // todo storage reservations
paths, done, err := sb.sectors.AcquireSector(ctx, nil, pieceID.Ref(), storiface.FTNone, storiface.FTPiece, storiface.PathSealing) paths, done, err := sb.sectors.AcquireSector(ctx, taskID, pieceID.Ref(), storiface.FTNone, storiface.FTPiece, storiface.PathSealing)
if err != nil { if err != nil {
return err return err
} }

View File

@ -152,7 +152,7 @@ func (p *ParkPieceTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (d
pnum := storiface.PieceNumber(pieceData.PieceID) pnum := storiface.PieceNumber(pieceData.PieceID)
if err := p.sc.WritePiece(ctx, pnum, pieceRawSize, upr); err != nil { if err := p.sc.WritePiece(ctx, &taskID, pnum, pieceRawSize, upr); err != nil {
return false, xerrors.Errorf("write piece: %w", err) return false, xerrors.Errorf("write piece: %w", err)
} }