• Qu Wenruo's avatar
    btrfs: compression: add error handling for missed page cache · 6de35954
    Qu Wenruo authored
    For all the supported compression algorithms, the compression path would
    always need to grab the page cache, then do the compression.
    
    Normally we would get a page reference without any problem, since the
    write path should have already locked the pages in the write range.
    For the sake of error handling, we should handle the page cache miss
    case.
    
    Adds a common wrapper, btrfs_compress_find_get_page(), which calls
    find_get_page(), and do the error handling along with an error message.
    
    Callers inside compression path would only need to call
    btrfs_compress_find_get_page(), and error out if it returned any error.
    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>
    6de35954
compression.h 6.19 KB