btrfs: migrate subpage code to folio interfaces
authorQu Wenruo <wqu@suse.com>
Tue, 12 Dec 2023 02:28:37 +0000 (12:58 +1030)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 22:03:58 +0000 (23:03 +0100)
commit55151ea9ec1b40170dad5766c2d7f36105be42cd
treec1d54a40f0d57563bfde58716f60166eb9366679
parent8d993618350c86da11cb408ba529c13e83d09527
btrfs: migrate subpage code to folio interfaces

Although subpage itself is conflicting with higher folio, since subpage
(sectorsize < PAGE_SIZE and nodesize < PAGE_SIZE) means we will never
need higher order folio, there is a hidden pitfall:

- btrfs_page_*() helpers

Those helpers are an abstraction to handle both subpage and non-subpage
cases, which means we're going to pass pages pointers to those helpers.

And since those helpers are shared between data and metadata paths, it's
unavoidable to let them to handle folios, including higher order
folios).

Meanwhile for true subpage case, we should only have a single page
backed folios anyway, thus add a new ASSERT() for btrfs_subpage_assert()
to ensure that.

Also since those helpers are shared between both data and metadata, add
some extra ASSERT()s for data path to make sure we only get single page
backed folio for now.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
12 files changed:
fs/btrfs/compression.c
fs/btrfs/defrag.c
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/file.c
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c
fs/btrfs/ordered-data.c
fs/btrfs/reflink.c
fs/btrfs/relocation.c
fs/btrfs/subpage.c
fs/btrfs/subpage.h