diff options
author | David Sterba <dsterba@suse.com> | 2018-06-29 11:56:56 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 14:12:44 +0300 |
commit | ac63885907ee25bf277fa39ba66a0d85dec20786 (patch) | |
tree | b3022a953af5e0e9375488ab6c61dff41cbe747b | |
parent | ebcc326316f3d798e9715e5ca1451c3e457b95dd (diff) | |
download | linux-ac63885907ee25bf277fa39ba66a0d85dec20786.tar.xz |
btrfs: raid56: add new helper for starting async work
Add helper that schedules a given function to run on the rmw workqueue.
This will replace several standalone helpers.
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/raid56.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 1a1b7d6c44cb..f30d847baf07 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -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 |