Btrfs: heuristic: add detection of repeated data patterns
authorTimofey Titovets <nefelim4ag@gmail.com>
Thu, 28 Sep 2017 14:33:39 +0000 (17:33 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Nov 2017 19:45:36 +0000 (20:45 +0100)
commit1fe4f6fa5ae7dd1e63145e1ced7b9b38854da9f4
treedbe0f0b44b9814655e5b64e8b0cc72db375227b9
parenta440d48c7f93af5bae86af676cc6cd4e9fd6015f
Btrfs: heuristic: add detection of repeated data patterns

Walk over data sample and use memcmp to detect repeated patterns, like
zeros, but a bit more general.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ minor coding style fixes ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c