@@ -2335,7 +2335,7 @@ static void rmw_rbio_work_locked(struct work_struct *work)
struct btrfs_raid_bio *raid56_parity_alloc_scrub_rbio(struct bio *bio,
struct btrfs_io_context *bioc,
struct btrfs_device *scrub_dev,
- unsigned long *dbitmap, int stripe_nsectors)
+ unsigned long *dbitmap)
{
struct btrfs_fs_info *fs_info = bioc->fs_info;
struct btrfs_raid_bio *rbio;
@@ -2365,7 +2365,7 @@ struct btrfs_raid_bio *raid56_parity_alloc_scrub_rbio(struct bio *bio,
}
ASSERT(i < rbio->real_stripes);
- bitmap_copy(&rbio->dbitmap, dbitmap, stripe_nsectors);
+ bitmap_copy(&rbio->dbitmap, dbitmap, rbio->stripe_nsectors);
return rbio;
}
@@ -189,7 +189,7 @@ void raid56_parity_write(struct bio *bio, struct btrfs_io_context *bioc);
struct btrfs_raid_bio *raid56_parity_alloc_scrub_rbio(struct bio *bio,
struct btrfs_io_context *bioc,
struct btrfs_device *scrub_dev,
- unsigned long *dbitmap, int stripe_nsectors);
+ unsigned long *dbitmap);
void raid56_parity_submit_scrub_rbio(struct btrfs_raid_bio *rbio);
void raid56_parity_cache_data_pages(struct btrfs_raid_bio *rbio,
@@ -1914,8 +1914,7 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx,
btrfs_bio_counter_dec(fs_info);
goto out;
}
- rbio = raid56_parity_alloc_scrub_rbio(bio, bioc, scrub_dev, &extent_bitmap,
- BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits);
+ rbio = raid56_parity_alloc_scrub_rbio(bio, bioc, scrub_dev, &extent_bitmap);
btrfs_put_bioc(bioc);
if (!rbio) {
ret = -ENOMEM;
The parameter @stripe_nsectors is easily calculated using BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits, and is already cached in rbio->stripe_nsectors. Thus we don't need to pass that parameter from the caller, and can remove it safely. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/raid56.c | 4 ++-- fs/btrfs/raid56.h | 2 +- fs/btrfs/scrub.c | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-)