Fixed bug in bitset_run_count which was causing data corruptionn writing

around sparse boundaries.
This commit is contained in:
Matthew Bloch
2012-06-07 12:27:46 +01:00
parent 3810a8210f
commit d763ab4e74

View File

@@ -147,7 +147,8 @@ static inline int bitset_run_count(
uint64_t len) uint64_t len)
{ {
INT_FIRST_AND_LAST; INT_FIRST_AND_LAST;
return bit_run_count(set->bits, first, bitlen) * set->resolution; return (bit_run_count(set->bits, first, bitlen) * set->resolution) -
(from % set->resolution);
} }
/** Tests whether the bit field is clear for the given file offset. /** Tests whether the bit field is clear for the given file offset.