Address review
This commit is contained in:
parent
13176e8b53
commit
c06dc750da
@ -19,7 +19,6 @@ func (m *Manager) CheckProvable(ctx context.Context, spt abi.RegisteredProof, se
|
||||
var bad []abi.SectorID
|
||||
|
||||
// TODO: More better checks
|
||||
// TODO: This should live in sector-storage
|
||||
// TODO: Use proper locking
|
||||
for _, sector := range sectors {
|
||||
err := func() error {
|
||||
|
@ -73,7 +73,9 @@ func (t SectorFileType) SealSpaceUse(spt abi.RegisteredProof) (uint64, error) {
|
||||
return need, nil
|
||||
}
|
||||
|
||||
func (t SectorFileType) All() (out [FileTypes]bool) {
|
||||
func (t SectorFileType) All() [FileTypes]bool {
|
||||
var out [FileTypes]bool
|
||||
|
||||
for i := range out {
|
||||
out[i] = t&(1<<i) > 0
|
||||
}
|
||||
|
@ -26,7 +26,8 @@ func (l *sectorLock) canLock(read SectorFileType, write SectorFileType) bool {
|
||||
}
|
||||
}
|
||||
|
||||
return l.w&(read|write) == 0
|
||||
// check that there are no locks taken for either read or write file types we want
|
||||
return l.w&read == 0 && l.w&write == 0
|
||||
}
|
||||
|
||||
func (l *sectorLock) tryLock(read SectorFileType, write SectorFileType) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user