Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
interface-test
Commits
f044b3a0
Commit
f044b3a0
authored
Aug 11, 2021
by
董子豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
3037b667
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
sealer_cgo.go
extern/sector-storage/ffiwrapper/sealer_cgo.go
+3
-3
No files found.
extern/sector-storage/ffiwrapper/sealer_cgo.go
View file @
f044b3a0
...
@@ -44,7 +44,7 @@ func (sb *Sealer) NewSector(ctx context.Context, sector storage.SectorRef) error
...
@@ -44,7 +44,7 @@ func (sb *Sealer) NewSector(ctx context.Context, sector storage.SectorRef) error
return
nil
return
nil
}
}
func
(
sb
*
Sealer
)
AddPiece
(
ctx
context
.
Context
,
sector
storage
.
SectorRef
,
existingPieceSizes
[]
abi
.
UnpaddedPieceSize
,
pieceSize
abi
.
UnpaddedPieceSize
,
file
storage
.
Data
)
(
abi
.
PieceInfo
,
error
)
{
func
(
sb
*
Sealer
)
AddPiece
(
ctx
context
.
Context
,
sector
storage
.
SectorRef
,
existingPieceSizes
[]
abi
.
UnpaddedPieceSize
,
pieceSize
abi
.
UnpaddedPieceSize
,
file
storage
.
Data
,
numbers
...
int32
)
(
abi
.
PieceInfo
,
error
)
{
// TODO: allow tuning those:
// TODO: allow tuning those:
chunk
:=
abi
.
PaddedPieceSize
(
4
<<
20
)
chunk
:=
abi
.
PaddedPieceSize
(
4
<<
20
)
parallel
:=
runtime
.
NumCPU
()
parallel
:=
runtime
.
NumCPU
()
...
@@ -82,7 +82,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
...
@@ -82,7 +82,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
var
stagedPath
storiface
.
SectorPaths
var
stagedPath
storiface
.
SectorPaths
if
len
(
existingPieceSizes
)
==
0
{
if
len
(
existingPieceSizes
)
==
0
{
stagedPath
,
done
,
err
=
sb
.
sectors
.
AcquireSector
(
ctx
,
sector
,
0
,
storiface
.
FTUnsealed
,
storiface
.
PathSealing
)
stagedPath
,
done
,
err
=
sb
.
sectors
.
AcquireSector
(
ctx
,
sector
,
0
,
storiface
.
FTUnsealed
,
storiface
.
PathSealing
,
numbers
...
)
if
err
!=
nil
{
if
err
!=
nil
{
return
abi
.
PieceInfo
{},
xerrors
.
Errorf
(
"acquire unsealed sector: %w"
,
err
)
return
abi
.
PieceInfo
{},
xerrors
.
Errorf
(
"acquire unsealed sector: %w"
,
err
)
}
}
...
@@ -92,7 +92,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
...
@@ -92,7 +92,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
return
abi
.
PieceInfo
{},
xerrors
.
Errorf
(
"creating unsealed sector file: %w"
,
err
)
return
abi
.
PieceInfo
{},
xerrors
.
Errorf
(
"creating unsealed sector file: %w"
,
err
)
}
}
}
else
{
}
else
{
stagedPath
,
done
,
err
=
sb
.
sectors
.
AcquireSector
(
ctx
,
sector
,
storiface
.
FTUnsealed
,
0
,
storiface
.
PathSealing
)
stagedPath
,
done
,
err
=
sb
.
sectors
.
AcquireSector
(
ctx
,
sector
,
storiface
.
FTUnsealed
,
0
,
storiface
.
PathSealing
,
numbers
...
)
if
err
!=
nil
{
if
err
!=
nil
{
return
abi
.
PieceInfo
{},
xerrors
.
Errorf
(
"acquire unsealed sector: %w"
,
err
)
return
abi
.
PieceInfo
{},
xerrors
.
Errorf
(
"acquire unsealed sector: %w"
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment