summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-02-16 21:36:47 +0300
committerDavid Sterba <dsterba@suse.com>2015-10-10 19:40:04 +0300
commita83342aa0c8f0ca90057d3837ae8d198186e5153 (patch)
tree723d60098638e0f048ae630399d2f77d0e1a0c9d /fs/btrfs/compression.c
parent33a9eca7e4a4c2c17aebbb11f0e506a48ebc30c9 (diff)
downloadlinux-a83342aa0c8f0ca90057d3837ae8d198186e5153.tar.xz
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/compression.c')
-rw-r--r--fs/btrfs/compression.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 57ee8ca29b06..3a9317ce67f8 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -839,6 +839,9 @@ static void free_workspace(int type, struct list_head *workspace)
btrfs_compress_op[idx]->free_workspace(workspace);
atomic_dec(alloc_workspace);
wake:
+ /*
+ * Make sure counter is updated before we wake up waiters.
+ */
smp_mb();
if (waitqueue_active(workspace_wait))
wake_up(workspace_wait);