btrfs: expand subpage support to any PAGE_SIZE > 4K
authorQu Wenruo <wqu@suse.com>
Thu, 13 Jan 2022 05:22:10 +0000 (13:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 15 Feb 2022 15:56:13 +0000 (16:56 +0100)
commitbac1332b0b69a5873a2ef048e79a0abeebae3c4f
tree48fbe0a5083057f627da3c3ad34a19f6b3760325
parent8e7f7bf59a797938a4b92f6031e617603842278c
btrfs: expand subpage support to any PAGE_SIZE > 4K

With the recent change in metadata handling, we can handle metadata in
the following cases:

- nodesize < PAGE_SIZE and sectorsize < PAGE_SIZE
  Go subpage routine for both metadata and data.

- nodesize < PAGE_SIZE and sectorsize >= PAGE_SIZE
  Invalid case for now. As we require nodesize >= sectorsize.

- nodesize >= PAGE_SIZE and sectorsize < PAGE_SIZE
  Go subpage routine for data, but regular page routine for metadata.

- nodesize >= PAGE_SIZE and sectorsize >= PAGE_SIZE
  Go regular page routine for both metadata and data.

Now we can handle any sectorsize < PAGE_SIZE, plus the existing
sectorsize == PAGE_SIZE support.

But here we introduce an artificial limit, any PAGE_SIZE > 4K case, we
will only support 4K and PAGE_SIZE as sector size.

The idea here is to reduce the test combinations, and push 4K as the
default standard in the future.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/sysfs.c