Posix CreateFile should work for compressed lengths (#7584)

This commit is contained in:
Praveen raj Mani
2019-05-01 04:57:31 +05:30
committed by kannappanr
parent a436f2baa5
commit c113d4e49c
6 changed files with 61 additions and 75 deletions

View File

@@ -103,6 +103,9 @@ func (e *Erasure) ShardFileSize(totalLength int64) int64 {
if totalLength == 0 {
return 0
}
if totalLength == -1 {
return -1
}
numShards := totalLength / e.blockSize
lastBlockSize := totalLength % int64(e.blockSize)
lastShardSize := ceilFrac(lastBlockSize, int64(e.dataBlocks))