]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: reflink: make copy_inline_to_page() to be subpage compatible
authorQu Wenruo <wqu@suse.com>
Mon, 31 May 2021 08:50:53 +0000 (16:50 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:10 +0000 (15:19 +0200)
commitaab0715437b567b859b5d35920d03d8f9da0760c
treeb6e474e2398b0ef0ecdc5cfb20ed46d7e7a40fb5
parentf910a8641db73cb5984853606f8d25a28cab7daa
btrfs: reflink: make copy_inline_to_page() to be subpage compatible

The modifications are:

- Page copy destination
  For subpage case, one page can contain multiple sectors, thus we can
  no longer expect the memcpy_to_page()/btrfs_decompress() to copy
  data into page offset 0.
  The correct offset is offset_in_page(file_offset) now, which should
  handle both regular sectorsize and subpage cases well.

- Page status update
  Now we need to use subpage helper to handle the page status update.

Tested-by: Ritesh Harjani <riteshh@linux.ibm.com> # [ppc64]
Tested-by: Anand Jain <anand.jain@oracle.com> # [aarch64]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/reflink.c