]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/tree-log.c
Merge branch 'fix/waitqueue-barriers' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / fs / btrfs / tree-log.c
index c3f9a9c71f28fa5f8930e86c43df03e43e3b79a9..1fffe8845c09b4bb09c1e515d2e6ab73d5deb536 100644 (file)
@@ -229,7 +229,9 @@ int btrfs_pin_log_trans(struct btrfs_root *root)
 void btrfs_end_log_trans(struct btrfs_root *root)
 {
        if (atomic_dec_and_test(&root->log_writers)) {
-               smp_mb();
+               /*
+                * Implicit memory barrier after atomic_dec_and_test
+                */
                if (waitqueue_active(&root->log_writer_wait))
                        wake_up(&root->log_writer_wait);
        }
@@ -2820,7 +2822,9 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
 
        mutex_lock(&log_root_tree->log_mutex);
        if (atomic_dec_and_test(&log_root_tree->log_writers)) {
-               smp_mb();
+               /*
+                * Implicit memory barrier after atomic_dec_and_test
+                */
                if (waitqueue_active(&log_root_tree->log_writer_wait))
                        wake_up(&log_root_tree->log_writer_wait);
        }
@@ -2950,6 +2954,9 @@ out_wake_log_root:
        atomic_set(&log_root_tree->log_commit[index2], 0);
        mutex_unlock(&log_root_tree->log_mutex);
 
+       /*
+        * The barrier before waitqueue_active is implied by mutex_unlock
+        */
        if (waitqueue_active(&log_root_tree->log_commit_wait[index2]))
                wake_up(&log_root_tree->log_commit_wait[index2]);
 out:
@@ -2961,6 +2968,9 @@ out:
        atomic_set(&root->log_commit[index1], 0);
        mutex_unlock(&root->log_mutex);
 
+       /*
+        * The barrier before waitqueue_active is implied by mutex_unlock
+        */
        if (waitqueue_active(&root->log_commit_wait[index1]))
                wake_up(&root->log_commit_wait[index1]);
        return ret;