Skip to content

Commit

Permalink
btrfs: raid56: add new helper for starting async work
Browse files Browse the repository at this point in the history
Add helper that schedules a given function to run on the rmw workqueue.
This will replace several standalone helpers.

Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Aug 6, 2018
1 parent ebcc326 commit ac63885
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/raid56.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
int need_check);
static void async_scrub_parity(struct btrfs_raid_bio *rbio);

static void start_async_work(struct btrfs_raid_bio *rbio, btrfs_func_t work_func)
{
btrfs_init_work(&rbio->work, btrfs_rmw_helper, work_func, NULL, NULL);
btrfs_queue_work(rbio->fs_info->rmw_workers, &rbio->work);
}

/*
* the stripe hash table is used for locking, and to collect
* bios in hopes of making a full stripe
Expand Down

0 comments on commit ac63885

Please sign in to comment.