|
|
@ -174,13 +174,14 @@ func (xl XL) ReadFile(volume, path string, startOffset int64) (io.ReadCloser, er |
|
|
|
|
|
|
|
|
|
|
|
// Verify if the offset is right for the block, if not move to
|
|
|
|
// Verify if the offset is right for the block, if not move to
|
|
|
|
// the next block.
|
|
|
|
// the next block.
|
|
|
|
|
|
|
|
|
|
|
|
if startOffset > 0 { |
|
|
|
if startOffset > 0 { |
|
|
|
startOffset = startOffset - int64(len(dataBlocks)) |
|
|
|
startOffset = startOffset - int64(len(dataBlocks)) |
|
|
|
if startOffset > int64(len(dataBlocks)) { |
|
|
|
// Start offset is greater than or equal to zero, skip the dataBlocks.
|
|
|
|
|
|
|
|
if startOffset >= 0 { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
// Fetch back the overflow offset, to skip from the current data
|
|
|
|
// Now get back the remaining offset if startOffset is negative.
|
|
|
|
// blocks.
|
|
|
|
|
|
|
|
startOffset = startOffset + int64(len(dataBlocks)) |
|
|
|
startOffset = startOffset + int64(len(dataBlocks)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|