XL/erasure-read: Add Comments and enable bitrot detection.

This commit is contained in:
Krishna Srinivas
2016-06-22 21:35:03 +05:30
parent 17efaaa902
commit d4bea5fbf8
3 changed files with 100 additions and 54 deletions

View File

@@ -89,10 +89,11 @@ func getDataBlocks(enBlocks [][]byte, dataBlocks int, curBlockSize int) (data []
}
// getBlockInfo - find start/end block and bytes to skip for given offset, length and block size.
func getBlockInfo(offset, blockSize int64) (startBlock, bytesToSkip int64) {
func getBlockInfo(offset, length, blockSize int64) (startBlock, endBlock, bytesToSkip int64) {
// Calculate start block for given offset and how many bytes to skip to get the offset.
startBlock = offset / blockSize
bytesToSkip = offset % blockSize
endBlock = length / blockSize
return
}