btrfs: raid56: remove sector_ptr structure

Since sector_ptr structure is now only containing a single paddr, there
is no need to use that structure.

Instead use phys_addr_t array for bio and stripe pointers.

This means several helpers are also needed to accept a paddr instead of
a sector_ptr pointer.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo
2025-11-24 22:42:23 +01:00
committed by David Sterba
parent 1810350b04
commit 5387bd9581
2 changed files with 128 additions and 169 deletions
+125 -158
View File
File diff suppressed because it is too large Load Diff
+3 -11
View File
@@ -16,7 +16,6 @@
#include "volumes.h"
struct page;
struct sector_ptr;
struct btrfs_fs_info;
enum btrfs_rbio_ops {
@@ -116,13 +115,10 @@ struct btrfs_raid_bio {
struct page **stripe_pages;
/* Pointers to the sectors in the bio_list, for faster lookup */
struct sector_ptr *bio_sectors;
phys_addr_t *bio_paddrs;
/*
* For subpage support, we need to map each sector to above
* stripe_pages.
*/
struct sector_ptr *stripe_sectors;
/* Pointers to the sectors in the stripe_pages[]. */
phys_addr_t *stripe_paddrs;
/* Each set bit means the corresponding sector in stripe_sectors[] is uptodate. */
unsigned long *stripe_uptodate_bitmap;
@@ -134,10 +130,6 @@ struct btrfs_raid_bio {
* The bitmap recording where IO errors happened.
* Each bit is corresponding to one sector in either bio_sectors[] or
* stripe_sectors[] array.
*
* The reason we don't use another bit in sector_ptr is, we have two
* arrays of sectors, and a lot of IO can use sectors in both arrays.
* Thus making it much harder to iterate.
*/
unsigned long *error_bitmap;