aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/raid56.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2022-04-01 19:23:25 +0800
committerDavid Sterba <dsterba@suse.com>2022-05-16 17:03:15 +0200
commitf77183dc1f53b2f924e9ba3bd1602b585097ec3d (patch)
treed8af962acf7b150ad9ad4bf76a28025e07b899b4 /fs/btrfs/raid56.c
parent1145059ae55f7dc1cc04a986ec770b0945236699 (diff)
btrfs: raid56: open code rbio_stripe_page_index()
There is only one caller for that helper now, and we're definitely fine to open-code it. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r--fs/btrfs/raid56.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 262cabe7953f..84eb4890eea1 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -701,11 +701,6 @@ static struct sector_ptr *rbio_qstripe_sector(const struct btrfs_raid_bio *rbio,
return rbio_stripe_sector(rbio, rbio->nr_data + 1, sector_nr);
}
-static int rbio_stripe_page_index(struct btrfs_raid_bio *rbio, int stripe, int index)
-{
- return stripe * rbio->stripe_npages + index;
-}
-
/*
* The first stripe in the table for a logical address
* has the lock. rbios are added in one of three ways:
@@ -1116,7 +1111,7 @@ static int alloc_rbio_pages(struct btrfs_raid_bio *rbio)
/* only allocate pages for p/q stripes */
static int alloc_rbio_parity_pages(struct btrfs_raid_bio *rbio)
{
- int data_pages = rbio_stripe_page_index(rbio, rbio->nr_data, 0);
+ const int data_pages = rbio->nr_data * rbio->stripe_npages;
int ret;
ret = btrfs_alloc_page_array(rbio->nr_pages - data_pages,