diff options
author | David Sterba <dsterba@suse.com> | 2015-02-16 13:41:40 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-10-10 12:42:00 -0400 |
commit | ee86395458072760d62e66aad10a5e9e8902b8cf (patch) | |
tree | b3293bde46967a886b5d066028c5eceebd810dac /fs/btrfs/locking.c | |
parent | 779adf0f647651f5a45eeee3442c881300ce989e (diff) |
btrfs: comment the rest of implicit barriers before waitqueue_active
There are atomic operations that imply the barrier for waitqueue_active
mixed in an if-condition.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/locking.c')
-rw-r--r-- | fs/btrfs/locking.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 03f8630dbaf2..8077461fc56a 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c | |||
@@ -79,6 +79,9 @@ void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw) | |||
79 | write_lock(&eb->lock); | 79 | write_lock(&eb->lock); |
80 | WARN_ON(atomic_read(&eb->spinning_writers)); | 80 | WARN_ON(atomic_read(&eb->spinning_writers)); |
81 | atomic_inc(&eb->spinning_writers); | 81 | atomic_inc(&eb->spinning_writers); |
82 | /* | ||
83 | * atomic_dec_and_test implies a barrier for waitqueue_active | ||
84 | */ | ||
82 | if (atomic_dec_and_test(&eb->blocking_writers) && | 85 | if (atomic_dec_and_test(&eb->blocking_writers) && |
83 | waitqueue_active(&eb->write_lock_wq)) | 86 | waitqueue_active(&eb->write_lock_wq)) |
84 | wake_up(&eb->write_lock_wq); | 87 | wake_up(&eb->write_lock_wq); |
@@ -86,6 +89,9 @@ void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw) | |||
86 | BUG_ON(atomic_read(&eb->blocking_readers) == 0); | 89 | BUG_ON(atomic_read(&eb->blocking_readers) == 0); |
87 | read_lock(&eb->lock); | 90 | read_lock(&eb->lock); |
88 | atomic_inc(&eb->spinning_readers); | 91 | atomic_inc(&eb->spinning_readers); |
92 | /* | ||
93 | * atomic_dec_and_test implies a barrier for waitqueue_active | ||
94 | */ | ||
89 | if (atomic_dec_and_test(&eb->blocking_readers) && | 95 | if (atomic_dec_and_test(&eb->blocking_readers) && |
90 | waitqueue_active(&eb->read_lock_wq)) | 96 | waitqueue_active(&eb->read_lock_wq)) |
91 | wake_up(&eb->read_lock_wq); | 97 | wake_up(&eb->read_lock_wq); |
@@ -229,6 +235,9 @@ void btrfs_tree_read_unlock_blocking(struct extent_buffer *eb) | |||
229 | } | 235 | } |
230 | btrfs_assert_tree_read_locked(eb); | 236 | btrfs_assert_tree_read_locked(eb); |
231 | WARN_ON(atomic_read(&eb->blocking_readers) == 0); | 237 | WARN_ON(atomic_read(&eb->blocking_readers) == 0); |
238 | /* | ||
239 | * atomic_dec_and_test implies a barrier for waitqueue_active | ||
240 | */ | ||
232 | if (atomic_dec_and_test(&eb->blocking_readers) && | 241 | if (atomic_dec_and_test(&eb->blocking_readers) && |
233 | waitqueue_active(&eb->read_lock_wq)) | 242 | waitqueue_active(&eb->read_lock_wq)) |
234 | wake_up(&eb->read_lock_wq); | 243 | wake_up(&eb->read_lock_wq); |