summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/locking.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-02-16 19:36:47 +0100
committerDavid Sterba <dsterba@suse.com>2015-10-10 18:40:04 +0200
commita83342aa0c8f0ca90057d3837ae8d198186e5153 (patch)
tree723d60098638e0f048ae630399d2f77d0e1a0c9d /fs/btrfs/locking.c
parentbtrfs: comment waitqueue_active implied by locks (diff)
downloadlinux-a83342aa0c8f0ca90057d3837ae8d198186e5153.tar.xz
linux-a83342aa0c8f0ca90057d3837ae8d198186e5153.zip
btrfs: add comments to barriers before waitqueue_active
Reduce number of undocumented barriers out there. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/locking.c')
-rw-r--r--fs/btrfs/locking.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index d7e6baf1b205..03f8630dbaf2 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -280,6 +280,9 @@ void btrfs_tree_unlock(struct extent_buffer *eb)
if (blockers) {
WARN_ON(atomic_read(&eb->spinning_writers));
atomic_dec(&eb->blocking_writers);
+ /*
+ * Make sure counter is updated before we wake up waiters.
+ */
smp_mb();
if (waitqueue_active(&eb->write_lock_wq))
wake_up(&eb->write_lock_wq);