diff options
| author | Qu Wenruo <wqu@suse.com> | 2025-11-17 14:39:51 +1030 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-11-25 01:47:41 +0100 |
| commit | 53474a2ae17401821ce83c3b11f3d159f6b3583a (patch) | |
| tree | 104b509b4e6e288d95b550a44a21bb04e29b3019 /tools/lib/python/kdoc/enrich_formatter.py | |
| parent | 05ddf35a5d3d8d58323d6353f2bad026e9838af8 (diff) | |
btrfs: raid56: prepare steal_rbio() to support bs > ps cases
The function steal_rbio() assume each fs block can be mapped by
one page, blocking bs > ps support for raid56.
Prepare it for bs > ps cases by:
- Introduce two helpers to calculate the sector number
Previously we assume one page will contain at least one fs block, thus
can use something like "sectors_per_page = PAGE_SIZE / sectorsize;",
but with bs > ps support that above number will be 0.
Instead introduce two helpers:
* page_nr_to_sector_nr()
Returns the sector number of the first sector covered by the page.
* page_nr_to_num_sectors()
Return how many sectors are covered by the page.
And use the returned values for bitmap operations other than
open-coded "PAGE_SIZE / sectorsize".
Those helpers also have extra ASSERT()s to catch weird numbers.
- Use above helpers
The involved functions are:
* steal_rbio_page()
* is_data_stripe_page()
* full_page_sectors_uptodate()
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/lib/python/kdoc/enrich_formatter.py')
0 files changed, 0 insertions, 0 deletions
