The functions worked incorrectly when the ranges were requested for part of the
file. Fix this.
Change-Id: Ib979c06a05dcbad1825b98199d23441d236fe5e4
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
assert extent_start % self.block_size == 0
assert extent_len % self.block_size == 0
+ if extent_block > start + count - 1:
+ return
+
first = max(extent_block, block)
- last = first + min(extent_count, count) - 1
+ last = min(extent_block + extent_count, start + count) - 1
yield (first, last)
extent += 1