Skip to content

Commit 08241d3

Browse files
Christoph Hellwigkdave
authored andcommitted
btrfs: raid56: handle endio in scrub_rbio
The only caller of scrub_rbio calls rbio_orig_end_io right after it, move it into scrub_rbio to match the other work item helpers. Reviewed-by: Qu Wenruo <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 40f87dd commit 08241d3

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

fs/btrfs/raid56.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,26 +2701,26 @@ static int scrub_assemble_read_bios(struct btrfs_raid_bio *rbio)
27012701
return 0;
27022702
}
27032703

2704-
static int scrub_rbio(struct btrfs_raid_bio *rbio)
2704+
static void scrub_rbio(struct btrfs_raid_bio *rbio)
27052705
{
27062706
bool need_check = false;
27072707
int sector_nr;
27082708
int ret;
27092709

27102710
ret = alloc_rbio_essential_pages(rbio);
27112711
if (ret)
2712-
return ret;
2712+
goto out;
27132713

27142714
bitmap_clear(rbio->error_bitmap, 0, rbio->nr_sectors);
27152715

27162716
ret = scrub_assemble_read_bios(rbio);
27172717
if (ret < 0)
2718-
return ret;
2718+
goto out;
27192719

27202720
/* We may have some failures, recover the failed sectors first. */
27212721
ret = recover_scrub_rbio(rbio);
27222722
if (ret < 0)
2723-
return ret;
2723+
goto out;
27242724

27252725
/*
27262726
* We have every sector properly prepared. Can finish the scrub
@@ -2737,17 +2737,13 @@ static int scrub_rbio(struct btrfs_raid_bio *rbio)
27372737
break;
27382738
}
27392739
}
2740-
return ret;
2740+
out:
2741+
rbio_orig_end_io(rbio, errno_to_blk_status(ret));
27412742
}
27422743

27432744
static void scrub_rbio_work_locked(struct work_struct *work)
27442745
{
2745-
struct btrfs_raid_bio *rbio;
2746-
int ret;
2747-
2748-
rbio = container_of(work, struct btrfs_raid_bio, work);
2749-
ret = scrub_rbio(rbio);
2750-
rbio_orig_end_io(rbio, errno_to_blk_status(ret));
2746+
scrub_rbio(container_of(work, struct btrfs_raid_bio, work));
27512747
}
27522748

27532749
void raid56_parity_submit_scrub_rbio(struct btrfs_raid_bio *rbio)

0 commit comments

Comments
 (0)