Skip to content

Commit e66d8d5

Browse files
committed
btrfs: raid56: use new helper for async_read_rebuild
Signed-off-by: David Sterba <[email protected]>
1 parent cf6a4a7 commit e66d8d5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

fs/btrfs/raid56.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio);
162162
static noinline void finish_rmw(struct btrfs_raid_bio *rbio);
163163
static void rmw_work(struct btrfs_work *work);
164164
static void read_rebuild_work(struct btrfs_work *work);
165-
static void async_read_rebuild(struct btrfs_raid_bio *rbio);
166165
static int fail_bio_stripe(struct btrfs_raid_bio *rbio, struct bio *bio);
167166
static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed);
168167
static void __free_raid_bio(struct btrfs_raid_bio *rbio);
@@ -804,10 +803,10 @@ static noinline void unlock_stripe(struct btrfs_raid_bio *rbio)
804803
spin_unlock_irqrestore(&h->lock, flags);
805804

806805
if (next->operation == BTRFS_RBIO_READ_REBUILD)
807-
async_read_rebuild(next);
806+
start_async_work(next, read_rebuild_work);
808807
else if (next->operation == BTRFS_RBIO_REBUILD_MISSING) {
809808
steal_rbio(rbio, next);
810-
async_read_rebuild(next);
809+
start_async_work(next, read_rebuild_work);
811810
} else if (next->operation == BTRFS_RBIO_WRITE) {
812811
steal_rbio(rbio, next);
813812
start_async_work(next, rmw_work);
@@ -1500,14 +1499,6 @@ static void raid_rmw_end_io(struct bio *bio)
15001499
rbio_orig_end_io(rbio, BLK_STS_IOERR);
15011500
}
15021501

1503-
static 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-
15111502
/*
15121503
* the stripe must be locked by the caller. It will
15131504
* unlock after all the writes are done
@@ -2765,5 +2756,5 @@ raid56_alloc_missing_rbio(struct btrfs_fs_info *fs_info, struct bio *bio,
27652756
void raid56_submit_missing_rbio(struct btrfs_raid_bio *rbio)
27662757
{
27672758
if (!lock_stripe_add(rbio))
2768-
async_read_rebuild(rbio);
2759+
start_async_work(rbio, read_rebuild_work);
27692760
}

0 commit comments

Comments
 (0)