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
+4 -1
View File
@@ -97,7 +97,9 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i
// Save the current part name and size.
partName := xlMeta.Parts[partIndex].Name
partSize := xlMeta.Parts[partIndex].Size
readSize := partSize - partOffset
// readSize should be adjusted so that we don't write more data than what was requested.
if readSize > (length - totalBytesRead) {
readSize = length - totalBytesRead
}
@@ -110,7 +112,8 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i
totalBytesRead += n
// Reset part offset to 0 to read rest of the part from the beginning.
// partOffset will be valid only for the first part, hence reset it to 0 for
// the remaining parts.
partOffset = 0
} // End of read all parts loop.