btrfs: add a size parameter to btrfs_alloc_subpage()
authorQu Wenruo <wqu@suse.com>
Mon, 10 Mar 2025 03:16:10 +0000 (13:46 +1030)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:52 +0000 (20:35 +0100)
commitcb3c11d2f5e11e274095fc162669c8d2b7a77944
treea8c0da22e0ee12ae3cc035ab4664d55d53df83a9
parent4c14d5c85503da0a21540b1fb80bf5abb723f16e
btrfs: add a size parameter to btrfs_alloc_subpage()

Since we can no longer assume page sized folio for data filemap folios,
allow btrfs_alloc_subpage() to accept a new parameter, @fsize,
indicating the folio size.

This doesn't follow the regular behavior of passing a folio directly,
because this function is shared by both data and metadata folios, and
for metadata folios we have extra allocation policy to ensure no large
folios whose sizes are larger than nodesize (unless it's page sized).

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
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/extent_io.c
fs/btrfs/subpage.c
fs/btrfs/subpage.h