diff options
author | David Sterba <dsterba@suse.com> | 2018-02-26 16:15:17 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:23:09 +0200 |
commit | 093258e6ebaf178bb25da514f0d1f744968cc900 (patch) | |
tree | c9ee01a7d5cc576fbe07f0df782088ce504791d1 /fs/btrfs/dev-replace.c | |
parent | 3d3a2e610ea5e7c6d4f9481ecce5d8e2d8317843 (diff) | |
download | linux-stable-093258e6ebaf178bb25da514f0d1f744968cc900.tar.gz linux-stable-093258e6ebaf178bb25da514f0d1f744968cc900.tar.bz2 linux-stable-093258e6ebaf178bb25da514f0d1f744968cc900.zip |
btrfs: replace waitqueue_actvie with cond_wake_up
Use the wrappers and reduce the amount of low-level details about the
waitqueue management.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r-- | fs/btrfs/dev-replace.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 12f703e127dd..89946285203d 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -1009,9 +1009,9 @@ void btrfs_dev_replace_clear_lock_blocking( ASSERT(atomic_read(&dev_replace->read_locks) > 0); ASSERT(atomic_read(&dev_replace->blocking_readers) > 0); read_lock(&dev_replace->lock); - if (atomic_dec_and_test(&dev_replace->blocking_readers) && - waitqueue_active(&dev_replace->read_lock_wq)) - wake_up(&dev_replace->read_lock_wq); + /* Barrier implied by atomic_dec_and_test */ + if (atomic_dec_and_test(&dev_replace->blocking_readers)) + cond_wake_up_nomb(&dev_replace->read_lock_wq); } void btrfs_bio_counter_inc_noblocked(struct btrfs_fs_info *fs_info) @@ -1022,9 +1022,7 @@ void btrfs_bio_counter_inc_noblocked(struct btrfs_fs_info *fs_info) void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount) { percpu_counter_sub(&fs_info->bio_counter, amount); - - if (waitqueue_active(&fs_info->replace_wait)) - wake_up(&fs_info->replace_wait); + cond_wake_up_nomb(&fs_info->replace_wait); } void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info) |