Btrfs: heuristic: add byte core set calculation

Calculate byte core set for data sample:
- sort buckets' numbers in decreasing order
- count how many values cover 90% of the sample

If the core set size is low (<=25%), data are easily compressible.
If the core set size is high (>=80%), data are not compressible.

Signed-off-by: Timofey Titovets <[email protected]>
Reviewed-by: David Sterba <[email protected]>
[ update comments ]
Signed-off-by: David Sterba <[email protected]>
1 file changed