btrfs: raid56: remove the "_step" infix

The following functions are introduced as a middle step for bs > ps
support:

- rbio_streip_step_paddr()
- rbio_pstripe_step_paddr()
- rbio_qstripe_step_paddr()
- sector_step_paddr_in_rbio()

As there is already an existing function without the infix, and has a
different parameter list.

But the existing functions have been cleaned up, there is no need to
keep the "_step" infix, just remove it completely.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2025-11-16 10:32:50 +10:30 committed by David Sterba
parent 8870dbeedc
commit 1a332a6d70
1 changed files with 16 additions and 16 deletions

View File

@ -735,25 +735,25 @@ static unsigned int rbio_paddr_index(const struct btrfs_raid_bio *rbio,
return ret; return ret;
} }
static phys_addr_t rbio_stripe_step_paddr(const struct btrfs_raid_bio *rbio, static phys_addr_t rbio_stripe_paddr(const struct btrfs_raid_bio *rbio,
unsigned int stripe_nr, unsigned int sector_nr, unsigned int stripe_nr, unsigned int sector_nr,
unsigned int step_nr) unsigned int step_nr)
{ {
return rbio->stripe_paddrs[rbio_paddr_index(rbio, stripe_nr, sector_nr, step_nr)]; return rbio->stripe_paddrs[rbio_paddr_index(rbio, stripe_nr, sector_nr, step_nr)];
} }
static phys_addr_t rbio_pstripe_step_paddr(const struct btrfs_raid_bio *rbio, static phys_addr_t rbio_pstripe_paddr(const struct btrfs_raid_bio *rbio,
unsigned int sector_nr, unsigned int step_nr) unsigned int sector_nr, unsigned int step_nr)
{ {
return rbio_stripe_step_paddr(rbio, rbio->nr_data, sector_nr, step_nr); return rbio_stripe_paddr(rbio, rbio->nr_data, sector_nr, step_nr);
} }
static phys_addr_t rbio_qstripe_step_paddr(const struct btrfs_raid_bio *rbio, static phys_addr_t rbio_qstripe_paddr(const struct btrfs_raid_bio *rbio,
unsigned int sector_nr, unsigned int step_nr) unsigned int sector_nr, unsigned int step_nr)
{ {
if (rbio->nr_data + 1 == rbio->real_stripes) if (rbio->nr_data + 1 == rbio->real_stripes)
return INVALID_PADDR; return INVALID_PADDR;
return rbio_stripe_step_paddr(rbio, rbio->nr_data + 1, sector_nr, step_nr); return rbio_stripe_paddr(rbio, rbio->nr_data + 1, sector_nr, step_nr);
} }
/* Return a paddr pointer into the rbio::stripe_paddrs[] for the specified sector. */ /* Return a paddr pointer into the rbio::stripe_paddrs[] for the specified sector. */
@ -1033,9 +1033,9 @@ static phys_addr_t *sector_paddrs_in_rbio(struct btrfs_raid_bio *rbio,
* Similar to sector_paddr_in_rbio(), but with extra consideration for * Similar to sector_paddr_in_rbio(), but with extra consideration for
* bs > ps cases, where we can have multiple steps for a fs block. * bs > ps cases, where we can have multiple steps for a fs block.
*/ */
static phys_addr_t sector_step_paddr_in_rbio(struct btrfs_raid_bio *rbio, static phys_addr_t sector_paddr_in_rbio(struct btrfs_raid_bio *rbio,
int stripe_nr, int sector_nr, int step_nr, int stripe_nr, int sector_nr, int step_nr,
bool bio_list_only) bool bio_list_only)
{ {
phys_addr_t ret = INVALID_PADDR; phys_addr_t ret = INVALID_PADDR;
const int index = rbio_paddr_index(rbio, stripe_nr, sector_nr, step_nr); const int index = rbio_paddr_index(rbio, stripe_nr, sector_nr, step_nr);
@ -1413,10 +1413,10 @@ static void generate_pq_vertical_step(struct btrfs_raid_bio *rbio, unsigned int
/* First collect one sector from each data stripe */ /* First collect one sector from each data stripe */
for (stripe = 0; stripe < rbio->nr_data; stripe++) for (stripe = 0; stripe < rbio->nr_data; stripe++)
pointers[stripe] = kmap_local_paddr( pointers[stripe] = kmap_local_paddr(
sector_step_paddr_in_rbio(rbio, stripe, sector_nr, step_nr, 0)); sector_paddr_in_rbio(rbio, stripe, sector_nr, step_nr, 0));
/* Then add the parity stripe */ /* Then add the parity stripe */
pointers[stripe++] = kmap_local_paddr(rbio_pstripe_step_paddr(rbio, sector_nr, step_nr)); pointers[stripe++] = kmap_local_paddr(rbio_pstripe_paddr(rbio, sector_nr, step_nr));
if (has_qstripe) { if (has_qstripe) {
/* /*
@ -1424,7 +1424,7 @@ static void generate_pq_vertical_step(struct btrfs_raid_bio *rbio, unsigned int
* to fill in our p/q * to fill in our p/q
*/ */
pointers[stripe++] = kmap_local_paddr( pointers[stripe++] = kmap_local_paddr(
rbio_qstripe_step_paddr(rbio, sector_nr, step_nr)); rbio_qstripe_paddr(rbio, sector_nr, step_nr));
assert_rbio(rbio); assert_rbio(rbio);
raid6_call.gen_syndrome(rbio->real_stripes, step, pointers); raid6_call.gen_syndrome(rbio->real_stripes, step, pointers);
@ -1958,9 +1958,9 @@ static void recover_vertical_step(struct btrfs_raid_bio *rbio,
* bio list if possible. * bio list if possible.
*/ */
if (rbio->operation == BTRFS_RBIO_READ_REBUILD) { if (rbio->operation == BTRFS_RBIO_READ_REBUILD) {
paddr = sector_step_paddr_in_rbio(rbio, stripe_nr, sector_nr, step_nr, 0); paddr = sector_paddr_in_rbio(rbio, stripe_nr, sector_nr, step_nr, 0);
} else { } else {
paddr = rbio_stripe_step_paddr(rbio, stripe_nr, sector_nr, step_nr); paddr = rbio_stripe_paddr(rbio, stripe_nr, sector_nr, step_nr);
} }
pointers[stripe_nr] = kmap_local_paddr(paddr); pointers[stripe_nr] = kmap_local_paddr(paddr);
unmap_array[stripe_nr] = pointers[stripe_nr]; unmap_array[stripe_nr] = pointers[stripe_nr];
@ -2651,8 +2651,8 @@ static bool verify_one_parity_step(struct btrfs_raid_bio *rbio,
/* First collect one page from each data stripe. */ /* First collect one page from each data stripe. */
for (int stripe = 0; stripe < nr_data; stripe++) for (int stripe = 0; stripe < nr_data; stripe++)
pointers[stripe] = kmap_local_paddr( pointers[stripe] = kmap_local_paddr(
sector_step_paddr_in_rbio(rbio, stripe, sector_nr, sector_paddr_in_rbio(rbio, stripe, sector_nr,
step_nr, 0)); step_nr, 0));
if (has_qstripe) { if (has_qstripe) {
assert_rbio(rbio); assert_rbio(rbio);
@ -2665,7 +2665,7 @@ static bool verify_one_parity_step(struct btrfs_raid_bio *rbio,
} }
/* Check scrubbing parity and repair it. */ /* Check scrubbing parity and repair it. */
parity = kmap_local_paddr(rbio_stripe_step_paddr(rbio, rbio->scrubp, sector_nr, step_nr)); parity = kmap_local_paddr(rbio_stripe_paddr(rbio, rbio->scrubp, sector_nr, step_nr));
if (memcmp(parity, pointers[rbio->scrubp], step) != 0) if (memcmp(parity, pointers[rbio->scrubp], step) != 0)
memcpy(parity, pointers[rbio->scrubp], step); memcpy(parity, pointers[rbio->scrubp], step);
else else