• Qu Wenruo's avatar
    btrfs: make compression path to be subpage compatible · fd1e75d0
    Qu Wenruo authored
    Currently btrfs compression path is not really subpage compatible, every
    thing is still done in page unit.
    
    That's fine for regular sector size and subpage routine. As even for
    subpage routine compression is only enabled if the whole range is page
    aligned, so reading the page cache in page unit is totally fine.
    
    However in preparation for the future subpage perfect compression
    support, we need to change the compression routine to properly handle a
    subpage range.
    
    This patch would prepare both zlib and zstd to only read the subpage
    range for compression.
    Lzo is already doing subpage aware read, as lzo's on-disk format is
    already sectorsize dependent.
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    fd1e75d0
zstd.c 19.6 KB