mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Simplify erasure code by separating bitrot from erasure code (#5959)
This commit is contained in:
committed by
kannappanr
parent
37de2dbd3b
commit
ce02ab613d
@@ -103,16 +103,3 @@ func (xl xlObjects) isObjectDir(bucket, prefix string) (ok bool) {
|
||||
} // Exhausted all disks - return false.
|
||||
return false
|
||||
}
|
||||
|
||||
// Calculate the space occupied by an object in a single disk
|
||||
func (xl xlObjects) sizeOnDisk(fileSize int64, blockSize int64, dataBlocks int) int64 {
|
||||
numBlocks := fileSize / blockSize
|
||||
chunkSize := ceilFrac(blockSize, int64(dataBlocks))
|
||||
sizeInDisk := numBlocks * chunkSize
|
||||
remaining := fileSize % blockSize
|
||||
if remaining > 0 {
|
||||
sizeInDisk += ceilFrac(remaining, int64(dataBlocks))
|
||||
}
|
||||
|
||||
return sizeInDisk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user