diff options
author | David Sterba <dsterba@suse.com> | 2015-02-16 13:39:00 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-10-10 12:40:33 -0400 |
commit | 779adf0f647651f5a45eeee3442c881300ce989e (patch) | |
tree | 4f9e555faf8ce150305cea076a31d509653205bb /fs/btrfs/tree-log.c | |
parent | a83342aa0c8f0ca90057d3837ae8d198186e5153 (diff) |
btrfs: remove extra barrier before waitqueue_active
Removing barriers is scary, but a call to atomic_dec_and_test implies
a barrier, so we don't need to issue another one.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d0deb4643502..63275594debd 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -229,7 +229,9 @@ int btrfs_pin_log_trans(struct btrfs_root *root) | |||
229 | void btrfs_end_log_trans(struct btrfs_root *root) | 229 | void btrfs_end_log_trans(struct btrfs_root *root) |
230 | { | 230 | { |
231 | if (atomic_dec_and_test(&root->log_writers)) { | 231 | if (atomic_dec_and_test(&root->log_writers)) { |
232 | smp_mb(); | 232 | /* |
233 | * Implicit memory barrier after atomic_dec_and_test | ||
234 | */ | ||
233 | if (waitqueue_active(&root->log_writer_wait)) | 235 | if (waitqueue_active(&root->log_writer_wait)) |
234 | wake_up(&root->log_writer_wait); | 236 | wake_up(&root->log_writer_wait); |
235 | } | 237 | } |
@@ -2820,7 +2822,9 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, | |||
2820 | 2822 | ||
2821 | mutex_lock(&log_root_tree->log_mutex); | 2823 | mutex_lock(&log_root_tree->log_mutex); |
2822 | if (atomic_dec_and_test(&log_root_tree->log_writers)) { | 2824 | if (atomic_dec_and_test(&log_root_tree->log_writers)) { |
2823 | smp_mb(); | 2825 | /* |
2826 | * Implicit memory barrier after atomic_dec_and_test | ||
2827 | */ | ||
2824 | if (waitqueue_active(&log_root_tree->log_writer_wait)) | 2828 | if (waitqueue_active(&log_root_tree->log_writer_wait)) |
2825 | wake_up(&log_root_tree->log_writer_wait); | 2829 | wake_up(&log_root_tree->log_writer_wait); |
2826 | } | 2830 | } |