• Enzo Matsumiya's avatar
    smb: client: compress: LZ77 code improvements cleanup · 94ae8c3f
    Enzo Matsumiya authored
    - Check data compressibility with some heuristics (copied from
      btrfs):
      - should_compress() final decision is is_compressible(data)
    
    - Cleanup compress/lz77.h leaving only lz77_compress() exposed:
      - Move parts to compress/lz77.c, while removing the rest of it
        because they were either unused, used only once, were
        implemented wrong (thanks to David Howells for the help)
    
    - Updated the compression parameters (still compatible with
      Windows implementation) trading off ~20% compression ratio
      for ~40% performance:
      - min match len: 3 -> 4
      - max distance: 8KiB -> 1KiB
      - hash table type: u32 * -> u64 *
    
    Known bugs:
    This implementation currently works fine in general, but breaks with
    some payloads used during testing.  Investigation ongoing, to be
    fixed in a next commit.
    Signed-off-by: default avatarEnzo Matsumiya <ematsumiya@suse.de>
    Co-developed-by: default avatarDavid Howells <dhowells@redhat.com>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    94ae8c3f
lz77.c 4.18 KB