|
@@ -229,7 +229,9 @@ int btrfs_pin_log_trans(struct btrfs_root *root)
|
|
void btrfs_end_log_trans(struct btrfs_root *root)
|
|
void btrfs_end_log_trans(struct btrfs_root *root)
|
|
{
|
|
{
|
|
if (atomic_dec_and_test(&root->log_writers)) {
|
|
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))
|
|
if (waitqueue_active(&root->log_writer_wait))
|
|
wake_up(&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);
|
|
mutex_lock(&log_root_tree->log_mutex);
|
|
if (atomic_dec_and_test(&log_root_tree->log_writers)) {
|
|
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))
|
|
if (waitqueue_active(&log_root_tree->log_writer_wait))
|
|
wake_up(&log_root_tree->log_writer_wait);
|
|
wake_up(&log_root_tree->log_writer_wait);
|
|
}
|
|
}
|