diff options
author | Qu Wenruo <wqu@suse.com> | 2021-09-27 10:22:04 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 20:08:05 +0300 |
commit | d4088803f51140e9324f66453bdd24e48f982a1e (patch) | |
tree | 2dd338b0fa20764e0142906cddabf27f0f8492e5 /README | |
parent | 2b83a0eea5a15d2651953a8cbb1afd0608b6e588 (diff) | |
download | linux-d4088803f51140e9324f66453bdd24e48f982a1e.tar.xz |
btrfs: subpage: make lzo_compress_pages() compatible
There are several problems in lzo_compress_pages() preventing it from
being subpage compatible:
- No page offset is calculated when reading from inode pages
For subpage case, we could have @start which is not aligned to
PAGE_SIZE.
Thus the destination where we read data from must take offset in page
into consideration.
- The padding for segment header is bound to PAGE_SIZE
This means, for subpage case we can skip several corners where on x86
machines we need to add padding zeros.
The rework will:
- Update the comment to replace "page" with "sector"
- Introduce a new helper, copy_compressed_data_to_page(), to do the copy
So that we don't need to bother page switching for both input and
output.
Now in lzo_compress_pages() we only care about page switching for
input, while in copy_compressed_data_to_page() we only care about the
page switching for output.
- Only one main cursor
For lzo_compress_pages() we use @cur_in as main cursor.
It will be the file offset we are currently at.
All other helper variables will be only declared inside the loop.
For copy_compressed_data_to_page() it's similar, we will have
@cur_out at the main cursor, which records how many bytes are in the
output.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions