forked from TrueCloudLab/frostfs-node
[#218] blobovnicza: Сreate at least one range bucket
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
1b0d2c67d1
commit
3acbd3011b
1 changed files with 9 additions and 1 deletions
|
@ -26,7 +26,7 @@ func (b *Blobovnicza) iterateBucketKeys(f func(uint64, uint64, []byte) (bool, er
|
|||
}
|
||||
|
||||
func (b *Blobovnicza) iterateBounds(f func(uint64, uint64) (bool, error)) error {
|
||||
for upper := firstBucketBound; upper <= b.objSizeLimit; upper *= 2 {
|
||||
for upper := firstBucketBound; upper <= max(b.objSizeLimit, firstBucketBound); upper *= 2 {
|
||||
var lower uint64
|
||||
|
||||
if upper == firstBucketBound {
|
||||
|
@ -44,3 +44,11 @@ func (b *Blobovnicza) iterateBounds(f func(uint64, uint64) (bool, error)) error
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func max(a, b uint64) uint64 {
|
||||
if a > b {
|
||||
return a
|
||||
}
|
||||
|
||||
return b
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue