summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/raid56.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-06-29 04:57:00 -0400
committerDavid Sterba <dsterba@suse.com>2018-08-06 07:12:45 -0400
commite66d8d5a41c1e3c560fc7aba4edcb53caf4f26c8 (patch)
tree175e979e07f9a99fa0daeef5cc61021498bf8be4 /fs/btrfs/raid56.c
parentcf6a4a7587dc997b29359e29cf14079e1931715b (diff)
btrfs: raid56: use new helper for async_read_rebuild
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r--fs/btrfs/raid56.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 96a7d3445623..f9b349171d61 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -162,7 +162,6 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio);
162static noinline void finish_rmw(struct btrfs_raid_bio *rbio); 162static noinline void finish_rmw(struct btrfs_raid_bio *rbio);
163static void rmw_work(struct btrfs_work *work); 163static void rmw_work(struct btrfs_work *work);
164static void read_rebuild_work(struct btrfs_work *work); 164static void read_rebuild_work(struct btrfs_work *work);
165static void async_read_rebuild(struct btrfs_raid_bio *rbio);
166static int fail_bio_stripe(struct btrfs_raid_bio *rbio, struct bio *bio); 165static int fail_bio_stripe(struct btrfs_raid_bio *rbio, struct bio *bio);
167static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed); 166static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed);
168static void __free_raid_bio(struct btrfs_raid_bio *rbio); 167static void __free_raid_bio(struct btrfs_raid_bio *rbio);
@@ -804,10 +803,10 @@ static noinline void unlock_stripe(struct btrfs_raid_bio *rbio)
804 spin_unlock_irqrestore(&h->lock, flags); 803 spin_unlock_irqrestore(&h->lock, flags);
805 804
806 if (next->operation == BTRFS_RBIO_READ_REBUILD) 805 if (next->operation == BTRFS_RBIO_READ_REBUILD)
807 async_read_rebuild(next); 806 start_async_work(next, read_rebuild_work);
808 else if (next->operation == BTRFS_RBIO_REBUILD_MISSING) { 807 else if (next->operation == BTRFS_RBIO_REBUILD_MISSING) {
809 steal_rbio(rbio, next); 808 steal_rbio(rbio, next);
810 async_read_rebuild(next); 809 start_async_work(next, read_rebuild_work);
811 } else if (next->operation == BTRFS_RBIO_WRITE) { 810 } else if (next->operation == BTRFS_RBIO_WRITE) {
812 steal_rbio(rbio, next); 811 steal_rbio(rbio, next);
813 start_async_work(next, rmw_work); 812 start_async_work(next, rmw_work);
@@ -1500,14 +1499,6 @@ cleanup:
1500 rbio_orig_end_io(rbio, BLK_STS_IOERR); 1499 rbio_orig_end_io(rbio, BLK_STS_IOERR);
1501} 1500}
1502 1501
1503static void async_read_rebuild(struct btrfs_raid_bio *rbio)
1504{
1505 btrfs_init_work(&rbio->work, btrfs_rmw_helper,
1506 read_rebuild_work, NULL, NULL);
1507
1508 btrfs_queue_work(rbio->fs_info->rmw_workers, &rbio->work);
1509}
1510
1511/* 1502/*
1512 * the stripe must be locked by the caller. It will 1503 * the stripe must be locked by the caller. It will
1513 * unlock after all the writes are done 1504 * unlock after all the writes are done
@@ -2765,5 +2756,5 @@ raid56_alloc_missing_rbio(struct btrfs_fs_info *fs_info, struct bio *bio,
2765void raid56_submit_missing_rbio(struct btrfs_raid_bio *rbio) 2756void raid56_submit_missing_rbio(struct btrfs_raid_bio *rbio)
2766{ 2757{
2767 if (!lock_stripe_add(rbio)) 2758 if (!lock_stripe_add(rbio))
2768 async_read_rebuild(rbio); 2759 start_async_work(rbio, read_rebuild_work);
2769} 2760}