diff options
author | Qu Wenruo <wqu@suse.com> | 2023-12-12 12:58:36 +1030 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-12-15 23:03:58 +0100 |
commit | 8d993618350c86da11cb408ba529c13e83d09527 (patch) | |
tree | 84a989e89170245800023b400f9b5cd1bc8e87db /fs/btrfs/subpage.h | |
parent | 4a565c8069b7578a79d193d277e9c760aacf3e75 (diff) |
btrfs: migrate get_eb_page_index() and get_eb_offset_in_page() to folios
These two functions are still using the old page based code, which is
not going to handle larger folios at all.
The migration itself is going to involve the following changes:
- PAGE_SIZE -> folio_size()
- PAGE_SHIFT -> folio_shift()
- get_eb_page_index() -> get_eb_folio_index()
- get_eb_offset_in_page() -> get_eb_offset_in_folio()
And since we're going to support larger folios, although above straight
conversion is good enough, this patch would add extra comments in the
involved functions to explain why the same single line code can now
cover 3 cases:
- folio_size == PAGE_SIZE, sectorsize == PAGE_SIZE, nodesize >= PAGE_SIZE
The common, non-subpage case with per-page folio.
- folio_size > PAGE_SIZE, sectorsize == PAGE_SIZE, nodesize >= PAGE_SIZE
The incoming larger folio, non-subpage case.
- folio_size == PAGE_SIZE, sectorsize < PAGE_SIZE, nodesize < PAGE_SIZE
The existing subpage case, we won't larger folio anyway.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/subpage.h')
0 files changed, 0 insertions, 0 deletions