summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.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/ordered-data.c
parent33a9eca7e4a4c2c17aebbb11f0e506a48ebc30c9 (diff)
downloadlinux-a83342aa0c8f0ca90057d3837ae8d198186e5153.tar.bz2
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/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 52170cf1757e..071005f008c1 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -345,6 +345,9 @@ int btrfs_dec_test_first_ordered_pending(struct inode *inode,
if (entry->bytes_left == 0) {
ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags);
+ /*
+ * Implicit memory barrier after test_and_set_bit
+ */
if (waitqueue_active(&entry->wait))
wake_up(&entry->wait);
} else {
@@ -409,6 +412,9 @@ have_entry:
if (entry->bytes_left == 0) {
ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags);
+ /*
+ * Implicit memory barrier after test_and_set_bit
+ */
if (waitqueue_active(&entry->wait))
wake_up(&entry->wait);
} else {